Katlendar Developer manual GitHub

Guide links

How the app links into the guide, and why those pages and headings can never be renamed.

The guide at https://katlendar.date/guide/ explains every feature. The app links into it in three ways:

  • the book button beside the settings cog opens guide::HOME;
  • an (i) beside a feature opens one guide page at one heading;
  • each settings row gets an (i) of its own, with no extra code.

Addresses#

src/guide.rs builds them:

ItemWhat it is
HOMEhttps://katlendar.date/guide/
page::*the guide pages the app links to: blocks, frames, planner, quick-add, tasks, tags, calendars, accounts, google-calendar, microsoft-365, places, shortcuts, settings-general, appearance, privacy
url(page, topic)HOME + page/# + the slug of topic
slug(text)lower case, words joined by -, everything but letters and digits left out
of_settings(page)which guide page a settings page's rows point at

"When today's frames are full" becomes when-todays-frames-are-full. The site's scripts/markdown.mjs has a slug that does the same. If you change one, change the other.

The (i) button#

guide::info(ui, tip, guide::page::FRAMES, "When no frame fits");

Hovering shows tip. Clicking opens the guide at the heading. On a smaller line, use guide::info_sized with the text size.

Give a feature an (i) when it works in a way people wouldn't guess. Most buttons don't need one.

Settings rows#

settings::row adds the (i) by itself when the row has a tooltip. It links to:

  • the guide page that guide::of_settings names for the current settings page (set with guide_at);
  • at the heading named like the row in English, through strings::english(label).

So the row "Time format" on Settings › General opens /guide/settings-general/#time-format, in every language.

Never rename#

Copies already installed keep these links forever. So:

  • a guide page named in guide::page is never renamed or removed;
  • a heading an (i) points at keeps its words;
  • renaming a settings row renames its heading too, so keep the old heading as well, or don't rename.

The site's build guards this. REQUIRED in scripts/build-guide.mjs lists every page and heading the app links to, and the build fails when one goes missing.

Adding an (i) or a settings row#

  1. Add the (i) with guide::info, or the row with settings::row.
  2. In the site repo, write the heading on the guide page, in the row's English words.
  3. Add the heading to REQUIRED in scripts/build-guide.mjs.
  4. Run node scripts/build-guide.mjs and check it passes.

Both repos change, so it is two pull requests. Merge the site's first, so the link works the day the app ships.

Improve this page on GitHub