Plugins
Other pages
- Creating plugins (in Python or Zig)
Table of contents
- Authz beyond the WASM sandbox
(off by default, very-specific authz scopes)
Plugins:
- ...for importing (Markdown, code…)
- ...for code (styling, lang/meta for inlines…)
- ...for external tooling
(clip via IIIF, render/run/viz code…) - ...for language exts (footnotes, math…)
- ...for metadata
(including full semantic annotation) - ...for other web stuff
(MDX, assets, templates…) - ...for social (RSS,
og:*previews…) - ...for Unicode
- ...for validation / static analysis
- ...for tables of contents / search indexes
- ...for polyfilling various things that I wish browsers already had available for JavaScript-less use
List of built-in plugins
...for importing
For example, this /plugins page uses these two patterns for each plugin on the page:
!:firstP!:firstEGC
Note: Major text editors (including VSCode), without any extensions, will consider the (…) part to be the src of an Image node, so they will helpfully provide link-autocompletion when writing and link-following when command-clicking.
Note: when used in zip2zip mode, these import-* plugins can load files from your input/source zip without having to leave the WASM sandbox or incur any more FS latency.
| Plugin | Description | |
|---|---|---|
| ✅ | import-markdown | Import contents via |
| ✽ | import-code | Import via |
| 🚧 | import-usda-from-usdz | Import a USDZ file's scene graph (or subtree(s) thereof) as a |
...for code
| Plugin | Description | |
|---|---|---|
| ✽ | syntax-highlighting | Add syntax highlighting to some CodeBlock and/or CodeInline elements, eventually including semantic highlighting via a language server, or via plugin config where you can have a case-sensitive set of names always be considered to be classes. |
| 🚧 | codeinline-info-string | e.g. |
...for external rendering
(these require authz beyond the WASM sandbox)
| Plugin | Description | |
|---|---|---|
| 🚧 | render-image-iiif | Using some external IIIF tool/server, render image clips using IIIF Image API syntax (for region, size, rotation, quality, and format), e.g. |
| ✽ | render-code | For each code element (CodeBlock/CodeInline) do you want the page to display the code, the result of running/rendering the code, or both? You can define defaults for each language, and you can override them in a specific code element's info string. |
| 🚧 | render-from-section | e.g. create an Image element with |
| 🚧 | render-preview-img | Add an |
...for language extensions
| Plugin | Description | |
|---|---|---|
| 🚧 | footnotes | Footnote syntax: |
| 🚧 | math | Use LaTeX via |
| ✽ | details-summary-from-section | Wrap a section with a |
See also:
...for metadata
| ✽ | title-and-description | e.g. you can compute |
| 🚧 | signatures | Validate and embed already-externally-computed signatures of your doc's Markdown and/or article-HTML in your HTML page (GPG, Nostr, etc). |
| ✽ | license-notices | Easily ensure that subsets of your pages are licensed a certain way, both with metadata and with a visible notice. For example, you could ensure that your |
| 🚧 | full-semantic-annotation | For maximum document quality, you can fully annotate your sentences. |
...for other web stuff
| Plugin | Description | |
|---|---|---|
| 🚧 | mdx-subset | A subset of functionality from the MDX project. |
| 🚧 | assets | Hash-suffixing, mounting at |
| ✽ | page-template | Add page headers / page footers / head elements, via config strings and/or |
| 🚧 | include-comments | By default, comments in your Markdown code are not included as HTML comments. This plugin lets you override that in some cases. |
| ✽ | css-overrides-within-doc | To add CSS overrides that are specific to the current page, you can create a |
| ✅ | sitemap-xml | Automatically render a |
...for social
| Plugin | Description | |
|---|---|---|
| ✽ | rss | Render RSS XML for your posts, for one or more blog levels. |
See also:
- render-preview-img for
og:image - title-and-description for
og:title/etc - signatures
- license-notices
...for Unicode
...where "some patterns" means "some custom subsets of code points and/or EGCs:
| Plugin | Description | |
|---|---|---|
| 🚧 | unicode-autolink | Automatically link some patterns to custom URLs, e.g. linking 𝐙 (MATHEMATICAL BOLD CAPITAL Z) to enwiki:Integer. |
| 🚧 | unicode-autoclass | Automatically add classes to the HTML for some patterns, e.g. so you can add custom styling. |
...for validation / static analysis
| 🚧 | validate-internal-links |
|
| 🚧 | validate-external-links |
|
| 🚧 | validate-placeholders | Configure this plugin as an additional guardrail in your workflow, re: placeholders. |
Asset hash validation (both for SRI attributes and for filename suffixes) will probably be part of the assets plugin.
...for tables of contents / search indexes
| Plugin | Description | |
|---|---|---|
| 🚧 | tables-of-contents | Automatically generate/update/validate tables of contents and other reader-visible indexes. |
| 🚧 | search-indexes | Generate simple index files for the searchable content of your docset, and they can be automatically published with hash-suffixed filenames along with the rest of your assets. |
...for polyfilling various things that I wish browsers already had available for JavaScript-less use
| Plugin | Description | |
|---|---|---|
| 🚧 | polyfill-page-outline | Provide some basic (and CSS-style-able) UI/UX for having a concise outline float on the side of your documents. |
| 🚧 | polyfill-range-input-functionality | Opinion: a range input ( |
| 🚧 | polyfill-search-ux | Provide a search bar with basic UI/UX. |
| 🚧 | polyfill-searching-clientside | Very-basic client-side docset-wide search, using a simple search index file from |
Ideally, you shouldn't need any JavaScript to publish your writings with a full UX.
The world wide web should let browsers be browsers and documents be documents.
I have not been involved with the exploration/creation side of web standards proposals before, but I want to learn more about it and look at these polyfills from that lens.
These probably won't end up as standards proposals. But it'll at least be an interesting lens to use, and I want to learn more about the web standards world in general.
I might merge-request some of these for one of the indie browsers like Ladybird.
Authz beyond the WASM sandbox
While building your docset with zip2zip, a few of the plugins by the very nature of their value prop need to make build-time HTTP requests and/or run command-line tools and pass your input files to them. ⚠️😱‼️
This cannot be granted via config JSON
Like all plugins, these are off by default.
But unlike the fully-sandboxed plugins, these plugins CANNOT be activated simply by e.g. naming them inside a config JSON file inside the input zip. Activating them needs to occur via other channels, and with property names that are so verbose and explicit that it is not easy to authorize the sandbox breach without having at least some level of understanding of the security implications.
How the access happens
These plugins still run within the WASM blob, but they ask the blob's outer wrapper to do things on their behalf, e.g. make HTTP requests or run subprocesses.
The outer blob will only do so if authorized via tightly-scoped authorization, e.g.:
- "Plugin
foomay make HTTP requests tolocalhost:8000and nowhere else" - "Plugin
barmay only spawn the subprocessssh, only with the exact args["user@vm", "-T", "pngquant 32 -"], only sendany *.png file from the input zipto its stdin, and then obtain only its stdout" - "Plugin
asdfmay run a blob of webshit inside a not-network-connected web browser instance and obtain the result"
When creating plugins in Python, these three correspond to:
c.assetFromExternalRequest(…) → AssetRef
c.assetFromExternalSubproc(…) → AssetRef
c.assetFromExternalRender(…) → AssetRef