Skip to content

Commit

Permalink
Add documentation on how to use assets_mode
Browse files Browse the repository at this point in the history
  • Loading branch information
lacpandore committed Jul 17, 2024
1 parent 2f20162 commit 58f6d76
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/Resources/views/SwaggerUi/index.html.twig>`_, in ``/Resources/views/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 are listed in `AssetsMode <https://github.com/nelmio/NelmioApiDocBundle/blob/master/src/Render/Html/AssetsMode.php>`_
- **cdn**: Loads JS and CSS assets from an online CDN.
- **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 58f6d76

Please sign in to comment.