drf-to-mkdoc 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of drf-to-mkdoc might be problematic. Click here for more details.
- drf_to_mkdoc/__init__.py +6 -6
- drf_to_mkdoc/apps.py +14 -14
- drf_to_mkdoc/conf/settings.py +44 -44
- drf_to_mkdoc/management/commands/build_docs.py +76 -76
- drf_to_mkdoc/management/commands/generate_doc_json.py +512 -512
- drf_to_mkdoc/management/commands/generate_docs.py +138 -138
- drf_to_mkdoc/management/commands/generate_model_docs.py +327 -327
- drf_to_mkdoc/management/commands/update_doc_schema.py +53 -53
- drf_to_mkdoc/utils/__init__.py +3 -3
- drf_to_mkdoc/utils/endpoint_generator.py +945 -945
- drf_to_mkdoc/utils/extractors/__init__.py +3 -3
- drf_to_mkdoc/utils/extractors/query_parameter_extractors.py +229 -229
- drf_to_mkdoc/utils/md_generators/query_parameters_generators.py +72 -72
- drf_to_mkdoc/utils/model_generator.py +269 -269
- {drf_to_mkdoc-0.1.0.dist-info → drf_to_mkdoc-0.1.2.dist-info}/METADATA +247 -247
- drf_to_mkdoc-0.1.2.dist-info/RECORD +25 -0
- {drf_to_mkdoc-0.1.0.dist-info → drf_to_mkdoc-0.1.2.dist-info}/licenses/LICENSE +21 -21
- drf_to_mkdoc-0.1.0.dist-info/RECORD +0 -25
- {drf_to_mkdoc-0.1.0.dist-info → drf_to_mkdoc-0.1.2.dist-info}/WHEEL +0 -0
- {drf_to_mkdoc-0.1.0.dist-info → drf_to_mkdoc-0.1.2.dist-info}/top_level.txt +0 -0
|
@@ -1,247 +1,247 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: drf-to-mkdoc
|
|
3
|
-
Version: 0.1.
|
|
4
|
-
Summary: Generate Markdown API docs from Django/DRF OpenAPI schema for MkDocs
|
|
5
|
-
Author-email:
|
|
6
|
-
Maintainer-email:
|
|
7
|
-
License: MIT
|
|
8
|
-
Project-URL: Homepage, https://github.com/yourusername/drf-to-mkdoc
|
|
9
|
-
Project-URL: Repository, https://github.com/yourusername/drf-to-mkdoc
|
|
10
|
-
Project-URL: Documentation, https://github.com/yourusername/drf-to-mkdoc#readme
|
|
11
|
-
Project-URL: Bug Tracker, https://github.com/yourusername/drf-to-mkdoc/issues
|
|
12
|
-
Keywords: django,django-rest-framework,documentation,mkdocs,api
|
|
13
|
-
Classifier: Development Status :: 4 - Beta
|
|
14
|
-
Classifier: Intended Audience :: Developers
|
|
15
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Programming Language :: Python :: 3
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
-
Classifier: Framework :: Django
|
|
24
|
-
Classifier: Framework :: Django :: 3.2
|
|
25
|
-
Classifier: Framework :: Django :: 4.0
|
|
26
|
-
Classifier: Framework :: Django :: 4.1
|
|
27
|
-
Classifier: Framework :: Django :: 4.2
|
|
28
|
-
Classifier: Framework :: Django :: 5.0
|
|
29
|
-
Classifier: Topic :: Documentation
|
|
30
|
-
Classifier: Topic :: Software Development :: Documentation
|
|
31
|
-
Requires-Python: >=3.8
|
|
32
|
-
Description-Content-Type: text/markdown
|
|
33
|
-
License-File: LICENSE
|
|
34
|
-
Requires-Dist: Django<6.0,>=3.2
|
|
35
|
-
Requires-Dist: djangorestframework<4.0,>=3.12
|
|
36
|
-
Requires-Dist: PyYAML>=6.0
|
|
37
|
-
Requires-Dist: drf-spectacular>=0.26.0
|
|
38
|
-
Requires-Dist: mkdocs>=1.4.0
|
|
39
|
-
Requires-Dist: mkdocs-material>=9.0.0
|
|
40
|
-
Requires-Dist: coreapi>=2.3.0
|
|
41
|
-
Provides-Extra: dev
|
|
42
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
43
|
-
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
|
|
44
|
-
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
45
|
-
Requires-Dist: isort>=5.10.0; extra == "dev"
|
|
46
|
-
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
|
47
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
48
|
-
Dynamic: license-file
|
|
49
|
-
|
|
50
|
-
# DRF to MkDocs
|
|
51
|
-
|
|
52
|
-
Generate beautiful, interactive Markdown API documentation from Django REST Framework OpenAPI schema for MkDocs.
|
|
53
|
-
|
|
54
|
-
## Why you'll love it
|
|
55
|
-
|
|
56
|
-
- **Zero-hassle docs**: Beautiful, always-in-sync API docs straight from your codebase
|
|
57
|
-
- **Model deep dive**: Auto-generated model pages with fields, relationships, and choices
|
|
58
|
-
- **Lightning-fast discovery**: Interactive endpoint index with powerful filters and search
|
|
59
|
-
- **DRF-native**: Works with DRF Spectacular; no custom schema wiring needed
|
|
60
|
-
- **MkDocs Material**: Looks great out of the box with the Material theme
|
|
61
|
-
|
|
62
|
-
## Installation
|
|
63
|
-
|
|
64
|
-
See the full installation guide in `docs/installation.md`.
|
|
65
|
-
|
|
66
|
-
## Quick Start
|
|
67
|
-
|
|
68
|
-
1. **Configure your Django project**:
|
|
69
|
-
|
|
70
|
-
```python
|
|
71
|
-
# settings.py
|
|
72
|
-
INSTALLED_APPS = [
|
|
73
|
-
# ... your other apps
|
|
74
|
-
'drf_to_mkdoc',
|
|
75
|
-
]
|
|
76
|
-
|
|
77
|
-
# Required for OpenAPI schema generation
|
|
78
|
-
REST_FRAMEWORK = {
|
|
79
|
-
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
SPECTACULAR_SETTINGS = {
|
|
83
|
-
'TITLE': 'Your API',
|
|
84
|
-
'DESCRIPTION': 'Your API description',
|
|
85
|
-
'VERSION': '1.0.0',
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
DRF_TO_MKDOC = {
|
|
89
|
-
'DJANGO_APPS': [
|
|
90
|
-
'users',
|
|
91
|
-
'products',
|
|
92
|
-
'orders',
|
|
93
|
-
'inventory',
|
|
94
|
-
],
|
|
95
|
-
# Optional: Override default paths
|
|
96
|
-
# 'DOCS_DIR': 'docs',
|
|
97
|
-
# 'CONFIG_DIR': 'docs/configs',
|
|
98
|
-
# 'MODEL_DOCS_FILE': 'docs/model-docs.json',
|
|
99
|
-
# 'DOC_CONFIG_FILE': 'docs/configs/doc_config.json',
|
|
100
|
-
# 'CUSTOM_SCHEMA_FILE': 'docs/configs/custom_schema.json',
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
2. **Create MkDocs configuration**:
|
|
105
|
-
|
|
106
|
-
```yaml
|
|
107
|
-
# mkdocs.yml
|
|
108
|
-
site_name: Your API Documentation
|
|
109
|
-
theme:
|
|
110
|
-
name: material
|
|
111
|
-
features:
|
|
112
|
-
- navigation.tabs
|
|
113
|
-
- navigation.sections
|
|
114
|
-
- navigation.expand
|
|
115
|
-
- search.highlight
|
|
116
|
-
- search.share
|
|
117
|
-
|
|
118
|
-
plugins:
|
|
119
|
-
- search
|
|
120
|
-
|
|
121
|
-
nav:
|
|
122
|
-
- Home: index.md
|
|
123
|
-
- About: about.md
|
|
124
|
-
- Models: models/index.md
|
|
125
|
-
- API Endpoints: endpoints/index.md
|
|
126
|
-
- Pagination: pagination.md
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
3. **Build documentation**:
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
python manage.py build_docs --settings=docs_settings
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
## What you get
|
|
136
|
-
|
|
137
|
-
See a detailed overview of generated files in `docs/structure.md` and a feature breakdown in `docs/features.md`.
|
|
138
|
-
|
|
139
|
-
## How it works
|
|
140
|
-
|
|
141
|
-
Under the hood, drf-to-mkdoc introspects your models and reads your DRF OpenAPI schema to generate clean, organized Markdown. Then MkDocs turns it into a polished static site. Always current, no manual updates.
|
|
142
|
-
|
|
143
|
-
## Explore more
|
|
144
|
-
|
|
145
|
-
- Customizing endpoint docs: `docs/customizing_endpoints.md`
|
|
146
|
-
- Serving docs through Django (with permissions): `docs/serving_mkdocs_with_django.md`
|
|
147
|
-
|
|
148
|
-
## Dependencies
|
|
149
|
-
|
|
150
|
-
- Django >= 3.2, < 6.0
|
|
151
|
-
- Django REST Framework >= 3.12, < 4.0
|
|
152
|
-
- drf-spectacular >= 0.26.0
|
|
153
|
-
- PyYAML >= 6.0
|
|
154
|
-
- MkDocs >= 1.4.0
|
|
155
|
-
- MkDocs Material >= 9.0.0
|
|
156
|
-
- coreapi >= 2.3.0
|
|
157
|
-
|
|
158
|
-
## Development
|
|
159
|
-
|
|
160
|
-
### Setup Development Environment
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
git clone https://github.com/yourusername/drf-to-mkdoc.git
|
|
164
|
-
cd drf-to-mkdoc
|
|
165
|
-
pip install -e ".[dev]"
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
## Project Structure
|
|
169
|
-
|
|
170
|
-
```
|
|
171
|
-
drf-to-mkdoc/
|
|
172
|
-
├── drf_to_mkdoc/
|
|
173
|
-
│ ├── conf/
|
|
174
|
-
│ │ ├── defaults.py # Default configuration values
|
|
175
|
-
│ │ └── settings.py # Settings management
|
|
176
|
-
│ ├── management/
|
|
177
|
-
│ │ └── commands/
|
|
178
|
-
│ │ ├── build_docs.py # Build MkDocs site
|
|
179
|
-
│ │ ├── generate_docs.py # Main documentation generator
|
|
180
|
-
│ │ ├── generate_model_docs.py # Model documentation
|
|
181
|
-
│ │ └── update_doc_schema.py # Schema updates
|
|
182
|
-
│ └── utils/
|
|
183
|
-
│ ├── common.py # Shared utilities
|
|
184
|
-
│ ├── endpoint_generator.py # Endpoint documentation
|
|
185
|
-
│ ├── model_generator.py # Model documentation
|
|
186
|
-
│ └── extractors/ # Query parameter extraction
|
|
187
|
-
├── pyproject.toml # Project configuration
|
|
188
|
-
└── README.md
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## License
|
|
192
|
-
|
|
193
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
194
|
-
|
|
195
|
-
## Recommendations
|
|
196
|
-
|
|
197
|
-
### .gitignore Configuration
|
|
198
|
-
|
|
199
|
-
To avoid committing generated files to your repository, add the following to your `.gitignore` file:
|
|
200
|
-
|
|
201
|
-
```gitignore
|
|
202
|
-
# Documentation
|
|
203
|
-
/docs/endpoints/
|
|
204
|
-
/docs/models/
|
|
205
|
-
/docs/configs/doc-schema.yaml
|
|
206
|
-
|
|
207
|
-
# Build artifacts
|
|
208
|
-
/site/
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
This will ensure that only the source configuration and scripts are versioned, while the generated documentation is excluded.
|
|
212
|
-
|
|
213
|
-
### docs_settings.py Best Practices
|
|
214
|
-
|
|
215
|
-
Create a separate `docs_settings.py` file that inherits from your main settings:
|
|
216
|
-
|
|
217
|
-
```python
|
|
218
|
-
# docs_settings.py
|
|
219
|
-
from .settings import *
|
|
220
|
-
|
|
221
|
-
DRF_TO_MKDOC = {
|
|
222
|
-
'DJANGO_APPS': ['your_app1', 'your_app2'],
|
|
223
|
-
}
|
|
224
|
-
# Other doc settings...
|
|
225
|
-
```
|
|
226
|
-
|
|
227
|
-
Then use the `--settings` argument when running the build command:
|
|
228
|
-
|
|
229
|
-
```bash
|
|
230
|
-
python manage.py build_docs --settings=docs_settings
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Project Organization
|
|
234
|
-
|
|
235
|
-
```
|
|
236
|
-
your-project/
|
|
237
|
-
├── settings.py # Main Django settings
|
|
238
|
-
├── docs_settings.py # Documentation-specific settings
|
|
239
|
-
├── mkdocs.yml # MkDocs configuration
|
|
240
|
-
├── docs/ # Generated documentation (gitignored)
|
|
241
|
-
└── site/ # Built site (gitignored)
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
## Contributing
|
|
245
|
-
|
|
246
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
247
|
-
This will ensure that only the source configuration and scripts are versioned, while the generated documentation is excluded.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: drf-to-mkdoc
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Generate Markdown API docs from Django/DRF OpenAPI schema for MkDocs
|
|
5
|
+
Author-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
6
|
+
Maintainer-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://github.com/yourusername/drf-to-mkdoc
|
|
9
|
+
Project-URL: Repository, https://github.com/yourusername/drf-to-mkdoc
|
|
10
|
+
Project-URL: Documentation, https://github.com/yourusername/drf-to-mkdoc#readme
|
|
11
|
+
Project-URL: Bug Tracker, https://github.com/yourusername/drf-to-mkdoc/issues
|
|
12
|
+
Keywords: django,django-rest-framework,documentation,mkdocs,api
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Framework :: Django
|
|
24
|
+
Classifier: Framework :: Django :: 3.2
|
|
25
|
+
Classifier: Framework :: Django :: 4.0
|
|
26
|
+
Classifier: Framework :: Django :: 4.1
|
|
27
|
+
Classifier: Framework :: Django :: 4.2
|
|
28
|
+
Classifier: Framework :: Django :: 5.0
|
|
29
|
+
Classifier: Topic :: Documentation
|
|
30
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
31
|
+
Requires-Python: >=3.8
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
Requires-Dist: Django<6.0,>=3.2
|
|
35
|
+
Requires-Dist: djangorestframework<4.0,>=3.12
|
|
36
|
+
Requires-Dist: PyYAML>=6.0
|
|
37
|
+
Requires-Dist: drf-spectacular>=0.26.0
|
|
38
|
+
Requires-Dist: mkdocs>=1.4.0
|
|
39
|
+
Requires-Dist: mkdocs-material>=9.0.0
|
|
40
|
+
Requires-Dist: coreapi>=2.3.0
|
|
41
|
+
Provides-Extra: dev
|
|
42
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
43
|
+
Requires-Dist: pytest-django>=4.5.0; extra == "dev"
|
|
44
|
+
Requires-Dist: black>=22.0.0; extra == "dev"
|
|
45
|
+
Requires-Dist: isort>=5.10.0; extra == "dev"
|
|
46
|
+
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
|
47
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
48
|
+
Dynamic: license-file
|
|
49
|
+
|
|
50
|
+
# DRF to MkDocs
|
|
51
|
+
|
|
52
|
+
Generate beautiful, interactive Markdown API documentation from Django REST Framework OpenAPI schema for MkDocs.
|
|
53
|
+
|
|
54
|
+
## Why you'll love it
|
|
55
|
+
|
|
56
|
+
- **Zero-hassle docs**: Beautiful, always-in-sync API docs straight from your codebase
|
|
57
|
+
- **Model deep dive**: Auto-generated model pages with fields, relationships, and choices
|
|
58
|
+
- **Lightning-fast discovery**: Interactive endpoint index with powerful filters and search
|
|
59
|
+
- **DRF-native**: Works with DRF Spectacular; no custom schema wiring needed
|
|
60
|
+
- **MkDocs Material**: Looks great out of the box with the Material theme
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
See the full installation guide in `docs/installation.md`.
|
|
65
|
+
|
|
66
|
+
## Quick Start
|
|
67
|
+
|
|
68
|
+
1. **Configure your Django project**:
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
# settings.py
|
|
72
|
+
INSTALLED_APPS = [
|
|
73
|
+
# ... your other apps
|
|
74
|
+
'drf_to_mkdoc',
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# Required for OpenAPI schema generation
|
|
78
|
+
REST_FRAMEWORK = {
|
|
79
|
+
'DEFAULT_SCHEMA_CLASS': 'drf_spectacular.openapi.AutoSchema',
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
SPECTACULAR_SETTINGS = {
|
|
83
|
+
'TITLE': 'Your API',
|
|
84
|
+
'DESCRIPTION': 'Your API description',
|
|
85
|
+
'VERSION': '1.0.0',
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
DRF_TO_MKDOC = {
|
|
89
|
+
'DJANGO_APPS': [
|
|
90
|
+
'users',
|
|
91
|
+
'products',
|
|
92
|
+
'orders',
|
|
93
|
+
'inventory',
|
|
94
|
+
],
|
|
95
|
+
# Optional: Override default paths
|
|
96
|
+
# 'DOCS_DIR': 'docs',
|
|
97
|
+
# 'CONFIG_DIR': 'docs/configs',
|
|
98
|
+
# 'MODEL_DOCS_FILE': 'docs/model-docs.json',
|
|
99
|
+
# 'DOC_CONFIG_FILE': 'docs/configs/doc_config.json',
|
|
100
|
+
# 'CUSTOM_SCHEMA_FILE': 'docs/configs/custom_schema.json',
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
2. **Create MkDocs configuration**:
|
|
105
|
+
|
|
106
|
+
```yaml
|
|
107
|
+
# mkdocs.yml
|
|
108
|
+
site_name: Your API Documentation
|
|
109
|
+
theme:
|
|
110
|
+
name: material
|
|
111
|
+
features:
|
|
112
|
+
- navigation.tabs
|
|
113
|
+
- navigation.sections
|
|
114
|
+
- navigation.expand
|
|
115
|
+
- search.highlight
|
|
116
|
+
- search.share
|
|
117
|
+
|
|
118
|
+
plugins:
|
|
119
|
+
- search
|
|
120
|
+
|
|
121
|
+
nav:
|
|
122
|
+
- Home: index.md
|
|
123
|
+
- About: about.md
|
|
124
|
+
- Models: models/index.md
|
|
125
|
+
- API Endpoints: endpoints/index.md
|
|
126
|
+
- Pagination: pagination.md
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
3. **Build documentation**:
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
python manage.py build_docs --settings=docs_settings
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## What you get
|
|
136
|
+
|
|
137
|
+
See a detailed overview of generated files in `docs/structure.md` and a feature breakdown in `docs/features.md`.
|
|
138
|
+
|
|
139
|
+
## How it works
|
|
140
|
+
|
|
141
|
+
Under the hood, drf-to-mkdoc introspects your models and reads your DRF OpenAPI schema to generate clean, organized Markdown. Then MkDocs turns it into a polished static site. Always current, no manual updates.
|
|
142
|
+
|
|
143
|
+
## Explore more
|
|
144
|
+
|
|
145
|
+
- Customizing endpoint docs: `docs/customizing_endpoints.md`
|
|
146
|
+
- Serving docs through Django (with permissions): `docs/serving_mkdocs_with_django.md`
|
|
147
|
+
|
|
148
|
+
## Dependencies
|
|
149
|
+
|
|
150
|
+
- Django >= 3.2, < 6.0
|
|
151
|
+
- Django REST Framework >= 3.12, < 4.0
|
|
152
|
+
- drf-spectacular >= 0.26.0
|
|
153
|
+
- PyYAML >= 6.0
|
|
154
|
+
- MkDocs >= 1.4.0
|
|
155
|
+
- MkDocs Material >= 9.0.0
|
|
156
|
+
- coreapi >= 2.3.0
|
|
157
|
+
|
|
158
|
+
## Development
|
|
159
|
+
|
|
160
|
+
### Setup Development Environment
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
git clone https://github.com/yourusername/drf-to-mkdoc.git
|
|
164
|
+
cd drf-to-mkdoc
|
|
165
|
+
pip install -e ".[dev]"
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## Project Structure
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
drf-to-mkdoc/
|
|
172
|
+
├── drf_to_mkdoc/
|
|
173
|
+
│ ├── conf/
|
|
174
|
+
│ │ ├── defaults.py # Default configuration values
|
|
175
|
+
│ │ └── settings.py # Settings management
|
|
176
|
+
│ ├── management/
|
|
177
|
+
│ │ └── commands/
|
|
178
|
+
│ │ ├── build_docs.py # Build MkDocs site
|
|
179
|
+
│ │ ├── generate_docs.py # Main documentation generator
|
|
180
|
+
│ │ ├── generate_model_docs.py # Model documentation
|
|
181
|
+
│ │ └── update_doc_schema.py # Schema updates
|
|
182
|
+
│ └── utils/
|
|
183
|
+
│ ├── common.py # Shared utilities
|
|
184
|
+
│ ├── endpoint_generator.py # Endpoint documentation
|
|
185
|
+
│ ├── model_generator.py # Model documentation
|
|
186
|
+
│ └── extractors/ # Query parameter extraction
|
|
187
|
+
├── pyproject.toml # Project configuration
|
|
188
|
+
└── README.md
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
## License
|
|
192
|
+
|
|
193
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
194
|
+
|
|
195
|
+
## Recommendations
|
|
196
|
+
|
|
197
|
+
### .gitignore Configuration
|
|
198
|
+
|
|
199
|
+
To avoid committing generated files to your repository, add the following to your `.gitignore` file:
|
|
200
|
+
|
|
201
|
+
```gitignore
|
|
202
|
+
# Documentation
|
|
203
|
+
/docs/endpoints/
|
|
204
|
+
/docs/models/
|
|
205
|
+
/docs/configs/doc-schema.yaml
|
|
206
|
+
|
|
207
|
+
# Build artifacts
|
|
208
|
+
/site/
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
This will ensure that only the source configuration and scripts are versioned, while the generated documentation is excluded.
|
|
212
|
+
|
|
213
|
+
### docs_settings.py Best Practices
|
|
214
|
+
|
|
215
|
+
Create a separate `docs_settings.py` file that inherits from your main settings:
|
|
216
|
+
|
|
217
|
+
```python
|
|
218
|
+
# docs_settings.py
|
|
219
|
+
from .settings import *
|
|
220
|
+
|
|
221
|
+
DRF_TO_MKDOC = {
|
|
222
|
+
'DJANGO_APPS': ['your_app1', 'your_app2'],
|
|
223
|
+
}
|
|
224
|
+
# Other doc settings...
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Then use the `--settings` argument when running the build command:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
python manage.py build_docs --settings=docs_settings
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Project Organization
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
your-project/
|
|
237
|
+
├── settings.py # Main Django settings
|
|
238
|
+
├── docs_settings.py # Documentation-specific settings
|
|
239
|
+
├── mkdocs.yml # MkDocs configuration
|
|
240
|
+
├── docs/ # Generated documentation (gitignored)
|
|
241
|
+
└── site/ # Built site (gitignored)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Contributing
|
|
245
|
+
|
|
246
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
247
|
+
This will ensure that only the source configuration and scripts are versioned, while the generated documentation is excluded.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
drf_to_mkdoc/__init__.py,sha256=j7qOxIbkDy7oit4Tb3NZUqbqkrxKz07PeN9QuF3Qp9s,179
|
|
2
|
+
drf_to_mkdoc/apps.py,sha256=0TLecPHZ8vf0IhAVFh1oIIHQbhx5lVto7qrvStx3R1Y,464
|
|
3
|
+
drf_to_mkdoc/conf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
drf_to_mkdoc/conf/defaults.py,sha256=9OK65SeP4aLZbuRJBAE_QeC-OhXkh0cACBqax6wYXnM,576
|
|
5
|
+
drf_to_mkdoc/conf/settings.py,sha256=OgB3MCn4Z5F4xqWP34kwzMs50kRn3qF0gE1zS2SHS2M,1550
|
|
6
|
+
drf_to_mkdoc/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
drf_to_mkdoc/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
+
drf_to_mkdoc/management/commands/build_docs.py,sha256=nt4Rv6lJ3MojCVOAmrLboIoZK06dMiq6RtHVW0Het84,2928
|
|
9
|
+
drf_to_mkdoc/management/commands/generate_doc_json.py,sha256=mWdYgMbSeLP4iQZeUm2DxwYQmdGy8w05XTEfbT_nOJo,19833
|
|
10
|
+
drf_to_mkdoc/management/commands/generate_docs.py,sha256=YGdejd-b1Wn_e5ru9orwp1b9H5PZwVWkuWxAY1JyG88,4897
|
|
11
|
+
drf_to_mkdoc/management/commands/generate_model_docs.py,sha256=tdT9Z0qjZ9KgGAbFfYWBo-FtDI8wTQ2zRA_OvKKnyaA,12195
|
|
12
|
+
drf_to_mkdoc/management/commands/update_doc_schema.py,sha256=TtHVQxnVpB_VELRkVcdsDXDU5zXdguFleB1mXCDMAbg,2009
|
|
13
|
+
drf_to_mkdoc/utils/__init__.py,sha256=6dFTb07S6yIf-INMy0Mlgf5purNir687ZU9WZtITh4k,68
|
|
14
|
+
drf_to_mkdoc/utils/common.py,sha256=4zh2cZkHDutanz18RS-Fud45TH0p8x2H06XrpKs2a0w,9576
|
|
15
|
+
drf_to_mkdoc/utils/endpoint_generator.py,sha256=oGHQXJB5VFlGOq6W8a3q96CwF3conjBe_tkYj6m2mlg,35849
|
|
16
|
+
drf_to_mkdoc/utils/model_generator.py,sha256=O1ibaw7KmL_fQ1OTebuk6Tt2yTjyElpyF7bN8gk5LBE,9588
|
|
17
|
+
drf_to_mkdoc/utils/extractors/__init__.py,sha256=BvC8gKOPVI9gU1Piw0jRhKQ2ER5s1moAxgq7ZYkJWNI,86
|
|
18
|
+
drf_to_mkdoc/utils/extractors/query_parameter_extractors.py,sha256=e7WW0MeLUfBAfksEKFxowDjz9uUvit_EDxYASfnbdc4,8400
|
|
19
|
+
drf_to_mkdoc/utils/md_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
+
drf_to_mkdoc/utils/md_generators/query_parameters_generators.py,sha256=N-XqZ_FUODSR5V4xM9oEA3aaIiNGNmNwpvrWbQTx6RI,2566
|
|
21
|
+
drf_to_mkdoc-0.1.2.dist-info/licenses/LICENSE,sha256=3n9_ckIREsH8ogCxWW6dFsw_WfGcluG2mHcgl9i_UU0,1068
|
|
22
|
+
drf_to_mkdoc-0.1.2.dist-info/METADATA,sha256=VmXVkbTTXrAmDcdUKWSR0eRY4ucBjPolYGpyi8FDVFg,7309
|
|
23
|
+
drf_to_mkdoc-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
drf_to_mkdoc-0.1.2.dist-info/top_level.txt,sha256=ZzJecR6j_tvLZiubUBEgawHflozC4DQy9ooNf1yDJ3Q,13
|
|
25
|
+
drf_to_mkdoc-0.1.2.dist-info/RECORD,,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 ShayestehHs
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
|
13
|
-
all copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
21
|
-
IN THE SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ShayestehHs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
21
|
+
IN THE SOFTWARE.
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
drf_to_mkdoc/__init__.py,sha256=xOrwYl9xIJ2RsB1fuS2Fdo9ZdHH7bhK-HvrVZRjGfFQ,185
|
|
2
|
-
drf_to_mkdoc/apps.py,sha256=jY62LHTRAAMiQCmdbsn3bQKJjV7qPeKAng4JOWd9IVI,478
|
|
3
|
-
drf_to_mkdoc/conf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
drf_to_mkdoc/conf/defaults.py,sha256=9OK65SeP4aLZbuRJBAE_QeC-OhXkh0cACBqax6wYXnM,576
|
|
5
|
-
drf_to_mkdoc/conf/settings.py,sha256=NMI_TA90CKWCi4NX1maxPj90hefY8s2FMAPt-A7tE3w,1594
|
|
6
|
-
drf_to_mkdoc/management/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
drf_to_mkdoc/management/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
drf_to_mkdoc/management/commands/build_docs.py,sha256=laDZGd8w1yVNXmAGWaqOn1F2cEI2yL2DoiZ1Wj3bPFQ,3004
|
|
9
|
-
drf_to_mkdoc/management/commands/generate_doc_json.py,sha256=A7wiKEJQLp1WuVci2z29v0yjlf6zzO6wQItzyH83mY8,20345
|
|
10
|
-
drf_to_mkdoc/management/commands/generate_docs.py,sha256=byO7LH6KXbh-aKBvIggMSgqAS37d_QiMOVeLUi5pTys,5035
|
|
11
|
-
drf_to_mkdoc/management/commands/generate_model_docs.py,sha256=1bE2YTEYd92mGWHqAoVCTFzOGp4O-6xHO0JJ0L015Qw,12522
|
|
12
|
-
drf_to_mkdoc/management/commands/update_doc_schema.py,sha256=zpNTEsFeA4Im9A1HCS_CrK2bm_jIIl9mKw6K5F4il7s,2062
|
|
13
|
-
drf_to_mkdoc/utils/__init__.py,sha256=7GUxM5TU7syclJnZ6UvGwsb6FpmECi8G9bZNYHVuaQc,71
|
|
14
|
-
drf_to_mkdoc/utils/common.py,sha256=4zh2cZkHDutanz18RS-Fud45TH0p8x2H06XrpKs2a0w,9576
|
|
15
|
-
drf_to_mkdoc/utils/endpoint_generator.py,sha256=TUqf1u6TqzPX6K6RJ2jx9GJKF1copHDQemenPnxfSZE,36794
|
|
16
|
-
drf_to_mkdoc/utils/model_generator.py,sha256=ddy6GG_jmGtewRh_zIaBQ9rP7up-qjJVPj_IXlKeKfw,9857
|
|
17
|
-
drf_to_mkdoc/utils/extractors/__init__.py,sha256=8HWUAGn8mkaFtg9H-x0XCN09LTZ5Rr_WrEwWn9xGZ4s,89
|
|
18
|
-
drf_to_mkdoc/utils/extractors/query_parameter_extractors.py,sha256=ajPOyHMhMxrFeCASP2FVRJ30geUZFyk-AQv_JpSJneE,8629
|
|
19
|
-
drf_to_mkdoc/utils/md_generators/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
drf_to_mkdoc/utils/md_generators/query_parameters_generators.py,sha256=TYgkSlSdSVaqGiiPC1PdhZWPnkgv2u88363y8PXNO8s,2638
|
|
21
|
-
drf_to_mkdoc-0.1.0.dist-info/licenses/LICENSE,sha256=JolRMjhceiI-XEflCQNdUdBOuoPm9Ru4BcshXLsfsQc,1089
|
|
22
|
-
drf_to_mkdoc-0.1.0.dist-info/METADATA,sha256=brHmXtW2MPXUkdzpYqlR5cRQ1G322sPm7HfI6Tn6GSU,7524
|
|
23
|
-
drf_to_mkdoc-0.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
-
drf_to_mkdoc-0.1.0.dist-info/top_level.txt,sha256=ZzJecR6j_tvLZiubUBEgawHflozC4DQy9ooNf1yDJ3Q,13
|
|
25
|
-
drf_to_mkdoc-0.1.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|