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
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:
1 parent
cc990dc89e
commit
db09e89223
18 files changed
+693
-101
No files matched your search
@@ -644,7 +644,7 @@ them into a staging directory and hands that to a converter of this checkout.
|
||||
<!-- wikitool:reference-config-export -->
|
||||
| Field | Tier | Type | Required | Default | Description |
|
||||
|-------|------|------|----------|---------|-------------|
|
||||
| `targets` | checkout, gate | object | yes | - | Target name (lower-case letters, digits and hyphens) to target; the name is the argument of `export run`. Every target has `handler` (`markdown`: the pages as Markdown files; `command`: the same Markdown run through a converter of this checkout), `path` (an absolute path outside the instance; it must not lie in or contain another target or an `intake` folder, and not be, lie in or contain `<backup.target>/git` or `<backup.target>/<machine>`, nor lie in any other machine's folder or a bare repository) and `include` (an array of selections, each an array of `search --field` predicates: all predicates of a selection must hold, and a page that fits any selection is exported; there is no "everything"). Optional: `frontmatter` (`minimal`: only the export marker; `summary`, the default: also `title`, `type`, `summary` and `modified` where the page has them; `full`: the page's whole frontmatter), `links` (`relative`, the default: a wikilink to an exported page becomes a relative Markdown link; `text`: plain text; a link to a page that is not exported is always plain text) and `after_publish` (default false: refresh this target after every `publish` that committed). The handler `command` takes `command` (required: the name of an entry of `commands`). A field the handler does not take is an error. |
|
||||
| `targets` | checkout, gate | object | yes | - | Target name (lower-case letters, digits and hyphens) to target; the name is the argument of `export run`. Every target has `handler` (`markdown`: the pages as Markdown files; `command`: the same Markdown run through a converter of this checkout), `path` (an absolute path outside the instance; it must not lie in or contain another target or an `intake` folder, and not be, lie in or contain `<backup.target>/git` or `<backup.target>/<machine>`, nor lie in any other machine's folder or a bare repository) and `include` (the string `"all"`: every page `search` knows, a page directly under `kb/` included and no generated or meta file; or an array of selections, each an array of `search --field` predicates: all predicates of a selection must hold, and a page that fits any selection is exported. A missing or empty `include` is an error, never "all"). Optional: `frontmatter` (`minimal`: only the export marker; `summary`, the default: also `title`, `type`, `summary` and `modified` where the page has them; `full`: the page's whole frontmatter), `links` (`relative`, the default: a wikilink to an exported page becomes a relative Markdown link; `text`: plain text; a link to a page that is not exported is always plain text), `index` (default false; true: also write `index.md` in the target's root and an `INDEX.md` per collection, and per area the catalog gives a file of its own, listing the exported pages only, with relative Markdown links whatever `links` says) and `after_publish` (default false: refresh this target after every `publish` that committed). The handler `command` takes `command` (required: the name of an entry of `commands`). A field the handler does not take is an error. |
|
||||
| `commands` | checkout, names a command | object | no | `{}` | Command name to command: an array of the program and its arguments, run by the `command` handler without a shell, with stdin closed and a timeout of 300 s. The last two arguments appended are the directory holding the Markdown and an empty output directory. Exit 0 makes the regular files in the output directory the target's content; anything else leaves the target unchanged and prints the end of the program's stderr. |
|
||||
|
||||
- **Absent:** No export: `export run` stops with exit 1 naming the section, `publish` exports nothing and `doctor` reports `OK`.
|
||||
@@ -672,6 +672,12 @@ Example:
|
||||
"links": "relative",
|
||||
"after_publish": true
|
||||
},
|
||||
"whole-kb": {
|
||||
"handler": "markdown",
|
||||
"path": "C:\\Users\\<user>\\OneDrive - <company>\\Chemenu-KB",
|
||||
"include": "all",
|
||||
"index": true
|
||||
},
|
||||
"as-word": {
|
||||
"handler": "command",
|
||||
"command": "pandoc-docx",
|
||||
@@ -696,12 +702,24 @@ Example:
|
||||
```
|
||||
<!-- /wikitool:reference-config-export -->
|
||||
|
||||
Within one target, `include` is a list of selections, each a list of `search` predicates (`tags=docs`,
|
||||
`entity_type=system`, `!source_url`): a page is exported when it satisfies every predicate of at least
|
||||
one selection. Only what `include` selects is written - there is no way to exclude by default. The
|
||||
syntax is checked when the section is read, the field names against the corpus when `export run`
|
||||
runs. `path` must not lie in or contain the instance, another target, an `intake` folder or
|
||||
`backup.target`.
|
||||
Within one target, `include` is either the string `"all"` or a list of selections, each a list of
|
||||
`search` predicates (`tags=docs`, `entity_type=system`, `!source_url`): a page is exported when it
|
||||
satisfies every predicate of at least one selection. `"all"` selects every page `search` knows without
|
||||
a predicate - one directly under `kb/` too, never a generated or meta file (`kb/index.md`, `kb/log.md`,
|
||||
`kb/provenance.md`, `kb/CONTRACT.md`, `kb/CONVENTIONS.md`, an `INDEX.md`, a `COLLECTION.md`). Only what
|
||||
`include` selects is written - there is no way to exclude by default, and a missing or empty `include`
|
||||
is an error, never "all". The syntax is checked when the section is read, the field names against the
|
||||
corpus when `export run` runs. `path` must not lie in or contain the instance, another target, an
|
||||
`intake` folder or `backup.target`.
|
||||
|
||||
With `"index": true` a run also writes `index.md` in the root of the target and an `INDEX.md` per
|
||||
collection - and per area the catalog under `kb/` would give a file of its own. They list the exported
|
||||
pages only (Page, Type, Summary, Last Modified), link with relative Markdown links whatever `links`
|
||||
says, and carry no date of the day: Last Modified is the page's own `modified`, `date` or `created`,
|
||||
empty where it has none. The column and heading labels are English. Each starts with a frontmatter
|
||||
block whose only key is `wikitool_export` (`kind=index`), so `raw accept` refuses it like a page. A
|
||||
page `<collection>/index.md` beside the generated `<collection>/INDEX.md` stops the target, since a
|
||||
synced folder on Windows would make them one file.
|
||||
|
||||
Every Markdown file starts with a frontmatter block whose first key is `wikitool_export`, carrying
|
||||
the kind, the instance and the newest commit that touched that page. `frontmatter` decides what follows:
|
||||
|
||||
Reference in new issue
Block a user