diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 0000000..7e3a76b --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,21 @@ +name: Tests and build + +on: + pull_request: + push: + branches: [main] + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: '22.x' + cache: npm + - run: npm ci + - run: npm test + - run: npm run build + - run: npm run test:startup + - run: npm run test:browser:build diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e07fab..d0d3568 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,17 +13,19 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Use Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v4 with: - node-version: "14.x" + node-version: "22.x" - name: Build id: build run: | - npm install + npm ci + npm test npm run build + npm run test:startup mkdir ${{ env.PLUGIN_NAME }} cp main.js manifest.json styles.css ${{ env.PLUGIN_NAME }} zip -r ${{ env.PLUGIN_NAME }}.zip ${{ env.PLUGIN_NAME }} diff --git a/.gitignore b/.gitignore index 9ee833b..6fe67cc 100644 --- a/.gitignore +++ b/.gitignore @@ -114,3 +114,4 @@ main.js # obsidian data.json +test/.out/ diff --git a/docs/index.md b/docs/index.md index 6bc2933..021bb77 100644 --- a/docs/index.md +++ b/docs/index.md @@ -107,3 +107,140 @@ should be raised again and the plugin should be authorized. **Note**, the plugin fetched wordpress.com token might be expired in two weeks by default. If publishes failed some day, 'Refresh' button should be clicked in order to get a new token. + +## Obsidian syntax support + +The following Obsidian syntax is converted while publishing: + +* **Wikilinks** `[[note]]`, `[[note|alias]]` and `[[note#heading]]`: if the target note + has been published with the same profile, the link becomes a permalink of the + published post. Otherwise it is rendered as plain text and a notice is shown. +* **Note embeds** `![[note]]` and `![[note#heading]]`: the embedded note content is + expanded into the published post (up to 5 levels deep, cyclic embeds are skipped). +* **Callouts** `> [!note] Title`: rendered as `