spacr.qt.tutorials

Which published lesson teaches a module, and the URL that opens it.

The lesson library at <docs>/tutorials/ deep-links with #lesson=<id>, so pointing a reader at the lesson for the module they are hovering is a lookup and a string. The lookup table is spacr/resources/tutorial_index.json, written by tools/build_tutorial_index.py from the docs build’s own lesson catalog – see there for why it is not the catalog itself.

NO NETWORK, NO HEAVY IMPORT. This is read on the hover path, from Home and from the dock, so it caches the table on first use and answers "" for anything it cannot resolve. A module with no lesson must cost a missing link, never an exception in a hover handler.

Functions

has_tutorial(→ bool)

Whether app_key has a lesson to link to.

lesson_for(→ str)

The lesson id that teaches app_key, or "".

lesson_title(→ str)

The lesson's own title, for a tooltip. "" when there is none.

tutorial_url(→ str)

The URL that opens app_key's lesson, or "" when it has none.

Module Contents

spacr.qt.tutorials.has_tutorial(app_key: str) → bool[source]

Whether app_key has a lesson to link to.

Parameters:

app_key – the app key looked up in the bundled tutorial_index.json; None or empty gives no lesson.

spacr.qt.tutorials.lesson_for(app_key: str) → str[source]

The lesson id that teaches app_key, or "".

Parameters:

app_key – the app key looked up in the bundled tutorial_index.json; None or empty gives no lesson.

spacr.qt.tutorials.lesson_title(app_key: str) → str[source]

The lesson’s own title, for a tooltip. "" when there is none.

Parameters:

app_key – the app key looked up in the bundled tutorial_index.json; None or empty gives no lesson.

spacr.qt.tutorials.tutorial_url(app_key: str) → str[source]

The URL that opens app_key’s lesson, or "" when it has none.

Empty rather than the library’s front page on purpose. The link is drawn only when this answers, so a word that would have dropped the reader at an index of seventy-three lessons is simply not offered – the rule the tooltip footer already follows for Animation.

Parameters:

app_key – the app key looked up in the bundled tutorial_index.json; None or empty gives no lesson.