# mdjango docs

> A drop-in Django app that renders a tree of markdown into a documentation site.

## Getting started
- [Install and mount](/getting-started/install-and-mount.md): Install mdjango into a Django project, write two markdown files, and open the rendered site.

## How-to
- [Write a page](/how-to/write-a-page.md): Front-matter, headings the table of contents picks up, tagged code fences, and relative links that resolve.
- [Structure a content tree](/how-to/structure-a-content-tree.md): Set the Index page, order Sections and Pages, group Pages into a Subsection, and hide drafts.
- [Brand the header](/how-to/brand-the-header.md): Set the wordmark, title, version chip and header links from settings.
- [Change the colours and type](/how-to/change-colours-and-type.md): Point MDJANGO_EXTRA_CSS at a stylesheet that sets the seven CSS seeds, light and dark.
- [Add analytics and other <head> tags](/how-to/add-head-tags.md): Shadow the head slot to inject a tracking script, a verification tag, or a preconnect — the one supported template override.
- [Publish the LLM artifacts](/how-to/publish-llm-artifacts.md): Describe the site and its pages for llms.txt, serve it at the domain root, or switch the markdown surface off.
- [Validate content in CI](/how-to/validate-content-in-ci.md): Fail a build on a broken Content tree before it reaches a running server.
- [Run in production](/how-to/run-in-production.md): Serve the shell's assets, set the cache, restrict the docs to signed-in users, and ship a content change.
- [Export a static site](/how-to/export-a-static-site.md): Write the whole site to a directory with mdjango_build and host it at the prefix it was built for, when nothing else from Django is needed.
- [Make your docs discoverable](/how-to/make-docs-discoverable.md): Wire a sitemap search engines can read, point a robots.txt at it, and know what mdjango leaves to your site root.

## Reference
- [Settings](/reference/settings.md): Every MDJANGO_* Django setting, its type, default, effect, and what happens when it is wrong.
- [Content tree rules](/reference/content-tree.md): Directory layout, index files, front-matter keys, ordering, slugs and URLs, and the errors a tree can raise.
- [URLs](/reference/urls.md): The routes mdjango.urls mounts under your prefix, their names, the response headers, and the search index schema.
- [mdjango_build](/reference/mdjango-build.md): The management command that validates the Content tree or exports the site to a static directory.
- [Theme tokens](/reference/theme-tokens.md): The seven CSS seeds a Consumer may set, the three derived values that are locked, their shipped defaults, and the dark-mode selectors.
- [Templates](/reference/templates.md): The page template, the ten cotton components it composes, the context each one reads, the head slot a Consumer may override, and the shipped static assets.
- [Markdown](/reference/markdown.md): The Python-Markdown extensions and options in effect, what the renderer adds, and what is not enabled.

## Explanation
- [The filesystem is the source of truth](/explanation/the-filesystem-is-the-source-of-truth.md): What you operate when you run mdjango, and what it assumes about the markdown you point it at.
- [Why three levels](/explanation/why-three-levels.md): The Content tree stops at Section, Subsection, Page. A legibility contract, not a parser limit.
- [Why the house style is fixed](/explanation/why-the-house-style-is-fixed.md): One Theme, seven knobs, no build step. The reasoning behind mdjango's Override surface and its limits.
- [Theme examples](/explanation/theme-gallery.md): Six example palettes built with MDJANGO_EXTRA_CSS — what the seven seeds can express, light and dark.
- [How caching works](/explanation/how-caching-works.md): The three layers behind one setting, why an edit on a live server does not show, and why the default is public.
