Skip to content

Uptick spacing

Use of MkDocs in the context of Uptick requires an extended filesystem layout.

Space root

An Uptick space directory, located on some filesystem, is somewhat comparable to a ‘project’ directory for MkDocs. In its core, where only a single MkDocs project/site is in play, an Uptick space directory for a topic named Topic could look like this:

Topic/
  ├─ cache/
  ├─ offline/
  ├─ online/
  └─ source/

In this,

  • the cache subdirectory is intended to be read, and if necessary updated, by the mkdocs build process
  • the offline subdirectory is expected to be filled, by the build process, with offline-style site content
  • the online subdirectory is expected to be filled, by the build process, with online-style site content
  • the source subdirectory contains editor-level content that will be read by the build process

A cache subdirectory need not exist. When it is absent, the cachable data that is still gathered during the rendering process will not get persisted into the local environment of the editor.

Of the offline and online subdirectories, at least one needs to be present. Leaving out online (but retaining offline) causes the rendering of the online variant to be skipped (but the offline rendering to proceed).

The editor-level content contained by the mandatory source subdirectory is the familiar MkDocs project material. Putting the MkDocs factory default (as in mkdocs new) content in there results in this:

Topic/
  ├─ cache/
  ├─ offline/
  ├─ online/
  └─ source/
       ├─ docs/
       │    └─ index.md
       └─ mkdocs.yml

Site inheritance

A MkDocs site directory (which at minimum contains a docs subdirectory and a mkdocs.yml file) may contain a further subdirectory named subordinate. This subdirectory is Uptick-specific.

Beneath the subordinate subdirectory, subsubdirectories may be created that are each a further MkDocs site root.

(Note that the names of directories introduced by Uptick are all singular: source and subordinate. The directory specific to MkDocs is plural, docs.)

If the top-level Topic site (whose MkDocs site directory is Topic/source/) had subordinate sites named Eenie and Meenie, the combined layout would become something like this:

Topic/
  ├─ cache/
  ├─ offline/
  ├─ online/
  └─ source/
       ├─ docs/
       │    └─ index.md
       ├─ subordinate/
       │    ├─ Eenie/
       │    │    ├─ docs/
       │    │    │    └─ index.md
       │    │    └─ mkdocs.yml
       │    └─ Meenie/
       │         ├─ docs/
       │         │    └─ index.md
       │         └─ mkdocs.yml
       └─ mkdocs.yml

Were a further site Miney added beneath subsite Eenie, the layout would turn into [an extension of] this:

Topic/
  ├─ cache/
  ├─ offline/
  ├─ online/
  └─ source/
       ├─ docs/
       │    └─ index.md
       ├─ subordinate/
       │    ├─ Eenie/
       │    │    ├─ docs/
       │    │    │    └─ index.md
       │    │    ├─ subordinate/
       │    │    │    └─ Miney/
       │    │    │         ├─ docs/
       │    │    │         │    └─ index.md
       │    │    │         └─ mkdocs.yml
       │    │    └─ mkdocs.yml
       │    └─ Meenie/
       │         ├─ docs/
       │         │    └─ index.md
       │         └─ mkdocs.yml
       └─ mkdocs.yml

Compound rendering

On the machine where the rendering takes place, there is a wrapper script named elevate that issues multiple calls to mkdocs – for every site contained beneath the Uptick umbrella, and each site in online and/or offline mode. The individual site output collections are stitched together and placed in the top-level online and offline subdirectories.

For the process to work, the scripting needs to have access to the Uptick space directory. The rendering scripting, the MkDocs part of it in particular, has a lot of dependencies so will likely have to run in a server-type environment. At the same time, the ‘source material’ must be accessible to the editor of the content. For them, permanent storage on a server may not be the ultimate in convenience.