MkDocs Project Documentation Generator Container Image
541
A Docker Container to build MkDocs documentation.
There are a number of option with the Docker Container depending on your goals: -
In generate and run a HTTP server exposing the HTML Site, mount the directory containing the mkdocs.yml
file into the container during the container run: -
docker run -it -v ${PWD}:/mkdocs -p 8000:8000 donstewart/mkdocs:release-1.2.2
You can browse the documentation at http://localhost:8000/
This site automatically updates as you change the MkDocs Markdown files or yml configuration file.
The build output will be in your local filesystem at ./_site.
!!! warning
Do not check the _site_ directory into git make sure it is in your .gitgnore file.
In order to build the HTML Site mount the directory containing the mkdocs.yml file
into the container during the container run: -
docker run -it -v ${PWD}:/mkdocs donstewart/mkdocs:release-1.2.2 build
When the container exits the build output will be in your local filesystem at ./_site.
In addition to building the Site HTML it is also possible to generate a PDF document of the markdown site: -
docker run -it -v ${PWD}:/mkdocs -e ENABLE_PDF_EXPORT=1 donstewart/mkdocs:release-1.2.2
When the container exits the build output will be in your local filesystem at ./_site.
The PDF file generated can be found at ./_site/PDF/combined.pdf.
It is also possible to build & publish the documentation to a GitHub pages site for your project.
In order to do this make sure you project is cloned from GitHub and has it's origin set correctly.
You can then publish using: -
docker run -it -v ${PWD}:/mkdocs donstewart/mkdocs:release-1.2.2 gh-deploy
Do not generate the PDF unless you want to store the PDF file in your GitHub repo.
You will find a new branch in your git repository called gh-pages.
Never manually check in the
gh-pagesbranch and never ever switch to that branch and make changes.
Content type
Image
Digest
Size
114 MB
Last updated
almost 5 years ago
docker pull donstewart/mkdocs