Seamless project documentation with MkDocs.
MkDocs is a fast, simple and downright gorgeous static site generator that's geared towards building project documentation. Documentation source files are written in Markdown, and configured with a single YAML configuration file. Start by reading the Mkdocs introductionsm, then check the User Guide for more info.
MkDocs.online is a runtime online version of MkDocs that enables seamless view MkDocs site, by providing the same functionality¹ as the original MkDocks with the difference of generating it on the client side directly from the Git reposistory.
¹There are limitation, see the section below.
Because MkDocs.online runs on the client side it enables to view the MkDocs site of every commit of the repository, without the need to deploy it.
Because MkDocs.online runs on the client side, the loading of the page is slower then generated MkDocs site.
In order to use MkDocs.online, you need to provide the following values in the URL:
- site - the site that hosts the repository. Currently supports only
GitHub
andGitLab
. - repository owner - the user or organization that owns the repository
- repository name
- the branch
The URL is in the following format:
https://www.mkdocs.online/?site=<site>&owner=<owner>&repo=<repo>&branch=<branch>
This site: https://www.mkdocs.online/?site=GitHub&owner=yeger00&repo=mkdocs-online&branch=master
MkDocs: https://www.mkdocs.online/?site=GitHub&owner=mkdocs&repo=mkdocs&branch=master
RedisBloom: https://www.mkdocs.online/?site=GitHub&owner=RedisBloom&repo=RedisBloom&branch=master
GitLab mkdocs example page: https://www.mkdocs.online/?site=GitLab&owner=pages&repo=mkdocs&branch=master
OpenCraft: https://www.mkdocs.online/?site=GitLab&owner=opencraft&repo=documentation/public&branch=master
The code is pure JavaScript that the performs the following:
- Fetch the docs directory from the Git repository using Octokit.
- Parse the MkDocs configuration file using js-yaml.
- Generate the Page content from Markdown to HTML using markdown-it and markdown-it-toc-and-anchor.
- Generate the final page using nunjucks.
The plan is to add support for the following features supported by MkDocs:
- plugins
- extensions
- search
And to add support for more Git servers:
- BitBucket
- MkDocs: BSD-2-Clause License
- Octokit: MIT
- js-yaml: MIT
- nunjucks: BSD-2-Clause License
- markdown-it: MIT
- markdown-it-toc-and-anchor: MIT