Skip to content
Search

MkDocs

lastmod 2026-04-01created 2023-07-1330 edits

MKDocs is a writing tool. There are many writing tools, such as sphinx and read docs. I chose MKDocs because it is simple, you write in markdown, and the serve command lets you see what you're writing in real time.

Categories

Plugins

Markdown Extensions

Add the following to the mkdocs.yml file:

markdown_extensions:
  - md_in_html
  - pymdownx.arithmatex:
      generic: true

See Python-Markdown#Extensions for the full list.

How to generate sitemap.xml

sitemap.xml is generated only if you set site_url in the mkdocs.yml file:

site_name: "My Docs"
site_url: "https://example.com/docs/"

Linking to pages

WARNING

Using absolute paths in links is not officially supported. MkDocs adjusts relative paths so that they are always relative to the page. Absolute paths are not modified at all. This means that links using absolute paths may work fine in your local environment but may break once deployed to a production server.

Troubleshooting

Doc file 'Index.md' contains a link 'mutex.md', but the target is not found among documentation files.

A warning raised when a file is linked but cannot be found.

INFO    -  Doc file '1BITDRAGON.md' contains an absolute link '/Music.md', it was left as is.
INFO    -  Doc file '1BITDRAGON.md' contains an absolute link '/Scorewriter.md', it was left as is.

To hide the log, in the mkdocs.yml file:

validation:
  links:
    absolute_links: ignore

See also

Favorite site

author Zer0 sitemap