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:
@@ -38,6 +38,9 @@ pub struct Row {
|
||||
pub touch: String,
|
||||
pub pointer: String,
|
||||
pub keys: String,
|
||||
/// The manual section that shows the gesture, as a heading anchor; empty
|
||||
/// where there is none, and the sheet then offers no "See it".
|
||||
pub manual: String,
|
||||
}
|
||||
|
||||
/// Build the sheet's rows from the generated table.
|
||||
@@ -67,6 +70,7 @@ fn rows_from(gestures: &[Gesture]) -> Vec<Row> {
|
||||
touch: g.touch.to_string(),
|
||||
pointer: g.pointer.to_string(),
|
||||
keys: g.keys.to_string(),
|
||||
manual: g.manual.to_string(),
|
||||
});
|
||||
}
|
||||
out
|
||||
@@ -83,6 +87,7 @@ mod tests {
|
||||
touch: "Tap",
|
||||
pointer: "",
|
||||
keys: "",
|
||||
manual: "",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user