feat: wikitool move - eine kb-Seite folgt ihrem Subtype ins berechnete Verzeichnis (#56)
Files changed: - CHANGES.md - VERSION - instructions/page-lifecycle.md - instructions/publish-cycle.md - tools/CONTRACT.md - tools/chemenu/cli.py - tools/chemenu/commands/log_append.py - tools/chemenu/commands/migrate_cmd.py - tools/chemenu/commands/new_page.py - tools/chemenu/commands/page_ops.py - tools/chemenu/corpus_diff.py - tools/chemenu/lint_core.py - tools/chemenu/tests/test_corpus_diff.py - tools/chemenu/tests/test_lint.py - tools/chemenu/tests/test_migrate_cmd.py - tools/chemenu/tests/test_page_ops.py - tools/chemenu/tests/test_type_resolver.py - tools/chemenu/type_resolver.py
This commit is contained in:
@@ -43,6 +43,29 @@ It strips reference-array entries and bare `- [[Title]]` / `- **label:** [[Title
|
||||
leaves prose mentions and inline citations in place and reports them - those are an editorial
|
||||
fix afterwards, not a reason to retry the command.
|
||||
|
||||
## Move
|
||||
|
||||
```bash
|
||||
tools/wikitool move --page "<Title>" --dry-run # see where it would go first
|
||||
tools/wikitool move --page "<Title>"
|
||||
tools/wikitool move --reconcile --dry-run # every misplaced page at once
|
||||
tools/wikitool move --reconcile
|
||||
```
|
||||
|
||||
Moves the page's file to the directory its type-spec computes for its current frontmatter -
|
||||
`base_dir` + `layout`, the same rule `new` places a page by when it is first created. The
|
||||
destination is never chosen by hand: there is no `--to <dir>`. Only the file moves - no body, no
|
||||
frontmatter field, and the title (the wiki's only identity for a page) never changes, so no
|
||||
reference anywhere in the wiki needs updating.
|
||||
|
||||
`--reconcile` applies the same rule corpus-wide in one call; a second run reports nothing left
|
||||
to do. `wikitool lint`'s **Misplaced Pages** finding is the advisory this fixes - it is not a
|
||||
hard error, so an unreconciled corpus is not a broken one, only one `move` would tidy.
|
||||
|
||||
A destination that already holds a file with the page's name is refused, not silently
|
||||
overwritten - that only happens on a pre-existing duplicate-title collision, which `lint`'s
|
||||
**Duplicate Titles** finding reports separately.
|
||||
|
||||
## Drop a single reference
|
||||
|
||||
```bash
|
||||
@@ -55,14 +78,17 @@ hand-edit gets cleared. Idempotent.
|
||||
|
||||
## Afterwards
|
||||
|
||||
Always close out with [publish-cycle.md](publish-cycle.md), using
|
||||
`--op rename` or `--op delete`. Then confirm nothing was left dangling:
|
||||
Always close out with [publish-cycle.md](publish-cycle.md), using `--op rename`, `--op delete`,
|
||||
or `--op move`. A move changed no reference, so run `wikitool index rebuild` rather than
|
||||
`sources rebuild-index` - the catalog is built from where a page's file sits, and nothing else
|
||||
about it moved. Then confirm nothing was left dangling:
|
||||
|
||||
```bash
|
||||
tools/wikitool lint
|
||||
```
|
||||
|
||||
`lint` reports every reference still pointing at nothing.
|
||||
`lint` reports every reference still pointing at nothing, and every page still not at its
|
||||
computed location.
|
||||
|
||||
## Scope
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ consistent.
|
||||
3. **Append the audit entry** - one per operation:
|
||||
|
||||
```bash
|
||||
tools/wikitool log append --op ingest|query|lint|create|update|delete|rename \
|
||||
tools/wikitool log append --op ingest|query|lint|create|update|delete|rename|move \
|
||||
--title "<what>" --body "<outcome>"
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user