Documentation
¶
Overview ¶
Package docsite is the Grimoire, Djinn's documentation site, docs/site: its book's navigation and pages rendered from docs/site/pages (grimoire.go), and its Command line filled in from the command tree of this very djinn (cli.Reference). It is what `go tool task docs` writes into bin/docs, and what djinn up serves at /docs/. Nothing is generated ahead and committed, so the site cannot lag behind its pages or the commands.
Index ¶
Constants ¶
const ( // SplashMarker is where index.html takes the waking splash (splash.html), shared with the window's index.html. SplashMarker = "<!-- djinn:splash -->" NavMarker = "<!-- djinn:nav -->" // PagesMarker is where index.html takes the pages' shells, before the Command line's. PagesMarker = "<!-- djinn:pages -->" // LabelsMarker is where index.html takes the navigation's words in every language, as JSON. LabelsMarker = "<!-- djinn:labels -->" )
The Grimoire is the documentation: a navigation on the left, and beside it the splash page, then the page the reader opens. Each page is a Markdown file of docs/site/pages, written in English, with no code: Djinn is used without code. The navigation's words are locale keys, shown in the window's language (site.js reads ?lang=).
index.html holds the splash, the navigation and an empty shell per page, nothing more: the pages, 9,000 elements with the Command line, took four seconds to read in the window's engine before the splash showed. Each page is a script of its own, pages/<slug>.js, that hands its HTML to site.js: loaded when the reader opens the page, the others in idle time, and put in the page only when it is opened. A script, not a fetch: the site opens from a file too, where a fetch is refused and a script loads.
Variables ¶
{"docs.group_start", []Page{ {"introduction", "docs.page_introduction"}, {"getting-started", "docs.page_getting_started"}, }}, {"docs.group_plan", []Page{ {"wish", "docs.page_wish"}, {"azima", "docs.page_azima"}, {"task-and-worker", "docs.page_task_and_worker"}, {"dependencies", "docs.page_dependencies"}, {"watcher", "docs.page_watcher"}, {"investigation", "docs.page_investigation"}, {"mockup", "docs.page_mockup"}, {"decision", "docs.page_decision"}, {"block", "docs.page_block"}, }}, {"docs.group_code", []Page{ {"project-and-settings", "docs.page_project_and_settings"}, {"integration-branch", "docs.page_integration_branch"}, {"merges-and-corrections", "docs.page_merges_and_corrections"}, {"push", "docs.page_push"}, {"push-strategy", "docs.page_push_strategy"}, {"gates", "docs.page_gates"}, {"pull-requests", "docs.page_pull_requests"}, }}, {"docs.group_djinn", []Page{ {"the-djinn", "docs.page_the_djinn"}, {"question-and-move", "docs.page_question_and_move"}, {"enlighten", "docs.page_enlighten"}, {"tilasm", "docs.page_tilasm"}, {"lead-notes", "docs.page_lead_notes"}, {"skills-and-templates", "docs.page_skills_and_templates"}, {"ifrit", "docs.page_ifrit"}, }}, {"docs.group_window", []Page{ {"the-window", "docs.page_the_window"}, {"inbox", "docs.page_inbox"}, {"review", "docs.page_review"}, {"rights", "docs.page_rights"}, {"machine-and-load", "docs.page_machine_and_load"}, {"usage-and-cost", "docs.page_usage_and_cost"}, {"sharing", "docs.page_sharing"}, {"restarts-and-updates", "docs.page_restarts_and_updates"}, }}, {"docs.group_reference", []Page{ {commandsSlug, "docs.page_commands"}, }}, }
Nav is the Grimoire's navigation: Introduction first, the page shown when the reader leaves the splash, then every concept of Djinn, then the command line. A concept added to Djinn takes its page here, its file, and its key in every locale.
Functions ¶
func Commands ¶
func Commands() []byte
Commands is the HTML of the Command line page: a table of contents, then every command of djinn by group, with its usage, its help, its arguments and its flags.
func FS ¶
FS is the site with the Grimoire made from it: index.html with the navigation, the pages' shells and the navigation's words in place of their markers, and a script per page, pages/<slug>.js (PageScript), the Command line's with the commands. Each is made once, when first asked: djinn up renders a page when a reader opens it.
func Labels ¶ added in v0.2.0
func Labels() []byte
Labels are the navigation's and the site's words in every language Djinn speaks, by language then key, as JSON that stays text inside a script element.
func NavHTML ¶ added in v0.2.0
func NavHTML() []byte
NavHTML is the navigation, in English: site.js puts the reader's language in place.
func PageHTML ¶ added in v0.2.0
PageHTML is what a page's shell takes: the page rendered from site's pages folder, with what is on it and the pages around it; the Command line's reference for its own. An unknown slug is fs.ErrNotExist.
func PageScript ¶ added in v0.2.0
PageScript is a page's script, pages/<slug>.js: it hands the page's HTML to site.js. Its text is ASCII: a browser may read a script with no charset as Latin-1.