18ae28f918
Chemenu kompiliert Rohnotizen zu einem verlinkten, quellengebundenen Wiki: raw/ -> types/ + tools/ -> kb/ -> reports/. Was mechanisch ist, macht tools/wikitool; was Urteil braucht, macht ein Agent unter Contracts, deren Grenzen in Code durchgesetzt sind statt im Prompt. Dieser Commit ist der Startpunkt der oeffentlichen Historie. Die vorherige Entwicklung fand in einer privaten Instanz statt und ist nicht Teil dieses Repositorys; ihre Erzaehlung steht vollstaendig in CHANGES.md, das mit 44 Eintraegen von 0.1.0 bis 2.1.0 erhalten geblieben ist. Der mitgelieferte Korpus ist ein Testbett und eine Demo: 170 Seiten ueber den Stack selbst - Gates, Lint, Versionierung, Suche, das Wiki-Muster. Er dokumentiert das Werkzeug mit den eigenen Mitteln des Werkzeugs. Lizenz: AGPL-3.0 fuer den Stack (tools/, types/), CC-BY-4.0 fuer die Inhalte. Die Grenze zwischen beiden ist der Dateiplan, den dist export berechnet - siehe NOTICE.
72 lines
2.6 KiB
Markdown
72 lines
2.6 KiB
Markdown
---
|
|
type: types/instruction.md
|
|
name: page-lifecycle
|
|
description: Rename a page, delete one, or drop a single cross-reference without breaking the links that point at it.
|
|
---
|
|
|
|
# Rename, delete, or unlink a page
|
|
|
|
A page's title is the wiki's only identifier for it. The same title appears in other pages'
|
|
`[[wikilinks]]`, in the `[[Title]]` a `[^cite-id]` footnote definition points at, and in
|
|
frontmatter reference arrays (`related:`, `sources:`, `entities:`, `concepts:`).
|
|
|
|
**Never move, rename, or delete a page file by hand, and never edit a reference array by
|
|
hand.** Each of the commands below rewrites all three places at once; hand-editing rewrites
|
|
one and leaves the others pointing at nothing.
|
|
|
|
## Rename
|
|
|
|
```bash
|
|
tools/wikitool rename --from "<Old>" --to "<New>" --dry-run # see the blast radius first
|
|
tools/wikitool rename --from "<Old>" --to "<New>"
|
|
```
|
|
|
|
Repoints body wikilinks (aliases and anchors preserved), a citation id derived from the old
|
|
title (both its Footnotes definition and every `[^cite-id]` reference to it), the page's own
|
|
H1, and every frontmatter reference array the type declares in `page_ref_fields:`.
|
|
|
|
**If `--from` is not a page but is referenced**, rename instead repoints those references onto
|
|
the existing `--to` page and moves nothing. That is the fix for a reference spelled
|
|
`act_runner` when the page is `Act Runner`.
|
|
|
|
## Delete
|
|
|
|
```bash
|
|
tools/wikitool rm --page "<Title>" --dry-run
|
|
tools/wikitool rm --page "<Title>"
|
|
```
|
|
|
|
It **refuses while other pages still reference the page**. That refusal is information, not an
|
|
obstacle: show the user the inbound list, and only re-run with `--yes` once they approve.
|
|
|
|
It strips reference-array entries and bare `- [[Title]]` / `- **label:** [[Title]]` bullets. It
|
|
leaves prose mentions and inline citations in place and reports them - those are an editorial
|
|
fix afterwards, not a reason to retry the command.
|
|
|
|
## Drop a single reference
|
|
|
|
```bash
|
|
tools/wikitool xref remove --a "<A>" --b "<B>"
|
|
```
|
|
|
|
Clears `<B>` from every reference field `<A>`'s type declares, plus the matching bullets.
|
|
`--b` need not still exist as a page, which is how a reference left behind by an earlier
|
|
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:
|
|
|
|
```bash
|
|
tools/wikitool lint
|
|
```
|
|
|
|
`lint` reports every reference still pointing at nothing.
|
|
|
|
## Scope
|
|
|
|
This is for pages under `kb/`. Contracts, instructions, skills and type-specs are not pages -
|
|
they are moved with `git mv`, and their inbound links are ordinary markdown paths that have to
|
|
be updated by hand.
|