Skip to content

Commit b5dae6a

Browse files
authored
Merge pull request #6 from smcllns/codex/docs-html-tradeoffs
docs: Document HTML usage tradeoffs
2 parents a10121e + 44c109b commit b5dae6a

1 file changed

Lines changed: 31 additions & 3 deletions

File tree

README.md

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ A demo page (`test/fixture.html`) demonstrates all the passing HTML features.
1717

1818
## Installation
1919

20-
> Note: Obsidian only shows `.md` files in your file explorer, by default. To see your `.html` files too, be sure to enable: **Settings → Files & links → Show all file types**
21-
2220
### Install from Obsidian directly
2321

2422
* Go to Obsidian Community Plugins: [community.obsidian.md/plugins/html-docs](https://community.obsidian.md/plugins/html-docs)
@@ -55,10 +53,40 @@ npm run release:check
5553

5654
See `test/fixture.html` for the full list of features exercised — and the inline notes for what is intentionally blocked.
5755

58-
## Obsidian Official Resources
56+
## Usage
57+
58+
After installing the plugin, you can open `.html` files in Obsidian tabs (like a doc), embedded files, and canvas cards.
59+
60+
Obsidian shows `.md` files in the file explorer by default. To see `.html` files too, enable **Settings → Files & links → Show all file types**.
61+
62+
Link to HTML docs with the explicit `.html` extension:
63+
64+
```markdown
65+
See: [[my-doc.html]]
66+
```
67+
68+
Embed HTML docs like other Obsidian embeds. Embeds default to about 600px tall; adjust size with [Obsidian's embed syntax](https://obsidian.md/help/embeds):
69+
70+
```markdown
71+
![[doc.html]]
72+
![[doc.html|600x400]]
73+
```
74+
75+
## Obsidian Plugin Docs
5976

6077
* Developer docs: [docs.obsidian.md](https://docs.obsidian.md)
6178

79+
## Known trade-offs
80+
81+
This HTML Docs plugin prioritizes a simple security boundary: HTML runs in a sandboxed iframe with JavaScript allowed, but without same-origin access to Obsidian or the vault.
82+
83+
That keeps HTML documents isolated from your notes and Obsidian internals, with the following trade-offs accepted:
84+
85+
* **Wikilinks to HTML docs need the explicit extension (`[[doc.html]]`).** Extensionless non-Markdown links are not first-class in Obsidian's link index, and click-only plugin handling would leave backlinks and unresolved-link state inconsistent.
86+
* **Links from HTML to Obsidian docs should use Obsidian URI links plus `target="_blank"`.** They hand off to Obsidian without letting the iframe navigate the parent window directly; direct same-tab navigation would require top-navigation sandbox permissions and weaken the boundary.
87+
* **Cookies, `localStorage`, `sessionStorage`, and `IndexedDB` are intentionally unavailable.** Enabling them would require same-origin privileges, which would also let HTML share origin with Obsidian instead of staying isolated.
88+
* **Context must be passed into the iframe, the iframe cannot reach out and pull in.** HTML can load browser-allowed network resources, but it cannot inspect Obsidian, other notes, or local vault files. So for example, the HTML page cannot access Obsidian themes, snippets, vault-relative asset paths, unless they are explicitly passed into the iframe context. Use inline CSS/assets, `data:` URLs, or browser-allowed HTTPS URLs instead.
89+
6290
## Feedback / Support
6391

6492
This plugin will stay simple and do this one thing well.

0 commit comments

Comments
 (0)