How a build works

This page explains the steps of flight-manual build, from the site file to the output folder. Read it to know where a fault comes from, or before you write a plugin.

The steps

  1. Read the site file. The build checks each key and its value. An unknown key is an error.
  2. Make the list of pages. The list comes from the key pages, from a file of pages, or from the Markdown files of the folder docs.
  3. Load the style and the plugins. Each plugin runs in its own safe child interpreter. The hook pages of each plugin can change the list of pages.
  4. Name each output. The build gives each page its path and records each file that it will copy or write. Two outputs with the same path are an error. With this record, a link can go to a file that the build writes later, such as sitemap.xml.
  5. Check the page template against the rules of Styles and templates.
  6. Make each page.
    • The hook source changes the Markdown.
    • ztcl::markdown makes the HTML. For each link, code block, and heading, it calls the build: the build resolves the link, highlights the code, and records the anchor and the table of contents.
    • The build adds the scope of the table heads, the box of a wide table, and the notes.
    • The hook html changes the HTML.
    • The checks of the alternative text and the headings run.
  7. Check each anchor. A link to an anchor of another page is checked after all pages are made.
  8. Fill the template of each page: the menu, the table of contents, the links to the previous and the next page, and the search box.
  9. Write the other files: the search page and search.json, sitemap.xml, llms.txt and llms-full.txt (with the key summary), and the files of the hook files.
  10. Stop or write. If a step found an error, or a warning with -strict, the build writes no file and prints each fault. Else it writes each file and copies each asset.

Why it works this way

Next: The ztcl docs site.