Render Markdown documentation in the Django Admin.
Project description
django-actual-admin-docs
Render Markdown documentation directly in the Django admin`.
- Support for nested subfolders
- Comprehensive Markdown format (link to which spec)
- Provides default styles for Markdown rendering
Installation
-
Install the
django-actual-admin-docs
package:-
pip install django-actual-admin-docs[highlight]
if you want to enable syntax highlighting in code blocks. This adds Pygments as a dependency. -
pip install django-actual-admin-docs
if you don't need that and want to keep your third party dependencies lean.
-
-
Add
actual_admin_docs
to yourINSTALLED_APPS
setting:INSTALLED_APPS = [ "django.contrib.admin", "actual_admin_docs", ... ]
-
Add the documentation urlpattern, above your admin urls:
from django.contrib import admin from django.urls import include, path urlpatterns = [ path("admin/docs/", include("actual_admin_docs.urls")), path("admin/", admin.site.urls), ]
-
Add a
DOCS_ROOT
setting which should be apathlib.Path
pointing to the docs directory:DOCS_ROOT = BASE_DIR / "docs"
Documentation folder structure
You can use folders, subfolders, files in folders, etc.
๐ docs/
โ
โโโ ๐ subfolder
โ โ
โ โโโ ๐ subfolder with spaces
โ โ โโโ ๐ another-file.md
โ โ
โ โโโ ๐ another-file.md
โ โโโ ๐ index.md
โ
โโโ ๐ img
โ โโโ ๐ cat_studying_glasses.jpg
โ
โโโ ๐ index.md
โโโ ๐ markdown-sample.md
Use regular Markdown links to link to other documents or objects:
A link to [another document](./markdown-sample.md) is just a regular Markdown link. Documents in subdirectories [are supported too](./subfolder/another-file.md).
For images, downloads etc. use regular markdown markup too:
![A cat judging your code](./img/cat_studying_glasses.jpg)
[Click to download](./img/./img/cat_studying_glasses.jpg)
Custom CSS
Overwrite the actual-admin-docs.css
file to add your custom styles.
๐คบ Local Development
$ poetry install
$ poetry run pytest
$ DJANGO_SETTINGS_MODULE=actual_admin_docs.tests.testproject.settings poetry run django-admin runserver
Changelog
v0.3 2024-11-06
- Improved local test setup,
- Index files are consistently recognized in subfolders.
- Pygments as a dependency is now optional.
v0.2 2024-11-05
- Added syntax highlighting for fenced code blocks.
- Added Pygments as a dependency.
v0.1 2024-11-05
- Initial version.
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
Built Distribution
File details
Details for the file django_actual_admin_docs-0.3.tar.gz
.
File metadata
- Download URL: django_actual_admin_docs-0.3.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 249d388a6228dc4ec17b8d04a5560067aa34be08e0d1b73c57ad2bb2b72905b9 |
|
MD5 | ee19ce5ce723913df40caae93cd7f9ef |
|
BLAKE2b-256 | a8ce72b8b78b5e7dfa35895665a378fd0fe68f3e2732670bb90235a05a4b9459 |
File details
Details for the file django_actual_admin_docs-0.3-py3-none-any.whl
.
File metadata
- Download URL: django_actual_admin_docs-0.3-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.13.0 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3130ee4ea0fef713cf37832aca011f2706c0b59dfe8a597718b61777a5462fa6 |
|
MD5 | f4f5e78b12888d7dd45b70e52f51dbe9 |
|
BLAKE2b-256 | 71653067f07a9445497b0b4c0836ced8e90e78fccfd65cc70efc8b3832802731 |