BumbleDocGen / Technical description of the project / Renderer / Documentation structure and breadcrumbs
To work with breadcrumbs and get the structure of the documentation, we use the inner class BreadcrumbsHelper.
To build the documentation structure, twig templates from the templates_dir
configuration are used.
To determine the structure of the project, the actual location of the files in the templates directory is used first of all. For each directory there is an index file ( readme.md or index.md ), and they are used to determine the exact input of each level of nesting.
But in addition to building the documentation structure using the actual location of template files in directories,
you can explicitly specify the parent page in each template using the special variable prevPage
:
{% set prevPage = 'Prev page name' %}
In this way, complex documentation structures can be created with less file nesting:
There is a built-in function to generate breadcrumbs in templates GeneratePageBreadcrumbs. Here is how it is used in twig templates:
{{ generatePageBreadcrumbs(title, _self) }}
To build breadcrumbs, the previously compiled project structure and the names of each template are used.
The template name can be specified using the title
variable:
{% set title = 'Some page title' %}
Here is an example of the result of the generatePageBreadcrumbs
function:
<embed> <a href="/docs/readme.md">BumbleDocGen</a> <b>/</b> <a href="/docs/tech/index.md">Technical description of the project</a> <b>/</b> <a href="/docs/tech/3.renderer/index.md">Renderer</a> <b>/</b> Documentation structure and breadcrumbs<hr> </embed>
Last page committer: fshcherbanich <[email protected]>
Last modified date: Sat Oct 28 11:03:31 2023 +0300
Page content update date: Mon Nov 06 2023
Made with Bumble Documentation Generator