BumbleDocGen / Technical description of the project / Renderer / How to create documentation templates?
Templates are twig
files in which you can write both static text and dynamic blocks that will change from code changes or other required parameters.
You can read more about template parts here:
Some static text
This text does not change when the code is changed
After generating the documentation, this page will look exactly like a template.
{% set title = 'Some page' %}
{% set prevPage = 'Technical description of the project' %}
{{ generatePageBreadcrumbs(title, _self) }}
Some static text...
Dynamic block:
{{ printEntityCollectionAsList(phpClassEntityCollection.filterByInterfaces(['\\BumbleDocGen\\Core\\Parser\\SourceLocator\\SourceLocatorInterface']).getOnlyInstantiable()) }}
More static text...
Result after starting the documentation generation process:
<embed> <a href="/docs/readme.md">BumbleDocGen</a> <b>/</b> <a href="/docs/tech/index.md">Technical description of the project</a> <b>/</b> Some page<hr> </embed>
Some static text...
Dynamic block:
<embed> <ul><li><a href='/docs/tech/3.renderer/classes/DirectoriesSourceLocator.md'>DirectoriesSourceLocator</a> - Loads all files from the specified directory</li><li><a href='/docs/tech/3.renderer/classes/FileIteratorSourceLocator.md'>FileIteratorSourceLocator</a> - Loads all files using an iterator</li><li><a href='/docs/tech/3.renderer/classes/RecursiveDirectoriesSourceLocator.md'>RecursiveDirectoriesSourceLocator</a> - Loads all files from the specified directories, which are traversed recursively</li><li><a href='/docs/tech/3.renderer/classes/SingleFileSourceLocator.md'>SingleFileSourceLocator</a> - Loads one specific file by its path</li><li><a href='/docs/tech/3.renderer/classes/AsyncSourceLocator.md'>AsyncSourceLocator</a> - Lazy loading classes. Cannot be used for initial parsing of files, only for getting specific documents</li></ul> </embed>
More static text...
<div id='page_committer_info'>
<hr>
<b>Last page committer:</b> fshcherbanich <[email protected]><br><b>Last modified date:</b> Sat Jul 29 17:43:49 2023 +0300<br><b>Page content update date:</b> Sun Jul 30 2023<br>Made with <a href='/docs/readme.md'>Bumble Documentation Generator</div>
This is how it looks on the GitHub:
Output method description as a dynamic block:
Some static text...
Dynamic block:
{{ phpClassEntityCollection
.get('\\BumbleDocGen\\LanguageHandler\\LanguageHandlerInterface')
.getMethodEntity('getLanguageKey')
.getDescription()
}}
More static text...
Result after starting the documentation generation process:
Some static text...
Dynamic block:
Unique language handler key
More static text...
Last page committer: fshcherbanich <[email protected]>
Last modified date: Fri Oct 13 18:40:45 2023 +0300
Page content update date: Mon Nov 06 2023
Made with Bumble Documentation Generator