1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# tools/site — open-iov.org publishing toolchain
Converts the tracked `wiki/*.md` sources to MediaWiki wikitext and publishes
them to https://open-iov.org. No secrets live in this directory.
## Files
| Tool | Purpose |
|---|---|
| `md2wiki.py` | Markdown → MediaWiki converter. Maps `../docs/...` links to the public repository (tracked files only — untracked/private paths abort), maps intra-wiki `*.md` links to page titles via `titles.json`, renders diagram image references, strips non-public-provenance sentences, and refuses output containing forbidden markers. |
| `publish.py` | WikiBot client: `login`, `check --all`, `diff`, `publish`, `publish-all`, `delete`, `move`. Scans before writing; records every revision in `wiki/.publish-manifest.json`. |
| `check_site.py` | Live audit: forbidden markers, raw links, unresolved internal links across every page. |
| `upload_file.py` | Upload an image (e.g. a rendered diagram) as WikiBot. |
| `titles.json` | Page title map (wiki source → wiki page), canonical-doc → site-page map, diagram image map. |
| `pages/` | Site-only pages (Main Page, About, Community, sidebar, templates) as tracked wikitext. |
## Credentials
`~/.config/open-iov/wiki-bot.env` (mode 0600, outside the repository):
```
WIKI_BOT_USER=...
WIKI_BOT_PASS=...
```
## Typical flow
```bash
# edit wiki/<Page>.md, then:
python3 tools/site/md2wiki.py --all --out /tmp/open-iov-site
python3 tools/site/publish.py diff --title "FAQ" --file /tmp/open-iov-site/FAQ.wiki
python3 tools/site/publish.py publish --title "FAQ" --file /tmp/open-iov-site/FAQ.wiki \
--summary "Update from tracked wiki source"
python3 tools/site/check_site.py
```
Site-only pages:
```bash
python3 tools/site/publish.py publish --title "Main Page" --file tools/site/pages/Main-Page.wiki --summary "..."
```
Diagram images: render with `mermaid-cli` (`mmdc`, see `titles.json`
`mermaid_images` for the mapping), upload with `upload_file.py`.
## Rules
* Only tracked repository paths are ever linked; the converter fails loudly on
anything else.
* Non-public provenance (notes files, study sources) must never appear in
site output; both `md2wiki.py` and `publish.py` enforce a forbidden-marker
list.
* Every edit goes through the bot with a descriptive summary and is recorded
with its old/new revision ids for rollback.
|