Skip to content

Latest commit

 

History

History
248 lines (170 loc) · 6.96 KB

DrawDocumentationMenu.md

File metadata and controls

248 lines (170 loc) · 6.96 KB

BumbleDocGen / Technical description of the project / Renderer / Template functions / DrawDocumentationMenu


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

Settings:

Function name: drawDocumentationMenu

Initialization methods:

  1. __construct

Methods:

  1. __invoke
  2. getName
  3. getOptions

Method details:

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 -

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:


public static function getName(): string;

Parameters: not specified

Return value: string


public static function getOptions(): array;

Parameters: not specified

Return value: array