From f028e6f0eaded09d3a4fa9fd4c4fef6b08fa7685 Mon Sep 17 00:00:00 2001 From: Titus Date: Sun, 22 Nov 2026 03:49:20 +0100 Subject: [PATCH] Import doors declare and count the names they make A name an element gets that is not one string of the export taken as written is now declared and told, by kind and count, beside the elements and never in them. Two kinds of made name: joined (the export's words with the door's between them, a LegendKeeper map document's Map named ": ") and the door's own, for a thing the export gives no name (a frame's corner Marker ": corner 1", an arrow with no label "Board link"). Each door lists its kinds in MADE_NAMES, a tuple of MadeName (kind, type, pattern, source, regex; MadeName.fits(type, name) reads one), in a shared private module. Notion's is empty. Each ImportReport gains made_names, kind to count, and prints one line a kind with its count and pattern. A LegendKeeper card whose page is not in the project, already named "Untitled card ()", is counted too. Tests: every real export the doors' tests read is converted and every name is either the export's text (the rule of the outside converter gate, ported) or fits exactly one declared kind of its type, with the report counting what the names show (LegendKeeper 80 of 280 and 78, Kanka 2 a file, the rest none); each declared kind is produced by a test's input and its count checked through a conftest fixture; a meta test fails when a declared kind has no such check. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 2 + README.md | 2 + src/onlyworlds/_made.py | 82 +++++++++ src/onlyworlds/campfire.py | 19 +- src/onlyworlds/kanka.py | 25 +++ src/onlyworlds/legendkeeper.py | 94 +++++++++- src/onlyworlds/notion.py | 10 ++ src/onlyworlds/worldanvil.py | 21 +++ tests/conftest.py | 21 ++- tests/test_campfire.py | 9 + tests/test_kanka.py | 23 +++ tests/test_legendkeeper.py | 6 +- tests/test_legendkeeper_boards.py | 10 +- tests/test_legendkeeper_maps.py | 12 +- tests/test_made_names.py | 282 ++++++++++++++++++++++++++++++ tests/test_worldanvil.py | 14 +- 16 files changed, 614 insertions(+), 18 deletions(-) create mode 100644 src/onlyworlds/_made.py create mode 100644 tests/test_made_names.py diff --git a/CHANGELOG.md b/CHANGELOG.md index b88a03d..099b492 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ The package version runs on its own semver; the schema it is generated from is ` ## Unreleased +- **Each import door tells the names it made.** A name an element gets that is not one string of the export taken as written is now declared and counted, by kind. A joined name is the export's words with the door's between them (a LegendKeeper map document becomes a Map named `: `); the door's own is a name for a thing the export never names (a frame's corner Marker, `: corner 1`; an arrow with no label, `Board link`). Each door lists its kinds in `MADE_NAMES`, a tuple of `MadeName` (`kind`, `type`, `pattern`, `source` `joined` or `ours`, and `regex`, read by `MadeName.fits(type, name)`); Notion's is empty. Each `ImportReport` gains `made_names` (kind to count) and prints one line a kind with its count and pattern. Nothing is added to an element. On the doors' real test exports: LegendKeeper's JSON export 80 made names of 280 (17 Narratives and 6 Maps `: `, 56 frame corners, one nameless pin), its .lk export 78, each Kanka export 2 (`: hidden details`), World Anvil, Notion and Campfire none. + ## 0.139.3 (2026-11-21) - **The schema pin moves to `v0.34.1-dist.144`** (canonical 00.34.01 unchanged, no schema file moved, `_schema.py` changes only its provenance lines). The map-space page gains rule 15, bringing a point down to a child Map, with the reading `down_of` and a fourth fixture list, `down_cases` (28 cases). This package does not read it yet; no other case moves. diff --git a/README.md b/README.md index a3829f8..1247568 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,8 @@ print(report.render()) Each element heading becomes an element, its description the description. The file names no module, so the type is read from the template's own panel words (a Basic Information panel with Place of Residence is a Character, Location Details a Location; Species, Cultures, Items, Languages, Religions, Philosophies, Systems, Magic and Maps are mapped too, by one table, `MODULE_TYPES`); anything else becomes a Narrative (supertype `Article`). The report names, for each element, the panel words its type was read from. Every filled panel value is kept as `x_campfire__