tools: Export - include "all" wählt die ganze KB, index: true schreibt index.md und INDEX.md in den Zielordner (#217); 10.1.0-beta.21
CI / verify (push) Successful in 8m17s
CI / pwsh (push) Successful in 2m54s
Release / converters (push) Successful in 28s
Release / release (push) Successful in 36s
Release / wiki-mirror (push) Skipped

Files changed:
- CHANGES.md
- VERSION
- docs/how-to/export-to-a-synced-folder.md
- docs/reference/commands/exports.md
- docs/reference/configuration.md
- raw/CONTRACT.md
- tools/CONTRACT.md
- tools/README.md
- tools/chemenu/catalog.py
- tools/chemenu/commands/export_cmd.py
- tools/chemenu/commands/index_build.py
- tools/chemenu/config_shapes.py
- tools/chemenu/export_index.py
- tools/chemenu/guideline_export.py
- tools/chemenu/page_export.py
- tools/chemenu/tests/test_config_shapes.py
- tools/chemenu/tests/test_export_run.py
- tools/chemenu/tests/test_index_build.py

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SnAJ7Z3CpVD3PRbN73QtU2
This commit is contained in:
torbenandClaude Sonnet 5.5 committed 2026-10-16 15:44:21 +02:00
1 parent cc990dc89e
commit db09e89223
18 files changed
+693 -101

No files matched your search

+24 -7
View File
@@ -20,10 +20,17 @@ look like: [configuration reference](../reference/configuration.md#export-to-a-f
## Pick the pages and the format
- **Which pages.** Only what a target's `include` selects is written; there is no "everything". A
selection is a list of `search` predicates that must all hold - `tags=shared`, `kind=system`,
`!draft` - and a page that fits any selection of the target is exported. Try a selection with
`tools/wikitool search --field tags=shared` first.
- **Which pages.** Only what a target's `include` selects is written. `"include": "all"` selects
every page, also one that lies directly under `kb/`, and no generated file. Otherwise a selection
is a list of `search` predicates that must all hold - `tags=shared`, `kind=system`, `!draft` - and
a page that fits any selection of the target is exported: `"include": [["tags=shared"]]`. Try a
selection with `tools/wikitool search --field tags=shared` first. A missing or empty `include` is
an error, not "all". With `"all"`, every page you add later goes into the export too - on a target
with `after_publish` at the next `publish`.
- **An entry point.** The folder holds the pages only. `"index": true` adds `index.md` in the root
of the folder and an `INDEX.md` per collection, so someone who opens the folder finds the
collections, their areas and the pages with their summaries by following links. The files list what
the target exports and nothing else, and the link text is the page's title.
- **Which format.** Two ways, equally valid:
- `markdown` writes the pages as `.md` files. It needs nothing but the folder.
- `command` hands those files to a converter of your own and exports what it produces - Word
@@ -69,6 +76,10 @@ look like: [configuration reference](../reference/configuration.md#export-to-a-f
(the default) the title, type, summary and modified date, `full` the page's whole frontmatter.
`links: relative` (the default) turns a link to an exported page into a relative Markdown link;
`links: text` leaves the page's name. A link to a page that is not exported is always plain text.
The index files link relatively whatever `links` says.
To put the whole of `kb/` into the folder with an entry point, write `"include": "all"` and
`"index": true` instead of the `include` selection above.
3. **Tell the agent:**
> Export the pages.
@@ -84,8 +95,8 @@ every file names the commit its page comes from. Publish first.
## What a run does to the folder
The folder holds the pages and one file of the stack's own, `.wikitool-export.json`, which lists
what the last run wrote.
The folder holds the pages, the index files if the target asks for them, and one file of the stack's
own, `.wikitool-export.json`, which lists what the last run wrote.
- **Only its own files.** A run removes a file only when it is listed and no longer exported, and a
folder only when the run created it. Anything else in the folder stays as it is.
@@ -102,6 +113,11 @@ what the last run wrote.
A file of a page the commit did not touch changes only when its text does: a link to a page that
has just entered the selection becomes a relative link, one to a page that left it plain text.
The first run after updating to a version that brought this rewrites every file once.
- **An index follows the pages.** A collection's `INDEX.md` changes when one of its pages does, and
`index.md`, which lists them all, with every commit to an exported page. Setting `index` back to
`false` removes the index files at the next run and leaves every other file as it is. A page
`index.md` in a collection, next to the generated `INDEX.md`, stops the target: a synced folder on
Windows would make them one file.
- **A growing selection needs no confirmation.** New pages are reported as new; read the list
before the sync client uploads them.
@@ -150,7 +166,8 @@ program's stderr. The staging directory is always removed.
## What does not come back in
An export is never a source. Every Markdown file starts with a frontmatter block whose first key is
`wikitool_export`, and `tools/wikitool raw accept` and `raw capture` refuse a file that carries it.
`wikitool_export` - the index files too - and `tools/wikitool raw accept` and `raw capture` refuse a
file that carries it.
A converter may lose that key, so `raw accept` also refuses any file in `incoming/` that is byte
for byte one of the files in the manifest of a configured target - and warns, without refusing,
when a target has no manifest yet or the `export` section is broken.