Skip to content

Mkdocs

Introduction

The Mkdocs plugin provides installation of a python venv and mkocs, with functions to build and serve documentation.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
package require mkdocs

# Load a base mkdocs toolchain locally
mkdocs::init

# Alternative: Load mkdocs with Material for mkdocs
mkdocs::init -material

# To build 
mkdocs::build 

# To Server in dev mode
mkdocs::serve

Usage with command line argument

1
2
3
package require mkdocs

mkdocs::build $argv

From the command line:

kissb -zip

Or to select between serving and building

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
package require mkdocs

switch $argv {
    -serve {
        mkdocs::serve
    }
    default {
        mkdocs::build $argv
    }
}

From the command line, to serve:

kissb -serve

to build:

kissb

Usage with targets

1
2
3
4
5
package require mkdocs

@ build {
    mkdocs::build
}

build function

Default build output: .kb/build/mkdocs

  • Use mkdocs::build to build the site, add -zip argument to create a zip file
  • Use The toplevel build.name variable to change the output zip and build folder names
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
package require mkdocs

# Change build name to produce mydocs/ and mydocs.zip outputs
set build.name mydocs 

# Just build  the site folder 
mkdocs::build

# Build with ZIP output
mkdocs::build -zip

Deployment with Netlify