13 Commits

Author SHA1 Message Date
Christopher Davis
49bad6743c Remove Inline Styles in Favor of the Stylesheet
Should fix https://github.com/nelmio/NelmioApiDocBundle/issues/1770
2022-05-16 08:56:52 -05:00
jeremy
babf788636
Proposal: Add `header_block` Twig Block (#1896)
* Adding ``header_block`` Twig Block

In attempting to remove the default green header from the API docs (I am integrating the docs into a site that already has a header), I have found that the only possible way to do so is to overwrite the entire ``index.html.twig`` file.  This is because the existing ``{% header %}`` twig tags are placed *inside* the ``<header>`` HTML tags.  So, if one overrides the ``{% header %}`` block, it only adjusts the header content, as opposed to allowing control over the entire header object.

To resolve this problem I considered two methods:

- Move the existing ``{% header %}`` tags _*outside*_ of the ``<header>`` tags.  This would resolve the problem in the simplest fashion, but would be a breaking change for those currently overriding the block.

- Add a new twig block, placing its tags *_outside_* the existing ``<header>`` tags.  This would leave the existing functionality as-is, and would not break any current implementations.

I chose the latter for the reasons specified above, and suggested the name ``{% header_block %}``.  Thanks for considering this proposal.

* Add Location of Original Twig Template

This doc page advises that one can `have a look at the original template to see which blocks can be overridden`, but does not say where the original template can be found.  This edit adds that information so that users don't have to resort to searching for keywords (like I just had to).

Note that I haven't run any tests as this is a docs-only change.
2021-12-11 14:41:46 +01:00
Guilhem Niot
9c729ab7b7
Fix support without twig (#1878)
* fix support without twig

* Support null openApiRenderer

* Register a twig extension instead of registering twig function at runtime

* fix tests
2021-09-22 23:43:32 +02:00
Zdeněk Drahoš
9cb6006b69 Refactoring including assets 2021-06-27 10:00:43 +02:00
Zdeněk Drahoš
5124f07ece Enable dumping html docs with cdn and offline assets 2021-06-27 09:24:35 +02:00
Baptiste Lafontaine
cbab00939f Allow to pass options to the constructor of SwaggerUIBundle 2020-10-23 15:04:00 +02:00
Markus Poerschke
c771c684a8 Customizable template and remove Google Fonts (#1357)
* Allow to override certain parts of the template

* Twig template can be defined via config
* Blocks can be used to override/extend only parts of the template

* Fix spelling in documentation

* Fix extension configuration tree

* Fix unit tests by making constructor argument optional

* Add fonts block and split swagger initialization into own block

* Fix code style

* Remove Google fonts, remove configuration and add changelog entry

* Remove template argument from service definition

* Add correct path for overriding template

* Move re-add of Google Fonts to FAQ section in documentation.

* Remove unused class import
2018-07-16 09:45:18 +02:00
Baptiste Lafontaine
a91c89cfe7 Add the swagger spec info name in <title> 2018-04-16 09:59:57 +02:00
Harald Velner
287cecda39 Add svg icons definitions to index.html.twig 2017-08-07 13:49:38 +02:00
Harald Velner
bce6fd8c83 Add missing svg definitions for icons 2017-07-31 12:42:05 +02:00
Guilhem Niot
47620f606a Port UI updates from Api-Platform 2017-06-22 23:09:05 +02:00
Guilhem Niot
39eda091c1 Update Swagger-ui 2017-06-02 21:37:33 +02:00
Guilhem N
260a2689a6 Add Swagger-ui support 2017-05-13 13:55:13 +02:00