BumbleDocGen / Technical description of the project / Renderer / Template functions / DrawDocumentationMenu
DrawDocumentationMenu class:
namespace BumbleDocGen\Core\Renderer\Twig\Function;
final class DrawDocumentationMenu implements \BumbleDocGen\Core\Renderer\Twig\Function\CustomFunctionInterface
Generate documentation menu in HTML format. To generate the menu, the start page is taken, and all links with this page are recursively collected for it, after which the html menu is created.
See:
Examples of using:
{{ drawDocumentationMenu() }} - The menu contains links to all documents
{{ drawDocumentationMenu('/render/index.md') }} - The menu contains links to all child documents from the /render/index.md file (for example /render/test/index.md)
{{ drawDocumentationMenu(_self) }} - The menu contains links to all child documents from the file where this function was called
{{ drawDocumentationMenu(_self, 2) }} - The menu contains links to all child documents from the file where this function was called, but no more than 2 in depth
Function name: | drawDocumentationMenu |
- # __construct | source code
public function __construct(\BumbleDocGen\Core\Configuration\Configuration $configuration, \BumbleDocGen\Core\Renderer\Breadcrumbs\BreadcrumbsHelper $breadcrumbsHelper, \BumbleDocGen\Core\Renderer\Context\RendererContext $rendererContext, \BumbleDocGen\Core\Renderer\Context\Dependency\RendererDependencyFactory $dependencyFactory);
Parameters:
Name | Type | Description |
---|---|---|
$configuration | \BumbleDocGen\Core\Configuration\Configuration | - |
$breadcrumbsHelper | \BumbleDocGen\Core\Renderer\Breadcrumbs\BreadcrumbsHelper | - |
$rendererContext | \BumbleDocGen\Core\Renderer\Context\RendererContext | - |
$dependencyFactory | \BumbleDocGen\Core\Renderer\Context\Dependency\RendererDependencyFactory | - |
- # __invoke | source code
public function __invoke(string|null $startPageKey = null, int|null $maxDeep = null): string;
Parameters:
Name | Type | Description |
---|---|---|
$startPageKey | string | null | Relative path to the page from which the menu will be generated (only child pages will be taken into account). By default, the main documentation page (readme.md) is used. |
$maxDeep | int | null | Maximum parsing depth of documented links starting from the current page. By default, this restriction is disabled. |
Return value: string
Throws:
- # getName | source code
public static function getName(): string;
Parameters: not specified
Return value: string
- # getOptions | source code
public static function getOptions(): array;
Parameters: not specified
Return value: array