diff --git a/.agents/plans/2026-05-14-authoring-skill-release.md b/.agents/plans/2026-05-14-authoring-skill-release.md index 1610b25..761055d 100644 --- a/.agents/plans/2026-05-14-authoring-skill-release.md +++ b/.agents/plans/2026-05-14-authoring-skill-release.md @@ -3,7 +3,8 @@ Scope: - [x] Sync `main` to merged PR #8. - [x] Rebase PR #7 branch onto theme-token work. -- [x] Update canonical `.agents/SKILL.md` for real theme-token injection. +- [x] Update canonical root `SKILL.md` for real theme-token injection. +- [x] Keep `.agents/SKILL.md` as the local-agent mirror. - [x] Bundle `SKILL.md` into `dist/html-docs/` during build. - [x] Include bundled `SKILL.md` in release upload/provenance. - [x] Clarify README optional agent-skill install/discovery. @@ -14,7 +15,8 @@ Scope: - [x] Add `skills.sh` install command to README. Decisions: -- Plugin repo is canonical source. +- Plugin repo root `SKILL.md` is the canonical source. +- `.agents/SKILL.md` mirrors the canonical source for local agent discovery. - `smcllns/skills` is the installable mirror. - Obsidian plugin install does not install agent skills. - Plugin runtime must not write to agent install roots or dotfiles. diff --git a/README.md b/README.md index e908755..b263ea1 100644 --- a/README.md +++ b/README.md @@ -15,36 +15,24 @@ A demo page (`test/fixture.html`) demonstrates all the passing HTML features. ![](demo.png) -## Installation +## Install Obsidian Plugin -### Install from Obsidian directly +* Install from Obsidian Community: [HTML Docs](https://community.obsidian.md/plugins/html-docs) +* Build and install from source: -* Go to Obsidian Community Plugins: [community.obsidian.md/plugins/html-docs](https://community.obsidian.md/plugins/html-docs) -* Click Install - -### Install manually - -1. Download `main.js`, `manifest.json`, and `styles.css` from the [latest release](https://github.com/smcllns/obsidian-plugin-html-docs/releases/latest) -2. Place those files into `/.obsidian/plugins/html-docs/`. -3. Enable **HTML Docs** in Obsidian's Community Plugins settings. - -Releases are built and signed by GitHub Actions ([.github/workflows/release.yml](.github/workflows/release.yml)) so the binaries carry a [build attestation](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds) you can verify against the source. +```bash +git clone https://github.com/smcllns/obsidian-plugin-html-docs/ +bun install +bun run dev # watch + rebuild +bun run build # production bundle at `dist/html-docs/` +``` -### Optional Agent Skill +### Download Agent Skill (optional) There is an optional agent skill so your agent can author HTML that fits this plugin's sandbox, theme tokens, assets, and embeds. -- Skills CLI: `npx skills add smcllns/skills --skill obsidian-html-docs` -- Manual: [smcllns/skills/skills/obsidian-html-docs/SKILL.md](https://github.com/smcllns/skills/blob/main/skills/obsidian-html-docs/SKILL.md) - -### Build and install from source - -```bash -git clone https://github.com/smcllns/obsidian-plugin-html-docs/ -npm install -npm run dev # watch + rebuild -npm run build # production bundle at `dist/html-docs/` -``` +* Skills CLI: `npx skills add smcllns/skills --skill obsidian-html-docs` +* Manual: [SKILL.md](https://github.com/smcllns/obsidian-plugin-html-docs/blob/main/SKILL.md) (~850 tokens) ## Test @@ -52,11 +40,11 @@ An E2E test runner validates features, embeds, Canvas cards, and sandboxing are ```bash -npm test -npm run release:check +bun run test +bun run release:check ``` -`npm run release:check` runs the production build, the official Obsidian plugin lint rules, and the E2E test. The E2E script builds the current plugin, copies it into the active vault's plugin folder, reloads it, copies `test/fixture.html` into the vault temporarily, opens it in Obsidian, verifies the tab view plus markdown and Canvas embeds, collects the iframe’s own self-test results via `postMessage`, then cleans up. +`bun run release:check` runs the production build, the official Obsidian plugin lint rules, and the E2E test. The E2E script builds the current plugin, copies it into the active vault's plugin folder, reloads it, copies `test/fixture.html` into the vault temporarily, opens it in Obsidian, verifies the tab view plus markdown and Canvas embeds, collects the iframe’s own self-test results via `postMessage`, then cleans up. See `test/fixture.html` for the full list of features exercised — and the inline notes for what is intentionally blocked. @@ -79,18 +67,6 @@ Embed HTML docs like other Obsidian embeds. Embeds default to about 600px tall; ![[doc.html|600x400]] ``` -Each iframe receives a one-way snapshot of Obsidian theme styles. HTML docs can use these CSS variables to match light/dark mode, theme colors, and fonts without giving the iframe permission to read Obsidian or the vault. Use fallbacks so files still work outside Obsidian: - -```css -:root { - color-scheme: var(--obsidian-color-scheme, light dark); - --bg: var(--obsidian-bg, light-dark(#fff, #0e1014)); - --text: var(--obsidian-text, light-dark(#16161a, #e7e9ec)); -} -``` - -Available CSS variables: `--obsidian-color-scheme`, `--obsidian-bg`, `--obsidian-bg-2`, `--obsidian-text`, `--obsidian-text-muted`, `--obsidian-accent`, `--obsidian-border`, `--obsidian-font`, `--obsidian-font-mono`. - ## Obsidian Plugin Docs * Developer docs: [docs.obsidian.md](https://docs.obsidian.md) diff --git a/SKILL.md b/SKILL.md new file mode 100644 index 0000000..eb766a9 --- /dev/null +++ b/SKILL.md @@ -0,0 +1,102 @@ +--- +name: obsidian-html-docs +description: Author HTML files for the Obsidian HTML Docs plugin (smcllns/obsidian-plugin-html-docs). Use when creating .html docs intended to render inline in Obsidian: theme tokens, sandbox constraints, asset rules, embed sizing, and things that silently do not work. +--- + +# Obsidian HTML Docs authoring guide + +The HTML Docs plugin lets users view `.html` files inside Obsidian tabs, markdown embeds, and Canvas cards. It renders each file in a sandboxed iframe via Blob URL. The iframe is sealed (`sandbox="allow-scripts allow-popups allow-forms"`, no `allow-same-origin`) so it cannot reach into Obsidian or the vault. Everything below works within that envelope. + +## Default to Obsidian context unless asked otherwise + +Before creating the Blob URL, the plugin appends a `