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
{{ message }}
Repository navigation
Commit e9d6c92
Browse filesBrowse the repository at this point in the historyBrowse files
feat: pluggable wiki export/share system (zip + PDF)
Add a pluggable export system that lets users share wiki pages as
self-contained archives. The system follows wikilinks (BFS traversal)
from a starting page to collect pages with no broken links.
Backend:
- Sharer interface and registry (internal/share/share.go)
- Zip exporter with include_assets and flatten settings
- PDF exporter via chromedp + goldmark (registers only if browser found)
- BFS wikilink traversal in wiki.ExportPages (depth: -1/0/N)
- HTTP endpoints: GET /api/export, GET /api/export/formats
- MCP tool: export_pages
WebUI:
- Export button in page header (ShareIcon)
- ExportPanel with depth picker and format selection
- ShareSettings in Settings panel (generic per-plugin schema renderer)
DevContainer:
- Symlink Playwright Chromium to /usr/local/bin for PDF support
- Fix git safe.directory for VCS stamping in builds
Docs:
- README updated with Export & Share section and screenshots
- Playwright screenshot script (tools/screenshots.mjs)
- 8 feature screenshots in docs/screenshots/
Copy file name to clipboardExpand all lines: README.md
+96-1Lines changed: 96 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ The web UI is a static Preact app served by `mind-map serve` over HTTP. It uses
84
84
85
85
Both modes use the same wiki engine and the same wiki directory (`~/.mind-map/wiki` by default). Multiple stdio processes can safely share the same wiki via SQLite page locking.
86
86
87
-
## MCP Tools (11 total)
87
+
## MCP Tools (12 total)
88
88
89
89
| Tool | Description |
90
90
|------|-------------|
@@ -100,6 +100,7 @@ Both modes use the same wiki engine and the same wiki directory (`~/.mind-map/wi
100
100
|`get_backlinks`| Get all pages that link to a given page |
101
101
|`register_sync`| Register a wiki path prefix to sync with a git remote |
102
102
|`reindex_wiki`| Force a reindex pass against on-disk markdown (rarely needed; useful after edits made outside the wiki API) |
103
+
|`export_pages`| Export a page (and linked pages up to N hops) as zip or PDF |
103
104
104
105
## Wiki Features
105
106
@@ -110,6 +111,50 @@ Both modes use the same wiki engine and the same wiki directory (`~/.mind-map/wi
110
111
-**Full-text search**: SQLite FTS5 with ranked results and snippets
111
112
-**Multi-process safe**: SQLite page locking for concurrent agent access
112
113
-**Git sync**: sync wiki pages to GitHub repo wikis via configurable mappings
114
+
-**Export / Share**: export pages as zip or PDF — see below
115
+
116
+
## Export & Share
117
+
118
+
Export one or more wiki pages for sharing outside the wiki. The system follows **wikilinks** from a starting page (BFS traversal) to collect a self-contained set of pages with no broken links.
119
+
120
+
### Depth control
121
+
122
+
| Depth | Meaning |
123
+
|-------|---------|
124
+
|`0`| Just the selected page |
125
+
|`1`| The page + all pages it links to |
126
+
|`N`| N hops of outgoing links |
127
+
|`-1`| Unlimited — follow all reachable links |
128
+
129
+
### Formats
130
+
131
+
Export is **pluggable** — formats register themselves at startup:
132
+
133
+
| Format | Description | Requirements |
134
+
|--------|-------------|--------------|
135
+
|**zip**| Archive of markdown files + assets | None |
136
+
|**pdf**| Multi-page PDF with table of contents | Chrome, Edge, or Chromium on `$PATH`|
137
+
138
+
PDF export uses [chromedp](https://github.com/chromedp/chromedp) to render markdown → HTML → PDF via a headless browser. It includes a clickable TOC, embedded images, and a print-friendly stylesheet. The PDF sharer only registers if a supported browser is detected — no browser, no PDF option.
139
+
140
+
### Using export
141
+
142
+
**Web UI**: Click the share icon in the page header → pick depth and format → download.
143
+
144
+
**REST API**:
145
+
```
146
+
GET /api/export?format=zip&page=projects/my-project&depth=1
147
+
GET /api/export/formats # list available formats with settings schemas
Implement the `Sharer` interface in `internal/share/` and call `Register()` in an `init()` function. The format automatically appears in the UI, REST API, and MCP tool.
113
158
114
159
## Web UI
115
160
@@ -119,10 +164,60 @@ The built-in web UI is a lightning-fast, Metro-inspired, chromeless Preact app:
119
164
- Markdown rendering with wikilinks as clickable links
120
165
- Backlinks section on every page
121
166
- Edit mode with raw markdown editor
167
+
- Export / share panel for zip and PDF export
168
+
- Interactive graph view of the wiki link structure
122
169
- Dark / light theme toggle
123
170
124
171
The web UI speaks the same language as the wiki engine. If an agent creates a page via stdio, it appears in the browser. If you edit in the browser, the agent sees the change on its next read.
0 commit comments