Add customization blocks to ui templates

Closes #178.
This commit is contained in:
Cristi Vîjdea
2018-09-10 02:41:02 +03:00
parent 4bac38e67b
commit 27e38101a4
4 changed files with 45 additions and 56 deletions
+1
View File
@@ -11,6 +11,7 @@ Changelog
- **ADDED:** added the ``SPEC_URL`` setting for controlling the download link in ``swagger-ui`` and ``ReDoc``
- **ADDED:** updated ``ReDoc`` settings (added ``NATIVE_SCROLLBARS`` and ``REQUIRED_PROPS_FIRST``)
- **ADDED:** added ``extra_styles`` and ``extra_scripts`` blocks to ui templates (:issue:`178`)
- **IMPROVED:** updated ``swagger-ui`` to version 3.18.2
- **IMPROVED:** updated ``ReDoc`` to version 2.0.0-alpha.37
- **FIXED:** stopped generating invalid OpenAPI by improper placement of ``readOnly`` Schemas
+14 -3
View File
@@ -2,6 +2,17 @@
Customizing the web UI
######################
There is currently no pluggable way of customizing the web UI apart from the settings available in
:ref:`swagger-ui-settings` and :ref:`redoc-ui-settings`. If you really need to, you can override one of the
``drf-yasg/swagger-ui.html`` or ``drf-yasg/redoc.html`` templates that are used for rendering.
The web UI can be customized using the settings available in :ref:`swagger-ui-settings` and :ref:`redoc-ui-settings`.
You can also extend one of the ``drf-yasg/swagger-ui.html`` or ``drf-yasg/redoc.html`` templates that are used for
rendering. The customizable blocks are currently limited to:
{% block extra_styles %}
additional stylesheets
{% block extra_scripts %}
additional scripts
{% block user_context_message %}
*(swagger-ui session auth only)*
logged in user message