Skip to content

Commit

Permalink
docs: add documentation on how to use assets_mode (#2318)
Browse files Browse the repository at this point in the history
| Q | A |

|---------------|---------------------------------------------------------------------------------------------------------------------------|
| Bug fix? | no |
| New feature? | no |
| Deprecations? | no                                                 |

---------

Co-authored-by: lacpandore <[email protected]>
Co-authored-by: Djordy Koert <[email protected]>
  • Loading branch information
3 people authored Jul 22, 2024
1 parent c952390 commit 12a0ff1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/customization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,23 @@ Just create a file ``templates/bundles/NelmioApiDocBundle/SwaggerUi/index.html.t
{% endblock javascripts %}
You can have a look at the `original template <https://github.com/nelmio/NelmioApiDocBundle/blob/master/templates/SwaggerUi/index.html.twig>`_, in ``/templates/SwaggerUi/index.html.twig``, to see which blocks can be overridden.

Assets Loading Options
-----------------------

The `html_config` settings allow you to configure how assets are loaded for the UI. The `assets_mode` option supports three values: `cdn`, `bundle`, and `offline`.


.. code-block:: yaml
nelmio_api_doc:
html_config:
assets_mode: 'cdn' # Other values: 'bundle', 'offline'
`assets_mode`
~~~~~~~~~~~~~

The three values possible values can be found in `AssetsMode.php <https://github.com/nelmio/NelmioApiDocBundle/blob/master/src/Render/Html/AssetsMode.php>`_
- **cdn**: Loads assets from `jsDelivr <https://www.jsdelivr.com/>`_.
- **bundle**: Fetches assets from the bundle in the vendor directory, including updates.
- **offline**: Loads assets from the local `assets` directory, requiring the developer to update them manually.

0 comments on commit 12a0ff1

Please sign in to comment.