drf-to-mkdoc 0.2.3__tar.gz → 0.3.0__tar.gz
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-0.2.3 → drf_to_mkdoc-0.3.0}/PKG-INFO +89 -10
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/README.md +88 -9
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/docs/customizing_endpoints.md +31 -1
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/docs/mkdocs.yml +1 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/conf/defaults.py +1 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/conf/settings.py +1 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/build_model_docs.py +10 -1
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/field-sections-loader.js +29 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/query-parameters-loader.js +16 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/field-extractor.js +200 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/form-manager.js +465 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/main.js +50 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/modal.js +359 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/query-parameters-extractor.js +94 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/request-executor.js +327 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/response-modal.js +173 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/suggestions.js +123 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/tabs.js +77 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/badges.css +13 -5
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/theme-toggle.css +314 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/try-out/fab.css +204 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/try-out/response.css +323 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/try-out/variables.css +139 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/field-sections.css +136 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/form.css +663 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/modal.css +334 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/response.css +618 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/tabs.css +114 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/variables.css +94 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/detail/request_body.html +2 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/er_diagrams/app.html +26 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/er_diagrams/index.html +14 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/er_diagrams/main.html +22 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/try-out/fab.html +68 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/try-out/form.html +260 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/try-out/modal.html +82 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/templates/try-out/response-modal.html +149 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/endpoint_detail_generator.py +1 -0
- drf_to_mkdoc-0.3.0/drf_to_mkdoc/utils/er_diagram_generator.py +230 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc.egg-info/PKG-INFO +89 -10
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc.egg-info/SOURCES.txt +13 -0
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/form-manager.js +0 -172
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/main.js +0 -22
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/modal.js +0 -79
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/request-executor.js +0 -111
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/suggestions.js +0 -216
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/try-out/tabs.js +0 -34
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/theme-toggle.css +0 -42
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/form.css +0 -124
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/modal.css +0 -112
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/response.css +0 -158
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/tabs.css +0 -62
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/variables.css +0 -38
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/templates/try-out/fab.html +0 -4
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/templates/try-out/form.html +0 -113
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/templates/try-out/modal.html +0 -14
- drf_to_mkdoc-0.2.3/drf_to_mkdoc/templates/try-out/response-modal.html +0 -20
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/.github/workflows/publish.yaml +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/.pre-commit-config.yaml +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/CONTRIBUTING.md +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/LICENSE +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/MANIFEST.in +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/conf/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/conf/defaults.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/conf/settings.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/docs/serving_mkdocs_with_django.md +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/apps.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/conf/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/build_docs.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/build_endpoint_docs.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/extract_model_data.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/generate_doc_json.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/update_doc_schema.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/javascripts/endpoints-filter.js +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/accessibility.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/animations.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/base.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/endpoint-content.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/endpoints-grid.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/filter-section.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/fixes.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/layout.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/loading.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/responsive.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/sections.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/stats.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/tags.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/endpoints/variables.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/animations.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/base.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/model-cards.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/model-tables.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/responsive.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/models/variables.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/buttons.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/fab.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/key-value.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/static/drf-to-mkdoc/stylesheets/try-out/main.css +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/detail/base.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/detail/path_parameters.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/detail/query_parameters.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/detail/responses.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/base.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/endpoint_card.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/filter_section.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/filters/app.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/filters/method.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/filters/path.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/endpoints/list/filters/search.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/model_detail/base.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/model_detail/choices.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/model_detail/fields.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/model_detail/meta.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/model_detail/methods.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/model_detail/relationships.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/models_index.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templates/try-out/main.html +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/templatetags/custom_filters.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/enums.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/exceptions.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/providers/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/providers/base_provider.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/providers/gemini_provider.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/ai_tools/types.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/code_extractor.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/file_utils.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/model_utils.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/operation_utils.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/path_utils.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/commons/schema_utils.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/endpoint_list_generator.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/extractors/__init__.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/extractors/query_parameter_extractors.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/model_detail_generator.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/model_list_generator.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/utils/schema.py +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc.egg-info/dependency_links.txt +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc.egg-info/requires.txt +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc.egg-info/top_level.txt +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/pyproject.toml +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/setup.cfg +0 -0
- {drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: drf-to-mkdoc
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Generate Markdown API docs from Django/DRF OpenAPI schema for MkDocs
|
|
5
5
|
Author-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
6
6
|
Maintainer-email: Hossein Shayesteh <shayestehhs1@gmail.com>
|
|
@@ -55,7 +55,10 @@ Generate beautiful, interactive Markdown API documentation from Django REST Fram
|
|
|
55
55
|
|
|
56
56
|
- **Zero-hassle docs**: Beautiful, always-in-sync API docs straight from your codebase
|
|
57
57
|
- **Model deep dive**: Auto-generated model pages with fields, relationships, and choices
|
|
58
|
+
- **ER Diagrams**: Entity-Relationship diagrams showing model relationships
|
|
58
59
|
- **Lightning-fast discovery**: Interactive endpoint index with powerful filters and search
|
|
60
|
+
- **Try-it-out**: Interactive API testing directly in the documentation with request/response examples
|
|
61
|
+
- **AI-powered**: Optional AI-generated documentation with custom field generators(Wait for it...)
|
|
59
62
|
- **DRF-native**: Works with DRF Spectacular; no custom schema wiring needed
|
|
60
63
|
- **MkDocs Material**: Looks great out of the box with the Material theme
|
|
61
64
|
|
|
@@ -76,7 +79,7 @@ INSTALLED_APPS = [
|
|
|
76
79
|
|
|
77
80
|
# Required for OpenAPI schema generation
|
|
78
81
|
REST_FRAMEWORK = {
|
|
79
|
-
'DEFAULT_SCHEMA_CLASS': 'drf_to_mkdoc.utils.schema.AutoSchema',
|
|
82
|
+
'DEFAULT_SCHEMA_CLASS': 'drf_to_mkdoc.utils.schema.AutoSchema',
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
SPECTACULAR_SETTINGS = {
|
|
@@ -94,16 +97,25 @@ DRF_TO_MKDOC = {
|
|
|
94
97
|
'inventory',
|
|
95
98
|
],
|
|
96
99
|
# Optional: Override default paths
|
|
97
|
-
# 'DOCS_DIR': 'docs',
|
|
100
|
+
# 'DOCS_DIR': 'docs', # Base directory for all generated docs
|
|
98
101
|
# 'CONFIG_DIR': 'docs/configs',
|
|
102
|
+
# 'ER_DIAGRAMS_DIR': 'er_diagrams', # Directory for ER diagrams (relative to DOCS_DIR)
|
|
99
103
|
# 'MODEL_DOCS_FILE': 'docs/model-docs.json',
|
|
100
104
|
# 'DOC_CONFIG_FILE': 'docs/configs/doc_config.json',
|
|
101
105
|
# 'CUSTOM_SCHEMA_FILE': 'docs/configs/custom_schema.json',
|
|
106
|
+
# 'FIELD_GENERATORS': {
|
|
107
|
+
# 'email': 'faker.email',
|
|
108
|
+
# 'name': 'faker.name',
|
|
109
|
+
# 'created_at': 'datetime.now',
|
|
110
|
+
# },
|
|
111
|
+
# 'ENABLE_AI_DOCS': False,
|
|
102
112
|
}
|
|
103
113
|
```
|
|
104
114
|
|
|
105
115
|
2. **Create MkDocs configuration**:
|
|
106
116
|
Copy the [`docs/mkdocs.yml`](docs/mkdocs.yml) file to your project root and customize it as needed.
|
|
117
|
+
|
|
118
|
+
**Note**: If you change the `ER_DIAGRAMS_DIR` setting, update the navigation path in `mkdocs.yml` accordingly.
|
|
107
119
|
|
|
108
120
|
3. **Build documentation**:
|
|
109
121
|
|
|
@@ -111,18 +123,61 @@ DRF_TO_MKDOC = {
|
|
|
111
123
|
python manage.py build_docs --settings=docs_settings
|
|
112
124
|
```
|
|
113
125
|
|
|
126
|
+
### Configuration Options
|
|
127
|
+
|
|
128
|
+
The `DRF_TO_MKDOC` setting supports several configuration options:
|
|
129
|
+
|
|
130
|
+
- **`DJANGO_APPS`** (required): List of Django app names to process
|
|
131
|
+
- **`DOCS_DIR`**: Base directory where docs will be generated (default: `docs`)
|
|
132
|
+
- **`CONFIG_DIR`**: Directory for configuration files (default: `docs/configs`)
|
|
133
|
+
- **`ER_DIAGRAMS_DIR`**: Directory for ER diagrams (default: `er_diagrams`, relative to `DOCS_DIR`)
|
|
134
|
+
- **`FIELD_GENERATORS`**: Custom field value generators for better examples
|
|
135
|
+
- **`ENABLE_AI_DOCS`**: Enable AI-powered documentation features (default: `False`)
|
|
136
|
+
- **`PATH_PARAM_SUBSTITUTE_FUNCTION`**: Custom function for path parameter substitution
|
|
137
|
+
- **`PATH_PARAM_SUBSTITUTE_MAPPING`**: Mapping for path parameter substitution
|
|
138
|
+
|
|
114
139
|
## Available Commands
|
|
115
140
|
|
|
116
141
|
- `build_docs`: Build the complete documentation site with MkDocs
|
|
117
142
|
- `build_endpoint_docs`: Build endpoint documentation from OpenAPI schema
|
|
118
143
|
- `build_model_docs`: Build model documentation from model JSON data
|
|
119
144
|
- `extract_model_data`: Extract model data from Django model introspection and save as JSON
|
|
145
|
+
- `generate_doc_json`: Generate JSON context for new API endpoints to be documented
|
|
120
146
|
- `update_doc_schema`: Update the final schema by copying the documented schema
|
|
121
147
|
|
|
122
148
|
## What you get
|
|
123
149
|
|
|
124
150
|
See a detailed overview of generated files in `docs/structure.md` and a feature breakdown in `docs/features.md`.
|
|
125
151
|
|
|
152
|
+
## Key Features
|
|
153
|
+
|
|
154
|
+
### 🚀 Interactive API Testing (Try-Out)
|
|
155
|
+
- **Live API testing**: Test endpoints directly from the documentation
|
|
156
|
+
- **Request builder**: Interactive forms for parameters, headers, and request body
|
|
157
|
+
- **Response viewer**: Real-time response display with syntax highlighting
|
|
158
|
+
- **Floating action button**: Easy access to testing interface
|
|
159
|
+
- **Multiple examples**: Support for both empty and populated response examples
|
|
160
|
+
|
|
161
|
+
### 📊 Entity-Relationship Diagrams
|
|
162
|
+
- **Visual model relationships**: Interactive ER diagrams showing all model connections
|
|
163
|
+
- **App-specific views**: Detailed diagrams for each Django app with field information
|
|
164
|
+
- **Mermaid-powered**: Clean, professional diagrams with zoom and navigation controls
|
|
165
|
+
- **Auto-generated**: Automatically created from your Django model relationships
|
|
166
|
+
|
|
167
|
+
### 🤖 AI-Powered Documentation
|
|
168
|
+
- **Custom field generators**: Define custom value generators for specific fields
|
|
169
|
+
- **AI documentation**: Optional AI-generated documentation with context analysis
|
|
170
|
+
- **Smart examples**: Enhanced example generation for better API understanding
|
|
171
|
+
|
|
172
|
+
### 📊 Advanced Filtering & Search
|
|
173
|
+
- **Multi-criteria filtering**: Filter by app, HTTP method, path, and search terms
|
|
174
|
+
- **Real-time search**: Instant search across all endpoints
|
|
175
|
+
- **Smart suggestions**: Auto-complete for query parameters and field names
|
|
176
|
+
|
|
177
|
+
### 🎨 Beautiful UI
|
|
178
|
+
- **Material Design**: Modern, responsive interface with dark/light themes
|
|
179
|
+
- **Interactive elements**: Hover effects, animations, and smooth transitions
|
|
180
|
+
- **Mobile-friendly**: Fully responsive design for all devices
|
|
126
181
|
|
|
127
182
|
## How it works
|
|
128
183
|
|
|
@@ -167,13 +222,33 @@ drf-to-mkdoc/
|
|
|
167
222
|
│ │ ├── build_endpoint_docs.py # Build endpoint documentation
|
|
168
223
|
│ │ ├── build_model_docs.py # Build model documentation
|
|
169
224
|
│ │ ├── extract_model_data.py # Extract model data from Django
|
|
225
|
+
│ │ ├── generate_doc_json.py # Generate JSON context for AI docs
|
|
170
226
|
│ │ └── update_doc_schema.py # Schema updates
|
|
227
|
+
│ ├── static/
|
|
228
|
+
│ │ └── drf-to-mkdoc/
|
|
229
|
+
│ │ ├── javascripts/
|
|
230
|
+
│ │ │ ├── try-out/ # Interactive API testing
|
|
231
|
+
│ │ │ └── endpoints-filter.js # Endpoint filtering
|
|
232
|
+
│ │ └── stylesheets/ # CSS for styling
|
|
233
|
+
│ ├── templates/
|
|
234
|
+
│ │ ├── endpoints/ # Endpoint documentation templates
|
|
235
|
+
│ │ ├── model_detail/ # Model documentation templates
|
|
236
|
+
│ │ └── try-out/ # Interactive testing templates
|
|
171
237
|
│ └── utils/
|
|
172
|
-
│ ├──
|
|
173
|
-
│ ├──
|
|
174
|
-
│ ├──
|
|
175
|
-
│
|
|
176
|
-
├──
|
|
238
|
+
│ ├── ai_tools/ # AI-powered documentation features
|
|
239
|
+
│ ├── commons/ # Shared utilities
|
|
240
|
+
│ ├── extractors/ # Query parameter extraction
|
|
241
|
+
│ ├── endpoint_detail_generator.py
|
|
242
|
+
│ ├── endpoint_list_generator.py
|
|
243
|
+
│ ├── model_detail_generator.py
|
|
244
|
+
│ ├── model_list_generator.py
|
|
245
|
+
│ └── schema.py
|
|
246
|
+
├── docs/ # Generated documentation
|
|
247
|
+
│ ├── endpoints/ # API endpoint documentation
|
|
248
|
+
│ ├── models/ # Model documentation
|
|
249
|
+
│ ├── er_diagrams/ # Entity-Relationship diagrams
|
|
250
|
+
│ └── configs/ # Configuration files
|
|
251
|
+
├── pyproject.toml # Project configuration
|
|
177
252
|
└── README.md
|
|
178
253
|
```
|
|
179
254
|
|
|
@@ -191,6 +266,7 @@ To avoid committing generated files to your repository, add the following to you
|
|
|
191
266
|
# Documentation
|
|
192
267
|
/docs/endpoints/
|
|
193
268
|
/docs/models/
|
|
269
|
+
/docs/er_diagrams/
|
|
194
270
|
/docs/configs/doc-schema.yaml
|
|
195
271
|
|
|
196
272
|
# Build artifacts
|
|
@@ -227,10 +303,13 @@ your-project/
|
|
|
227
303
|
├── docs_settings.py # Documentation-specific settings
|
|
228
304
|
├── mkdocs.yml # MkDocs configuration
|
|
229
305
|
├── docs/ # Generated documentation (gitignored)
|
|
306
|
+
│ ├── endpoints/ # API endpoint docs
|
|
307
|
+
│ ├── models/ # Model documentation
|
|
308
|
+
│ ├── er_diagrams/ # ER diagrams
|
|
309
|
+
│ └── configs/ # Configuration files
|
|
230
310
|
└── site/ # Built site (gitignored)
|
|
231
311
|
```
|
|
232
312
|
|
|
233
313
|
## Contributing
|
|
234
314
|
|
|
235
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
236
|
-
This will ensure that only the source configuration and scripts are versioned, while the generated documentation is excluded.
|
|
315
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
@@ -6,7 +6,10 @@ Generate beautiful, interactive Markdown API documentation from Django REST Fram
|
|
|
6
6
|
|
|
7
7
|
- **Zero-hassle docs**: Beautiful, always-in-sync API docs straight from your codebase
|
|
8
8
|
- **Model deep dive**: Auto-generated model pages with fields, relationships, and choices
|
|
9
|
+
- **ER Diagrams**: Entity-Relationship diagrams showing model relationships
|
|
9
10
|
- **Lightning-fast discovery**: Interactive endpoint index with powerful filters and search
|
|
11
|
+
- **Try-it-out**: Interactive API testing directly in the documentation with request/response examples
|
|
12
|
+
- **AI-powered**: Optional AI-generated documentation with custom field generators(Wait for it...)
|
|
10
13
|
- **DRF-native**: Works with DRF Spectacular; no custom schema wiring needed
|
|
11
14
|
- **MkDocs Material**: Looks great out of the box with the Material theme
|
|
12
15
|
|
|
@@ -27,7 +30,7 @@ INSTALLED_APPS = [
|
|
|
27
30
|
|
|
28
31
|
# Required for OpenAPI schema generation
|
|
29
32
|
REST_FRAMEWORK = {
|
|
30
|
-
'DEFAULT_SCHEMA_CLASS': 'drf_to_mkdoc.utils.schema.AutoSchema',
|
|
33
|
+
'DEFAULT_SCHEMA_CLASS': 'drf_to_mkdoc.utils.schema.AutoSchema',
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
SPECTACULAR_SETTINGS = {
|
|
@@ -45,16 +48,25 @@ DRF_TO_MKDOC = {
|
|
|
45
48
|
'inventory',
|
|
46
49
|
],
|
|
47
50
|
# Optional: Override default paths
|
|
48
|
-
# 'DOCS_DIR': 'docs',
|
|
51
|
+
# 'DOCS_DIR': 'docs', # Base directory for all generated docs
|
|
49
52
|
# 'CONFIG_DIR': 'docs/configs',
|
|
53
|
+
# 'ER_DIAGRAMS_DIR': 'er_diagrams', # Directory for ER diagrams (relative to DOCS_DIR)
|
|
50
54
|
# 'MODEL_DOCS_FILE': 'docs/model-docs.json',
|
|
51
55
|
# 'DOC_CONFIG_FILE': 'docs/configs/doc_config.json',
|
|
52
56
|
# 'CUSTOM_SCHEMA_FILE': 'docs/configs/custom_schema.json',
|
|
57
|
+
# 'FIELD_GENERATORS': {
|
|
58
|
+
# 'email': 'faker.email',
|
|
59
|
+
# 'name': 'faker.name',
|
|
60
|
+
# 'created_at': 'datetime.now',
|
|
61
|
+
# },
|
|
62
|
+
# 'ENABLE_AI_DOCS': False,
|
|
53
63
|
}
|
|
54
64
|
```
|
|
55
65
|
|
|
56
66
|
2. **Create MkDocs configuration**:
|
|
57
67
|
Copy the [`docs/mkdocs.yml`](docs/mkdocs.yml) file to your project root and customize it as needed.
|
|
68
|
+
|
|
69
|
+
**Note**: If you change the `ER_DIAGRAMS_DIR` setting, update the navigation path in `mkdocs.yml` accordingly.
|
|
58
70
|
|
|
59
71
|
3. **Build documentation**:
|
|
60
72
|
|
|
@@ -62,18 +74,61 @@ DRF_TO_MKDOC = {
|
|
|
62
74
|
python manage.py build_docs --settings=docs_settings
|
|
63
75
|
```
|
|
64
76
|
|
|
77
|
+
### Configuration Options
|
|
78
|
+
|
|
79
|
+
The `DRF_TO_MKDOC` setting supports several configuration options:
|
|
80
|
+
|
|
81
|
+
- **`DJANGO_APPS`** (required): List of Django app names to process
|
|
82
|
+
- **`DOCS_DIR`**: Base directory where docs will be generated (default: `docs`)
|
|
83
|
+
- **`CONFIG_DIR`**: Directory for configuration files (default: `docs/configs`)
|
|
84
|
+
- **`ER_DIAGRAMS_DIR`**: Directory for ER diagrams (default: `er_diagrams`, relative to `DOCS_DIR`)
|
|
85
|
+
- **`FIELD_GENERATORS`**: Custom field value generators for better examples
|
|
86
|
+
- **`ENABLE_AI_DOCS`**: Enable AI-powered documentation features (default: `False`)
|
|
87
|
+
- **`PATH_PARAM_SUBSTITUTE_FUNCTION`**: Custom function for path parameter substitution
|
|
88
|
+
- **`PATH_PARAM_SUBSTITUTE_MAPPING`**: Mapping for path parameter substitution
|
|
89
|
+
|
|
65
90
|
## Available Commands
|
|
66
91
|
|
|
67
92
|
- `build_docs`: Build the complete documentation site with MkDocs
|
|
68
93
|
- `build_endpoint_docs`: Build endpoint documentation from OpenAPI schema
|
|
69
94
|
- `build_model_docs`: Build model documentation from model JSON data
|
|
70
95
|
- `extract_model_data`: Extract model data from Django model introspection and save as JSON
|
|
96
|
+
- `generate_doc_json`: Generate JSON context for new API endpoints to be documented
|
|
71
97
|
- `update_doc_schema`: Update the final schema by copying the documented schema
|
|
72
98
|
|
|
73
99
|
## What you get
|
|
74
100
|
|
|
75
101
|
See a detailed overview of generated files in `docs/structure.md` and a feature breakdown in `docs/features.md`.
|
|
76
102
|
|
|
103
|
+
## Key Features
|
|
104
|
+
|
|
105
|
+
### 🚀 Interactive API Testing (Try-Out)
|
|
106
|
+
- **Live API testing**: Test endpoints directly from the documentation
|
|
107
|
+
- **Request builder**: Interactive forms for parameters, headers, and request body
|
|
108
|
+
- **Response viewer**: Real-time response display with syntax highlighting
|
|
109
|
+
- **Floating action button**: Easy access to testing interface
|
|
110
|
+
- **Multiple examples**: Support for both empty and populated response examples
|
|
111
|
+
|
|
112
|
+
### 📊 Entity-Relationship Diagrams
|
|
113
|
+
- **Visual model relationships**: Interactive ER diagrams showing all model connections
|
|
114
|
+
- **App-specific views**: Detailed diagrams for each Django app with field information
|
|
115
|
+
- **Mermaid-powered**: Clean, professional diagrams with zoom and navigation controls
|
|
116
|
+
- **Auto-generated**: Automatically created from your Django model relationships
|
|
117
|
+
|
|
118
|
+
### 🤖 AI-Powered Documentation
|
|
119
|
+
- **Custom field generators**: Define custom value generators for specific fields
|
|
120
|
+
- **AI documentation**: Optional AI-generated documentation with context analysis
|
|
121
|
+
- **Smart examples**: Enhanced example generation for better API understanding
|
|
122
|
+
|
|
123
|
+
### 📊 Advanced Filtering & Search
|
|
124
|
+
- **Multi-criteria filtering**: Filter by app, HTTP method, path, and search terms
|
|
125
|
+
- **Real-time search**: Instant search across all endpoints
|
|
126
|
+
- **Smart suggestions**: Auto-complete for query parameters and field names
|
|
127
|
+
|
|
128
|
+
### 🎨 Beautiful UI
|
|
129
|
+
- **Material Design**: Modern, responsive interface with dark/light themes
|
|
130
|
+
- **Interactive elements**: Hover effects, animations, and smooth transitions
|
|
131
|
+
- **Mobile-friendly**: Fully responsive design for all devices
|
|
77
132
|
|
|
78
133
|
## How it works
|
|
79
134
|
|
|
@@ -118,13 +173,33 @@ drf-to-mkdoc/
|
|
|
118
173
|
│ │ ├── build_endpoint_docs.py # Build endpoint documentation
|
|
119
174
|
│ │ ├── build_model_docs.py # Build model documentation
|
|
120
175
|
│ │ ├── extract_model_data.py # Extract model data from Django
|
|
176
|
+
│ │ ├── generate_doc_json.py # Generate JSON context for AI docs
|
|
121
177
|
│ │ └── update_doc_schema.py # Schema updates
|
|
178
|
+
│ ├── static/
|
|
179
|
+
│ │ └── drf-to-mkdoc/
|
|
180
|
+
│ │ ├── javascripts/
|
|
181
|
+
│ │ │ ├── try-out/ # Interactive API testing
|
|
182
|
+
│ │ │ └── endpoints-filter.js # Endpoint filtering
|
|
183
|
+
│ │ └── stylesheets/ # CSS for styling
|
|
184
|
+
│ ├── templates/
|
|
185
|
+
│ │ ├── endpoints/ # Endpoint documentation templates
|
|
186
|
+
│ │ ├── model_detail/ # Model documentation templates
|
|
187
|
+
│ │ └── try-out/ # Interactive testing templates
|
|
122
188
|
│ └── utils/
|
|
123
|
-
│ ├──
|
|
124
|
-
│ ├──
|
|
125
|
-
│ ├──
|
|
126
|
-
│
|
|
127
|
-
├──
|
|
189
|
+
│ ├── ai_tools/ # AI-powered documentation features
|
|
190
|
+
│ ├── commons/ # Shared utilities
|
|
191
|
+
│ ├── extractors/ # Query parameter extraction
|
|
192
|
+
│ ├── endpoint_detail_generator.py
|
|
193
|
+
│ ├── endpoint_list_generator.py
|
|
194
|
+
│ ├── model_detail_generator.py
|
|
195
|
+
│ ├── model_list_generator.py
|
|
196
|
+
│ └── schema.py
|
|
197
|
+
├── docs/ # Generated documentation
|
|
198
|
+
│ ├── endpoints/ # API endpoint documentation
|
|
199
|
+
│ ├── models/ # Model documentation
|
|
200
|
+
│ ├── er_diagrams/ # Entity-Relationship diagrams
|
|
201
|
+
│ └── configs/ # Configuration files
|
|
202
|
+
├── pyproject.toml # Project configuration
|
|
128
203
|
└── README.md
|
|
129
204
|
```
|
|
130
205
|
|
|
@@ -142,6 +217,7 @@ To avoid committing generated files to your repository, add the following to you
|
|
|
142
217
|
# Documentation
|
|
143
218
|
/docs/endpoints/
|
|
144
219
|
/docs/models/
|
|
220
|
+
/docs/er_diagrams/
|
|
145
221
|
/docs/configs/doc-schema.yaml
|
|
146
222
|
|
|
147
223
|
# Build artifacts
|
|
@@ -178,10 +254,13 @@ your-project/
|
|
|
178
254
|
├── docs_settings.py # Documentation-specific settings
|
|
179
255
|
├── mkdocs.yml # MkDocs configuration
|
|
180
256
|
├── docs/ # Generated documentation (gitignored)
|
|
257
|
+
│ ├── endpoints/ # API endpoint docs
|
|
258
|
+
│ ├── models/ # Model documentation
|
|
259
|
+
│ ├── er_diagrams/ # ER diagrams
|
|
260
|
+
│ └── configs/ # Configuration files
|
|
181
261
|
└── site/ # Built site (gitignored)
|
|
182
262
|
```
|
|
183
263
|
|
|
184
264
|
## Contributing
|
|
185
265
|
|
|
186
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
187
|
-
This will ensure that only the source configuration and scripts are versioned, while the generated documentation is excluded.
|
|
266
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for detailed contribution guidelines.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
# Customizing API Endpoint Documentation
|
|
3
3
|
|
|
4
|
-
`drf-to-mkdoc` automatically generates API documentation from your Django REST Framework (DRF) project using the OpenAPI schema from **DRF Spectacular**. You can refine and extend that documentation using a **custom JSON file
|
|
4
|
+
`drf-to-mkdoc` automatically generates API documentation from your Django REST Framework (DRF) project using the OpenAPI schema from **DRF Spectacular**. You can refine and extend that documentation using a **custom JSON file** and various configuration options.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -170,3 +170,33 @@ Supported `queryparam_type` values:
|
|
|
170
170
|
* Keep `custom_schema.json` in version control so your team benefits.
|
|
171
171
|
* Start small: add descriptions first, then parameters, then responses.
|
|
172
172
|
* Use `append_fields` if you want to **add extra info** without overwriting auto-generated items.
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 7. Advanced Configuration Options
|
|
177
|
+
|
|
178
|
+
### Field Generators
|
|
179
|
+
You can define custom field value generators for better example generation:
|
|
180
|
+
|
|
181
|
+
```python
|
|
182
|
+
DRF_TO_MKDOC = {
|
|
183
|
+
'DJANGO_APPS': ['your_apps'],
|
|
184
|
+
'FIELD_GENERATORS': {
|
|
185
|
+
'created_at': datetime.now.strftime(settings.CUSTOM_DATETIME_FORMAT),
|
|
186
|
+
'phone_number': generate_phone_number_function,
|
|
187
|
+
},
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Path Parameter Substitution
|
|
192
|
+
Customize how path parameters are handled:
|
|
193
|
+
|
|
194
|
+
```python
|
|
195
|
+
DRF_TO_MKDOC = {
|
|
196
|
+
'PATH_PARAM_SUBSTITUTE_FUNCTION': 'your_app.utils.custom_substitute',
|
|
197
|
+
'PATH_PARAM_SUBSTITUTE_MAPPING': {
|
|
198
|
+
'pk': 'id',
|
|
199
|
+
'uuid': 'identifier',
|
|
200
|
+
},
|
|
201
|
+
}
|
|
202
|
+
```
|
|
@@ -2,6 +2,7 @@ DEFAULTS = {
|
|
|
2
2
|
# Path configurations with defaults
|
|
3
3
|
"DOCS_DIR": "docs", # Directory where docs will be generated
|
|
4
4
|
"CONFIG_DIR": "docs/configs", # Directory for configuration files
|
|
5
|
+
"ER_DIAGRAMS_DIR": "er_diagrams", # Directory for ER diagrams (relative to DOCS_DIR)
|
|
5
6
|
"MODEL_DOCS_FILE": "docs/model-docs.json", # Path to model documentation JSON file
|
|
6
7
|
"DOC_CONFIG_FILE": "docs/configs/doc_config.json", # Path to documentation configuration file
|
|
7
8
|
"CUSTOM_SCHEMA_FILE": "docs/configs/custom_schema.json", # Path to custom schema file
|
{drf_to_mkdoc-0.2.3 → drf_to_mkdoc-0.3.0}/drf_to_mkdoc/management/commands/build_model_docs.py
RENAMED
|
@@ -4,6 +4,7 @@ from django.core.management.base import BaseCommand
|
|
|
4
4
|
|
|
5
5
|
from drf_to_mkdoc.conf.settings import drf_to_mkdoc_settings
|
|
6
6
|
from drf_to_mkdoc.utils.commons.file_utils import load_json_data
|
|
7
|
+
from drf_to_mkdoc.utils.er_diagram_generator import generate_er_diagrams
|
|
7
8
|
from drf_to_mkdoc.utils.model_detail_generator import generate_model_docs
|
|
8
9
|
from drf_to_mkdoc.utils.model_list_generator import create_models_index
|
|
9
10
|
|
|
@@ -42,9 +43,17 @@ class Command(BaseCommand):
|
|
|
42
43
|
self.stdout.write("📋 Generating model documentation...")
|
|
43
44
|
|
|
44
45
|
try:
|
|
46
|
+
# Generate model detail pages
|
|
45
47
|
generate_model_docs(models_data)
|
|
48
|
+
self.stdout.write(self.style.SUCCESS("✅ Model detail pages generated"))
|
|
49
|
+
|
|
50
|
+
# Generate ER diagrams
|
|
51
|
+
generate_er_diagrams(models_data, docs_dir)
|
|
52
|
+
self.stdout.write(self.style.SUCCESS("✅ ER diagrams generated"))
|
|
53
|
+
|
|
54
|
+
# Create models index page
|
|
46
55
|
create_models_index(models_data, docs_dir)
|
|
47
|
-
self.stdout.write(self.style.SUCCESS("✅
|
|
56
|
+
self.stdout.write(self.style.SUCCESS("✅ Models index page generated"))
|
|
48
57
|
except Exception as e:
|
|
49
58
|
self.stdout.write(self.style.WARNING(f"⚠️ Failed to generate model docs: {e}"))
|
|
50
59
|
raise
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Loader script for field sections functionality
|
|
2
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
3
|
+
// Load CSS
|
|
4
|
+
function loadCSS(url) {
|
|
5
|
+
const link = document.createElement('link');
|
|
6
|
+
link.rel = 'stylesheet';
|
|
7
|
+
link.href = url;
|
|
8
|
+
document.head.appendChild(link);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Load JavaScript
|
|
12
|
+
function loadScript(url, callback) {
|
|
13
|
+
const script = document.createElement('script');
|
|
14
|
+
script.src = url;
|
|
15
|
+
script.onload = callback || function() {};
|
|
16
|
+
document.body.appendChild(script);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Base URL for static files
|
|
20
|
+
const baseUrl = document.querySelector('meta[name="static-url"]')?.getAttribute('content') || '';
|
|
21
|
+
|
|
22
|
+
// Load CSS file
|
|
23
|
+
loadCSS(baseUrl + '/static/drf-to-mkdoc/stylesheets/field-sections.css');
|
|
24
|
+
|
|
25
|
+
// Load field extractor script
|
|
26
|
+
loadScript(baseUrl + '/static/drf-to-mkdoc/javascripts/try-out/field-extractor.js');
|
|
27
|
+
|
|
28
|
+
console.log('Field sections functionality loaded');
|
|
29
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Query parameters loader script
|
|
2
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
3
|
+
// Load JavaScript
|
|
4
|
+
function loadScript(url, callback) {
|
|
5
|
+
const script = document.createElement('script');
|
|
6
|
+
script.src = url;
|
|
7
|
+
script.onload = callback || function() {};
|
|
8
|
+
document.body.appendChild(script);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// Base URL for static files
|
|
12
|
+
const baseUrl = document.querySelector('meta[name="static-url"]')?.getAttribute('content') || '';
|
|
13
|
+
|
|
14
|
+
// Load query parameters extractor script
|
|
15
|
+
loadScript(baseUrl + '/static/drf-to-mkdoc/javascripts/try-out/query-parameters-extractor.js');
|
|
16
|
+
});
|