Skip to content

Commit c08ff53

Browse files
committed
feat: add sphinx docs
1 parent 0536d78 commit c08ff53

23 files changed

+7081
-2
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ htmlcov/
2929
# OS
3030
.DS_Store
3131
Thumbs.db
32+
33+
# Build documentation
34+
docs/_build/
35+
docs/_static/
36+
docs/_templates/

.readthedocs.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version, and other tools you might need
8+
build:
9+
os: ubuntu-24.04
10+
tools:
11+
python: "3.13"
12+
13+
# Build documentation in the "docs/" directory with Sphinx
14+
sphinx:
15+
configuration: docs/conf.py
16+
17+
# Python requirements for building documentation
18+
python:
19+
install:
20+
- requirements: docs/requirements.txt

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,72 @@ $ python manage.py runserver
355355
Checkout at http://127.0.0.1:8000/simple-form/ on your browser.
356356

357357

358+
### Documentation
359+
360+
Complete documentation is available online at: https://django-markdown-editor.readthedocs.io/
361+
362+
#### Running Documentation Locally
363+
364+
To build and view the documentation locally:
365+
366+
**1.** Clone the repository and set up your environment:
367+
368+
```
369+
$ git clone https://github.com/agusmakmun/django-markdown-editor.git
370+
$ cd django-markdown-editor/
371+
$ python -m venv venv
372+
$ source venv/bin/activate # On Windows: venv\Scripts\activate
373+
```
374+
375+
**2.** Install documentation dependencies:
376+
377+
```
378+
$ pip install -r docs/requirements.txt
379+
```
380+
381+
**3.** Build the documentation:
382+
383+
```
384+
$ cd docs/
385+
$ sphinx-build -b html . _build/html
386+
```
387+
388+
Or using the included Makefile:
389+
390+
```
391+
$ cd docs/
392+
$ make html
393+
```
394+
395+
**4.** Open the documentation in your browser:
396+
397+
```
398+
$ open _build/html/index.html # On macOS
399+
# Or on Linux/Windows, navigate to docs/_build/html/index.html
400+
```
401+
402+
Alternatively, serve the documentation with a local HTTP server:
403+
404+
```
405+
$ make serve
406+
# Then open http://localhost:8000 in your browser
407+
```
408+
409+
The documentation includes:
410+
- Installation and quickstart guides
411+
- Complete configuration reference
412+
- Usage examples for models, forms, widgets, and admin
413+
- API documentation
414+
- Troubleshooting and FAQ
415+
416+
#### Contributing to Documentation
417+
418+
The documentation is built with [Sphinx](https://www.sphinx-doc.org/) and uses reStructuredText format. To contribute:
419+
420+
1. Edit the `.rst` files in the `docs/` directory
421+
2. Build the docs locally to test your changes
422+
3. Submit a pull request with your improvements
423+
358424
### Martor Commands Reference
359425

360426
![command reference](https://raw.githubusercontent.com/agusmakmun/django-markdown-editor/master/.etc/images/bootstrap/martor-guide.png)

docs/Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = _build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
21+
22+
# Custom targets for convenience
23+
clean:
24+
@$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
25+
26+
html:
27+
@$(SPHINXBUILD) -b html "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
28+
29+
livehtml:
30+
@sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS) $(O)
31+
32+
install:
33+
@pip install -r requirements.txt
34+
35+
serve: html
36+
@echo "Serving documentation at http://localhost:8000"
37+
@cd "$(BUILDDIR)/html" && python -m http.server 8000

0 commit comments

Comments
 (0)