agentleFS
smcllnssmcllns/skills/obsidian-html-docs/SKILL.md

obsidian-html-docs

Skill0 starsChanged 5 months agoMITView on GitHub

Use when creating .html docs intended to render inline in Obsidian with the HTML Docs plugin (github.com/smcllns/obsidian-plugin-html-docs).

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default embed height ≈ 600px.

    line 19
  2. Very specific:

    Before loading the Blob, the plugin injects a <style> snapshot of Obsidian's current theme.

    line 56
  3. Very specific:

    Default to these for vault-native docs, with light-dark() fallbacks so the file still works when opened outside Obsidian:

    line 58

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Obsidian HTML Docs authoring guide

The HTML Docs plugin for Obsidian renders each .html file in a sandboxed iframe via Blob URL. No allow-same-origin, no vault path resolution, no storage. Author within that envelope.

Linking and embedding

Wikilinks need the explicit .html extension; embeds take an optional |WxH (standard Obsidian embed-sizing syntax — also supports |width for proportional scaling, see Obsidian docs):

[[my-doc.html]]            <- link
![[doc.html|600x400]]      <- embed

Default embed height ≈ 600px; tab views fill the pane.

What works in the HTML page

Works:

  • HTML / CSS (grid, light-dark(), animations, SVG)
  • JavaScript (ES2020+, fetch with CORS, requestAnimationFrame, Canvas 2D)
  • Forms
  • window.parent.postMessage(msg, '*')
  • Anchor links and the History API
  • HTTPS resources (images, fonts, stylesheets)
  • data: URLs and inline SVG

Blocked:

  • localStorage / sessionStorage / IndexedDB / document.cookie — use URL hash or postMessage for state
  • Reading window.parent.* — cross-origin (postMessage still works)
  • Top-level navigation — links inside the page can't redirect Obsidian itself; use target="_blank" to open externally
  • Clipboard API — programmatic navigator.clipboard.* is blocked, but users can still select text and copy with ⌘C
  • Service workers, geolocation, notifications
  • Vault-relative URLs (see Assets)

Assets

SourceWorks?
attachments/foo.png or any vault-relative pathNo — fails silently
Inline <svg>Yes
data: URLYes
HTTPS URL (image, font, stylesheet)Yes — CORS permitting
Obsidian theme / CSSYes — via injected theme tokens (see below)

Inline SVG or data: URL for small graphics. Host photos externally (R2/CDN). Never reference the vault.

Theme tokens

Before loading the Blob, the plugin injects a <style> snapshot of Obsidian's current theme. Open docs re-render on theme change.

Default to these for vault-native docs, with light-dark() fallbacks so the file still works when opened outside Obsidian:

:root {
  color-scheme: light dark;
  --bg:   var(--obsidian-bg,   light-dark(#ffffff, #0e1014));
  --text: var(--obsidian-text, light-dark(#16161a, #e7e9ec));
}

For a specific aesthetic (brand palette, brutalist, retro), design freely — Obsidian context is a hint, not a constraint. Full token list in the appendix.

Appendix: injected theme tokens

TokenPurpose
--obsidian-color-schemelight or dark (also sets color-scheme: on :root)
--obsidian-bg, --obsidian-bg-2Background surfaces
--obsidian-text, --obsidian-text-mutedText colors
--obsidian-accentAccent
--obsidian-borderBorders
--obsidian-font, --obsidian-font-monoFont stacks

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.