π optica
knowledge graph publisher β transforms a directory of files into a fast, navigable static site. markdown pages with wiki-links are the primary content. all other files (source code, configs, data, binaries) become graph nodes with syntax-highlighted previews
optica serve . # dev server with live reload
optica build . # generate static site
optica check . # validate links, find orphans
live example: cyber.page β 12K pages, 10 subgraphs, built with optica
what it does
point optica at any directory. markdown files with wiki-links become navigable pages. all other files β .rs, .toml, .nu, .json, images, binaries β become graph nodes with syntax highlighting, metadata, and backlinks. the entire repo is the knowledge graph.
your-project/
βββ root/ # pages (or any directory name)
β βββ cyber/ # namespaces = directories
β β βββ truth.md
β β βββ truth/ # sub-namespaces
β β βββ serum.md
β β βββ coupling.md
β βββ focus.md # root-level pages
β βββ particle.md
βββ blog/ # journal entries (optional)
βββ publish.toml # configuration
βββ build/ # output (generated)
features
- wiki-link resolution with aliases β
page,display text,page - tri-kernel ranking β PageRank + screened Laplacian + heat kernel compute per-page probability
- namespace hierarchy β directories become navigable namespaces with breadcrumbs
- dimensional navigation β pages with the same name across namespaces are shown as "dimensions"
- sub-second live reload β content-only edits skip the full scan and rebuild in <10ms
- subgraph support β import sibling repos as subgraphs via a TOML config (
optica build --subgraphs subgraphs.toml) - YAML frontmatter β tags, aliases, icons, custom properties
- LaTeX math β inline
$...$and block `
$$...$$
`
- query expressions β
<div class="query-results"><div class="query-results-header">Query: <code>(and (page-tags tag))</code></div><p><em>No results</em></p></div>for dynamic content - embed transclusion β `
quick start
# build optica
# serve any markdown directory
the scanner looks for pages in root/ (fallback: graph/, pages/). configuration via publish.toml in the project root.
page format
architecture
scanner β parser β graph builder β tri-kernel β renderer β output
| Stage | What it does |
|---|---|
| scanner | walks filesystem, classifies files, discovers subgraphs |
| parser | extracts YAML frontmatter, normalizes outliner format, collects wiki-links |
| graph | resolves links, builds alias map, computes PageRank + tri-kernel |
| renderer | markdown β HTML with template support, wiki-link resolution, math |
| output | writes HTML, search index, graph data, sitemap, RSS |
the dev server watches for changes. content-only edits (no new links, no tag changes) take the fast path: skip the scan, re-parse only the changed file, re-render only the dirty page. structural changes trigger a full incremental rebuild.
configuration
publish.toml in the project root:
[site]
title = "My Knowledge Base"
base_url = "http://localhost:8080"
[content]
public_only = false
default_public = true
exclude_patterns = [".git/*", "target/*", "build/*"]
[graph]
show_minimap = true
minimap_depth = 2
[search]
enabled = true
performance
on a 12K page graph (cyber knowledge base):
| Operation | Time |
|---|---|
| full build | ~28s |
| incremental rebuild (structural) | ~12s |
| fast path (content-only edit) | <10ms |
| live reload latency | ~110ms (100ms debounce + render) |
license
cyber license: don't trust. don't fear. don't beg.