User guides
A user guide walks people through a page, one step at a time. Each step has a title and a text, and can point at a part of the page, which is outlined and scrolled into view. People move with Next and Previous, and end with Finish or Close.
A guide
Section titled “A guide”A guide lives in guides/<id>.yaml:
name: ro: Bun venit en: Welcomesites: [main]pages: [/, /servicii]start: first-visitsteps: - title: ro: Căutați aici en: Search here text: ro: Scrieți ce căutați și apăsați Enter. en: Type what you look for and press Enter. target: "[data-placement=search]" - title: ro: Gata en: That's all text: ro: Puteți reporni ghidul oricând. en: You can start the guide again any time.sitesandpagessay where the guide applies. Left out, it applies on every site or every page. Each page must be one of the guide’s sites.startismanual, the default, orfirst-visit: the guide starts by itself the first time someone opens one of its pages.steps: at most 30, each with atitleand atextin every language, as plain text.targetis a CSS selector for the part of the page the step is about, such as#mainor[data-placement=intro]; each part placed on a page carries its id asdata-placement. A step whose target finds nothing shows on its own.
A guide can be written in JSON instead: the file is read the same way. To bring in a guide made elsewhere, save its JSON as guides/<id>.yaml.
Start a guide
Section titled “Start a guide”A guide starts:
- at its page’s address with
?guide=<id>, for example in a link from a help page; - from a form, with the
startGuideaction (UI actions), on a page that shows the form and that the guide applies to. A form opened at its own address starts no guide. - by itself on a first visit, when it says
start: first-visit.
Each browser remembers the guides it has shown by themselves and those it finished: a first-visit guide does not start again there, even when the person left the page without closing it. Escape closes a guide when it has the focus. When a page has several first-visit guides, the first by id starts. A browser that keeps nothing never starts a guide by itself.
A guide’s text is part of its pages: everyone who may see a page can read the guides on it.