Skip to main content

A reusable Django app that serves a markdown folder as a documentation site at /docs

Project description

django-md-docs

A reusable Django app that renders a folder of Markdown files as a documentation site at /docs.

Installation

pip install django-md-docs

Setup

1. settings.py

INSTALLED_APPS = [
    ...
    "md_docs",
]

# Optional settings (all have defaults):
MD_DOCS_DIR = BASE_DIR / "md-docs"        # default: BASE_DIR / "md-docs"
MD_DOCS_LOGIN_REQUIRED = True              # default: True
MD_DOCS_BRAND = "My Project"              # default: "Documentation"
MD_DOCS_LOGOUT_URL = "/accounts/logout/"  # default: None (hides the logout button)

2. urls.py

from django.urls import include, path

urlpatterns = [
    ...
    path("docs/", include("md_docs.urls")),
]

3. Create your markdown files

md-docs/
├── index.md          →  /docs/
├── guide/
│   ├── index.md      →  /docs/guide/
│   └── setup.md      →  /docs/guide/setup
└── api/
    ├── index.md      →  /docs/api/
    └── endpoints.md  →  /docs/api/endpoints

The navigation sidebar is built automatically from the directory structure. The first heading in each file is used as its nav label.

Settings reference

Setting Default Description
MD_DOCS_DIR BASE_DIR / "md-docs" Path to the folder containing .md files
MD_DOCS_LOGIN_REQUIRED True Redirect unauthenticated users to LOGIN_URL
MD_DOCS_BRAND "Documentation" Brand name displayed in the sidebar header
MD_DOCS_LOGOUT_URL None URL for the logout POST action. When None, the logout button is hidden

Supported Markdown extensions

  • tables
  • fenced_code
  • toc (table of contents, shown in the right sidebar)
  • attr_list

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_md_docs-0.1.0.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_md_docs-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file django_md_docs-0.1.0.tar.gz.

File metadata

  • Download URL: django_md_docs-0.1.0.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_md_docs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6d8e7df8d7ed13745432890a1fd2777f3062d29d392dc710fe41f17134a3f718
MD5 2616ed9f72d9bf67ed6f4c7191ef123a
BLAKE2b-256 20a535e2a2596a1ec50feb86d7163db12b09f1b11f7afba7501fe4a51120ae58

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_md_docs-0.1.0.tar.gz:

Publisher: release.yml on gabrielbchaves/django-md-docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_md_docs-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: django_md_docs-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_md_docs-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d09d767248df98c8c5a24a0dbe10d5a5eabdbffbae9737e09e709916b50f7ae
MD5 a5db6005b9f2383d37885e8a2aab0f3b
BLAKE2b-256 e43c79e1bacd8d3b69bd3a4af2882bf3597c731f20b7964ac225c18c7676abbf

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_md_docs-0.1.0-py3-none-any.whl:

Publisher: release.yml on gabrielbchaves/django-md-docs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page