diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f6a8c0..d60f304 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - run: npm test working-directory: vs-code-extension - test-html-conversion: + test-publish: needs: test-common runs-on: ubuntu-latest steps: @@ -47,42 +47,27 @@ jobs: with: node-version: '20' cache: 'npm' - cache-dependency-path: html-conversion/package-lock.json + cache-dependency-path: publish/package-lock.json - run: npm ci working-directory: common - run: npm ci - working-directory: html-conversion + working-directory: publish - run: npm test - working-directory: html-conversion + working-directory: publish build-docs: - needs: test-html-conversion + needs: test-publish runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - cache: 'npm' - cache-dependency-path: html-conversion/package-lock.json - - run: npm ci - working-directory: common - - run: npm ci - working-directory: html-conversion - - run: npm run build - working-directory: html-conversion - - run: > - npm run convert -- - --input ../docs-src/pages - --output ../docs - --stylesheet https://cdn.jsdelivr.net/npm/github-markdown-css/github-markdown-light.css - --stylesheet docs.css - --asset ../docs-src/docs.css - working-directory: html-conversion + - run: npx @appsoftwareltd/asnotes-publish --config docs-src/asnotes-publish.notes.json - uses: actions/upload-pages-artifact@v3 if: github.ref == 'refs/heads/main' && github.event_name == 'push' with: - path: docs + path: docs-src/notes-publish deploy-pages: needs: build-docs diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..e6bfec8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "as-notes.rootDirectory": "docs-src", + "markdown.copyFiles.destination": { + "**/*.md": "/docs-src/assets/images/${fileName}" + } +} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index beac417..115084b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to AS Notes will be documented here. ## Pending Release +## [2.2.8] - 2026-03-24 + +- Feature: Publishing to static HTML sites from AS Notes, including npm package for CI/CD. + ## [2.2.7] - 2026-03-23 - Feature: Move to offline licence activation for licence keys. diff --git a/README.md b/README.md index 8a0c6b4..dfe5809 100644 --- a/README.md +++ b/README.md @@ -755,9 +755,9 @@ The repository is structured as a monorepo with three packages: |---|---| | `common/` | Shared wikilink parsing library (`Wikilink`, `WikilinkService`, `MarkdownItWikilinkPlugin`) | | `vs-code-extension/` | The VS Code extension | -| `html-conversion/` | CLI utility that converts an AS Notes notebook (markdown + wikilinks) to static HTML | +| `publish/` | CLI utility that converts an AS Notes notebook (markdown + wikilinks) to static HTML | -Documentation source lives in `docs-src/` (an AS Notes workspace). The `html-conversion` tool converts it to `docs/`. +Documentation source lives in `docs-src/` (an AS Notes workspace). The `publish` tool converts it to `docs/`. ### VS Code Extension @@ -772,40 +772,92 @@ npm run lint # Type-check ### HTML Conversion +The converter is published as an npm package: + +```bash +npx asnotes-publish --config ./asnotes-publish.json +``` + +For development from source: + ```bash -cd html-conversion +cd publish npm install npm run build -npm run convert -- --input ../docs-src/pages --output ../docs +npm run convert -- --input ../docs-src/pages --output ../docs --default-public ``` The conversion: -- Scans the input directory for `.md` files +- Scans the input directory recursively for `.md` files - Resolves `[[wikilinks]]` to relative `.html` links -- Generates a `