Move from another generator

These steps move a site from another generator, such as a script of your own, to Flight Manual. The ztcl docs site moved from a Python script in this way (The ztcl docs site).

1. Make the list of pages

Write the pages of the menu of the old site in the key pages of the site file, or in a file of pages. Give each page the path of its page in the old site, so that each URL stays:

pages {
    group Start
    README.md          overview/   Overview
    docs/install.md    install/    Install
}

A page path is "" for the start page, a folder such as install/, or a file such as about.html.

2. Check the Markdown

ztcl::markdown follows CommonMark 0.31.2 and the extensions of GitHub: tables, task lists, strike text, and autolinks. Look for these differences from other readers:

3. Move the look

Copy the style sheets of the old site to a style folder, with a page.html that has the markup of the old pages and the slots of Flight Manual. A page template must keep the rules of Styles and templates: the skip link, a <main> with an id, and a <nav> with a name.

4. Move the parts of your own

A part of the old generator that only your site has, such as a block that runs code or pages from another source, goes into a plugin (Plugins). A plugin gets each page before and after the build reads it, and can add pages and files.

5. Compare the two sites

Build the site with both generators on the same commit, and compare them:

ztcl --allow file,channels --tclsh tools/compare-sites.tcl OLD NEW -url https://example.com/docs/

The tool lists the pages of only one site, and for each page the headings and the links that differ. It checks each link and each anchor of the new site. -url gives the URL of the site.

Three kinds of link differences are on purpose, and the tool counts them apart:

The anchor of a heading follows the rule of GitHub: ## v0.3.0 has the anchor v030. A generator with another rule gives other anchors, and the tool lists them as heading differences.

Fix each other difference, or write down why it stays, before the new generator replaces the old one. The tool exits with 1 while a difference of another kind or a dead link is left.

Next: Extend a site with a plugin.