Repository navigation
Rail: keep evidence genres last and apart (rail.evidence) - #2
Merged
Merged
Conversation
A library can name genres that are audit records rather than reading, such as a lab's protocols and results. The rail's By genre section then lists the reading genres in reading order, and the evidence genres follow in one closed Evidence group that opens on the page being read. - Charter: rail.evidence (list of genres); an empty list keeps the old rail. - Packs: PACK.md may name its own genres under evidence; the lab pack names protocol and result, used when the charter sets none. - Gate: new check rail-genres names an unknown or switched-off genre. - Site data carries rail.evidence; folio config get/set rail.evidence. - Reading order places the lab genres. - Specs, configure skill, lab pack doc, changelog; version 0.2.3.
…idence strictly
- An empty rail.evidence (null) is an error asking for []; rail: and rail: {} leave the packs to decide.
- A pack's evidence is checked when present: a list of strings, each once, from its genres.
- config set shows the old value with the packs' default applied, as config get does.
- The closed Evidence group's count line follows the evidence order.
- Say exactly what evidence: [] restores; tests for each case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Pier
Why
In a lab library (for example 98 results, 30 protocols, 13 reports, 7 questions, 3 claims) the rail's "By genre" section lists every genre by name, so protocols and results, which are audit records, sit among the reading genres and dwarf them. The reader cannot tell where to start.
What changes
rail: { evidence: [protocol, result] }names genres the rail lists last and apart.rail: { evidence: [] }lists every genre together in "By genre", by name, as before. An emptyevidence:(null) is an error asking for[];rail:orrail: {}leave the packs to decide. Validated incharter.py(list of strings, no duplicates, no unknown keys underrail).PACK.mdmay name its own genres underevidence, checked as strictly as the charter's: a list of strings, each once, each one of the pack'sgenres. The lab pack namesprotocolandresult. The charter's value, when set, wins.Library.rail_evidence()resolves it, keeping only active genres.genreRank), and the evidence genres follow in one closed group headed Evidence, which shows a count line ("30 protocols, 98 results") while closed, in the same order as the groups inside it. It reuses the rail'sgroup(), so it remembers its state, and it opens with the inner genre group when it holds the page being read. Without evidence genres the section is listed by name, as before. Search is not affected.READINGnow places the lab genres (report after entry, claim and question after concept, protocol and result at the end), matching its comment "the way in first, then ideas, then the evidence". A long map without sections uses the same order.rail-genres(error) names a genre inrail.evidencethat does not exist or is switched off (its pack is off, orenabled: false).rail.evidence.folio config get|set rail.evidenceworks. Bothgetand the old value thatsetprints show the packs' default when the charter sets none, through one shared helper.model.md§10 and §14,checks.md,pack-format.md,commands.md), the configure skill, the labPACK.md, the changelog, and the version bump to 0.2.3.Design notes
evidence: [], gets the "By genre" section it had: every genre listed by name.[]does not restore everything, though: the reading order now includes the lab genres, so a long map without its own sections, the closed-section count lines and the rail's key now place lab genres in that order instead of by name.rail: { evidence: [] }opts out.Gate
python -m pytest -q: 310 passed, 4 skipped (the new tests are intests/test_rail.py)cd docs && folio check: 39 documents, 0 errors, 0 warningsChecked by hand as well: the sample fixture and a copy of a 322-page lab library were exported and the rail was rendered with jsdom. On a result page, the reading genres come in reading order and the Evidence group is open with Results open and the page marked. On a concept page, Evidence is closed. With
evidence: [], the rail is alphabetical as before.