Skip to content

Commit aa6f7ff

Browse files
committed
Update docs, first attempt at GitHub actions
1 parent 6a65193 commit aa6f7ff

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

.github/workflows/gradle.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Node.js CI
2+
3+
on:
4+
push:
5+
branches: "**"
6+
pull_request:
7+
branches: "**"
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [ 16.x ]
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm ci
25+
- run: npm run build --if-present
26+
- uses: actions/upload-artifact@v2
27+
with:
28+
name: Package
29+
path:
30+
- main.js
31+
- package.json

CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Development
2+
To contribute, anyone can make Pull Requests. Considering this is a hobby project, they may or may not be merged, and merges may take a while depending on my available schedule.
3+
To start contributing, reading the Obsidian plugin *getting started* entry on the [obsidian forum](https://forum.obsidian.md/t/how-to-get-started-with-developing-a-custom-plugin/8157/3) may help.
4+
For documentation on watchers for ActivityWatch, the [ActivityWatch watcher documentation](https://docs.activitywatch.net/en/latest/examples/writing-watchers.html) might help. Just keep in mind Obsidian does not allow post requests using axios or fetch due to CORS policy. There is an official JS client for ActivityWatch at https://github.com/ActivityWatch/aw-client-js, but it does not work due to using axios instead of the unrestricted request of the Obsidian API. Any requests to ActivityWatch API being made need to be rewritten to use the Obsidian request API.
5+
6+
## Requirements
7+
Any change made must satisfy the requirements of [Obsidian's plugin review](https://github.com/obsidianmd/obsidian-releases/blob/master/plugin-review.md). Changes should also be as unobtrusive to previously collected userdata as possible to not break existing installations. Further, contributions must satisfy GitHub TOS, which includes anyone only contributing code they have permission to use, either by writing themselves, by license or explicitly.
8+
I ask to not trigger the version bump tool in npm as that is the last step that happens before a release is made.
9+
10+
## Building
11+
During testing of development, `npm run dev` will continuously check for files being changed and run the build task. If you clone this repository directly into the plugins folder of an obsidian vault, simply reloading obsidian or disabling and reneabling the plugin in the community plugins tab will load the newly compiled version after changes have been made.
12+
During development, it is advisable to start your ActivityWatch server using `aw-server --testing` or `aw-server --testing --verbose` and switching to development server in the plugin settings inside obsidian. That way the plugin will not access your ActivityWatch production server.
13+
To build a version for production, `npm run build` has to be triggered. However, this is only relevant if installing patched versions manually without a proper release as well as making sure the plugin actually builds.

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ActivityWatch and Obsidian compatibility
2-
ActivityWatch (https://activitywatch.net/) is an open source time tracker capable of keeping track how much time is spent using which program. To get detailed info, ActivityWatch allows adding *Watchers* capable of sending relevant information to the ActivityWatch API.
2+
[ActivityWatch](https://activitywatch.net/) is an open source time tracker capable of keeping track how much time is spent using which program. To get detailed info, ActivityWatch allows adding *Watchers* capable of sending relevant information to the ActivityWatch API.
33

44
## How do I use it?
55
aw-watcher-obsidian is an ActivityWatch watcher watching the user activity in Obsidian vaults with the plugin active. The watcher currently tracks the name of the vault as well as the name of the currently active markdown file. The timeline and activity view in the evaluation screen of ActivityWatch will then be capable of telling the user how much time they spent on which file.
@@ -8,10 +8,5 @@ To install, either get it from Obsidians community plugins list \[as of writing
88
## Where is my data going?
99
The data being collected by this plugin is sent to the ActivityWatch server running on localhost, which means the data does not leave your local machine at first. ActivityWatch does allow sharing data over multiple devices, but this Plugin does not do that by itself.
1010

11-
## Development
12-
To contribute, anyone can make Pull Requests. Considering this is a hobby project, they may or may not be merged, and merges may take a while depending on my available schedule.
13-
To start contributing, reading the Obsidian plugin *getting started* entry on the obsidian forum (https://forum.obsidian.md/t/how-to-get-started-with-developing-a-custom-plugin/8157/3) may help.
14-
For documentation on watchers for ActivityWatch, the documentation entry at https://docs.activitywatch.net/en/latest/examples/writing-watchers.html might help. Just keep in mind Obsidian does not allow post requests using axios or fetch due to CORS policy. There is an official JS client for ActivityWatch at https://github.com/ActivityWatch/aw-client-js, but it does not work due to using axios instead of the unrestricted request of the Obsidian API. Any requests to ActivityWatch API being made need to be rewritten to use the Obsidian request API.
15-
1611
## Credits
1712
To build the watcher API used in this project I tightly followed the official API at https://github.com/ActivityWatch/aw-client-js.

0 commit comments

Comments
 (0)