Let a gesture name the manual section that shows it
The help sheet says which move does a thing, and the manual has a picture of the thing being done, but nothing joined the two: a user reading "Pinch it with two fingers" had no way from there to the GIF of it. A GESTURE tag takes an optional `manual:` field naming a heading of docs/manual/README.md by its anchor. The scan checks every one against the anchors the bundled page is rendered with and fails when the manual has no such heading, so renaming a section cannot leave the sheet linking to the top of the page; gestures-check carries the same failure into CI. The anchor goes into gesture_book.rs as a new field, and into docs/gestures.md as a "See it" link to manual/README.md#anchor. The help sheet draws a "See it" button beside the title of each gesture that has one, which opens the bundled manual at that section. The field is additive: a tag without it is unchanged, and no gesture carries one yet.
This commit is contained in:
@@ -161,6 +161,15 @@ fn run_gestures(base: &Path, check: bool) -> Result<()> {
|
||||
problems.extend(p);
|
||||
}
|
||||
|
||||
// A `manual:` must name a section the manual has, checked against the
|
||||
// same anchors the bundled page is rendered with.
|
||||
let manual_source = std::fs::read_to_string(base.join(MANUAL_SOURCE))
|
||||
.with_context(|| format!("reading {MANUAL_SOURCE}"))?;
|
||||
problems.extend(gestures::check_manual(
|
||||
&found,
|
||||
&manual::anchors(&manual_source),
|
||||
));
|
||||
|
||||
println!("files scanned {}", files.len());
|
||||
println!("gestures found {}", found.len());
|
||||
println!("places {}", gestures::by_section(&found).len());
|
||||
|
||||
Reference in New Issue
Block a user