Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Media — images and attachments
- Markdown syntax only:
. Do NOT emit HTML<img>tags — they don't participate in OK's content graph and don't render consistently across Fumadocs / preview surfaces. Paths resolve relative to the doc. - Always a doc-relative path — never a server URL. Reference an asset by its path relative to the doc (
./image.png,../assets/foo.png), never an absolutehttp://localhost:<port>/…,127.0.0.1, or other server URL.preview_url'surlnavigates the preview — it is NOT an asset path; never paste it (or anylocalhostbase) into an![](). An asset already in the tree is the same rule: find its path withexec("ls -A <dir>")and write the relative link. (Upload viawrite({ asset })hands you the exact relativeto copy.) - Save locally, don't hot-link. Hot-linked external image URLs rot when the source disappears. Fetch it through the ingest procedure in
references/ingest-and-sources.md(SSRF-safe fetch flags, size + executable-extension gates, wrapper frontmatter) — never an ad-hocWebFetch/curlinto the tree — then reference the local file via a relative markdown link and cite the ingested wrapper below. - Placement model. Free-form image embeds → co-located alongside the referencing doc (sha256 same-directory dedup): give
write({ asset })apathin that doc's folder, because a bare file name goes to the attachment folder (content.attachmentFolderPath, by default the content root; it has no parent document, so a setting that uses{{filename}}puts it in the content root). Raw sources viaingest→external-sources/<slug>.<ext>+external-sources/<slug>.md(the wrapper-binary pair). Check viaexec("ls -A")if the project uses a different convention. - Cannot fetch (no network, paywall) → don't invent a local path. Omit, or mark inline
(TODO: image needs sourcing from <URL>). - Meaningful alt text required — describes WHAT the image shows, not what it is.
![]()/![image]()/![filename.png]()all fail. OK indexes alt text — it's both accessibility AND searchability. - Cite web image sources below the image (Grounding rule):
(Both paths are relative to the citing doc; ingest lands the binary + wrapper pair side by side, so cite the wrapper next to the binary you embedded.) Original diagrams/screenshots may caption *Source: [Avatar Wiki — Aang](./external-sources/avatar-wiki-aang.md)**Original*or omit. Cite the local ingested wrapper (whose frontmatter carries the original URL), not the external URL — an inline external link is a TODO meaning "still needs ingesting". Unattributed web images are equivalent to unsourced factual claims.