rzk icon indicating copy to clipboard operation
rzk copied to clipboard

Add "rzk doc" command to build documentation

Open fizruk opened this issue 2 years ago • 0 comments

Since all projects currently rely on MkDocs, we could provide a default way of generating the documentation via MkDocs, optionally relying on user-provided overrides and configs. In particular, we can at the very least generate mkdocs.yml with the navigation extended by the literate Rzk Markdown files. For example, for the sHoTT project, based on the rzk.yaml file and the contents of src directory, we can generate the following file:

INHERIT: "../base.yml"
nav:
  - HoTT:
      - Common: hott/00-common.rzk.md
      - Paths: hott/01-paths.rzk.md
      - Homotopies: hott/02-homotopies.rzk.md
      - Equivalences: hott/03-equivalences.rzk.md
      - Half Adjoint Equivalences: hott/04-half-adjoint-equivalences.rzk.md
      - Sigma types: hott/05-sigma.rzk.md
      - Contractible: hott/06-contractible.rzk.md
      - Fibers: hott/07-fibers.rzk.md
      - Families of maps: hott/08-families-of-maps.rzk.md
      - Propositions: hott/09-propositions.rzk.md
      - Trivial fibrations: hott/10-trivial-fibrations.rzk.md
      - Homotopy pullbacks: hott/11-homotopy-pullbacks.rzk.md

  - Simplicial HoTT:
      - Simplicial Type Theory: simplicial-hott/02-simplicial-type-theory.rzk.md
      - Extension Types: simplicial-hott/03-extension-types.rzk.md
      - Right Orthogonal Fibrations: right-orthogonal/04-right-orthogonal.rzk.md
      - Segal Types: simplicial-hott/05-segal-types.rzk.md
      - 2-Category of Segal Types: simplicial-hott/06-2cat-of-segal-types.rzk.md
      - Discrete Types: simplicial-hott/07-discrete.rzk.md
      - Covariant Families: simplicial-hott/08-covariant.rzk.md
      - The Yoneda Lemma: simplicial-hott/09-yoneda.rzk.md
      - Rezk Types: simplicial-hott/10-rezk-types.rzk.md
      - Adjunctions: simplicial-hott/11-adjunctions.rzk.md
      - Cocartesian Families: simplicial-hott/12-cocartesian.rzk.md
      - Limits and Colimits: simplicial-hott/13-limits.rzk.md 

The idea is to get this information automatically:

  1. Get titles for sections from the (first) section name at the top of each rzk.md file
  2. Get titles for groups from
  • directory names (have to rename directories?)
  • or from an extra config params in rzk.yaml

We could also use some standard template for MkDocs as default, so that rzk doc could simply generate everything automatically.

fizruk avatar Dec 09 '23 17:12 fizruk