Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function leaveNode(Node $node, CompilerContextInterface $compilerContext)
$node->getTitle() ?? TitleNode::emptyNode(),
$node->isRoot(),
$additionalData,
$node->isOrphan(),
);
$compilerContext->getProjectNode()->addDocumentEntry($entry);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ protected function handleMenuEntry(MenuNode $currentMenu, MenuEntryNode $entryNo
$globExclude = explode(',', $currentMenu->getOption('globExclude') . '');
$menuEntries = [];
foreach ($documentEntries as $documentEntry) {
if ($documentEntry->isOrphan()) {
continue;
}

if (
!self::matches($documentEntry->getFile(), $entryNode, $currentPath, $globExclude)
) {
Expand Down
6 changes: 6 additions & 0 deletions packages/guides/src/Nodes/DocumentTree/DocumentEntryNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function __construct(
private readonly TitleNode $titleNode,
private readonly bool $isRoot = false,
private array $additionalData = [],
private bool $orphan = false,
) {
}

Expand Down Expand Up @@ -109,6 +110,11 @@ public function getAdditionalData(string $key): Node|null
return $this->additionalData[$key] ?? null;
}

public function isOrphan(): bool
{
return $this->orphan;
}

public function addAdditionalData(string $key, Node $value): void
{
$this->additionalData[$key] = $value;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:orphan:

Do not Include in menu
======================

This is an orphan an must be ignored by glob patterns
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
:orphan:

Do not Include in menu
======================

This is an orphan an must be ignored by glob patterns
Loading