You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: Render HTML files in embeds and Canvas
* fix: Constrain HTML embed height
* docs: Update README overview
---------
Co-authored-by: Sam Collins <81678+smcllns@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@
3
3
A zero-dependency minimal plugin to enable .html docs inside Obsidian. Inspired by [Thariq's "unreasonable effectiveness of HTML"](https://x.com/trq212/status/2052809885763747935).
4
4
5
5
6
-
*The HTML is rendered in a sandboxed `<iframe>`.
6
+
* HTML is rendered in a sandboxed `<iframe>`, and works across tabs, embeds (`![[doc.html]]`), and Canvas.
7
7
* JS can run inside the HTML for interactivity but the iframe is isolated from your other notes and Obsidian's own data.
8
8
* No other bells and whistles.
9
9
10
-
The plugin is ~75 lines of code, ~100 lines of config, ~520 lines of test, and requires no external dependencies.
10
+
The plugin is ~190 lines of code, ~660 lines of test, and requires no external dependencies.
11
11
12
12
## Demo
13
13
@@ -43,14 +43,14 @@ npm run build # production bundle at `dist/html-docs/`
43
43
44
44
## Test
45
45
46
-
An E2E test runner validates features and sandboxing are working correctly. Requires `obsidian-cli`, Obsidian running with a vault open, the plugin installed and enabled, and `jq` available.
46
+
An E2E test runner validates features, embeds, Canvas cards, and sandboxing are working correctly. Requires `obsidian-cli`, Obsidian running with a vault open, the plugin installed and enabled, and `jq` available.
47
47
48
48
49
49
```bash
50
50
npm test
51
51
```
52
52
53
-
The script copies `test/fixture.html` into the vault temporarily, opens it in Obsidian, uses `obsidian-cli eval` to inspect the plugin view and verify the iframe exists with the expected sandbox and blob URL settings, collects the iframe’s own self-test results via `postMessage`, then cleans up.
53
+
The 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.
54
54
55
55
See `test/fixture.html` for the full list of features exercised — and the inline notes for what is intentionally blocked.
56
56
@@ -62,10 +62,6 @@ See `test/fixture.html` for the full list of features exercised — and the inli
62
62
63
63
This plugin will stay simple and do this one thing well.
64
64
65
-
File issues here, or message me on X (@smcllns).
65
+
File issues here, or message me on X: [@smcllns](https://x.com/smcllns).
66
66
67
67
If you want more features, please fork and customize as you need.
68
-
69
-
## Known Issues
70
-
71
-
1.**Does not support Obsidian Canvas or embeds.** HTML files in Canvas, and embeds in a doc (e.g. `![[doc.html]]`) continue to show the same placeholder as before.
0 commit comments