-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
567 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...xt/src/RestructuredText/Parser/Productions/FieldList/NavigationTitleFieldListItemRule.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of phpDocumentor. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @link https://phpdoc.org | ||
*/ | ||
|
||
namespace phpDocumentor\Guides\RestructuredText\Parser\Productions\FieldList; | ||
|
||
use phpDocumentor\Guides\Nodes\FieldLists\FieldListItemNode; | ||
use phpDocumentor\Guides\Nodes\Metadata\MetadataNode; | ||
use phpDocumentor\Guides\Nodes\Metadata\NavigationTitleNode; | ||
use phpDocumentor\Guides\RestructuredText\Parser\BlockContext; | ||
|
||
use function strtolower; | ||
|
||
final class NavigationTitleFieldListItemRule implements FieldListItemRule | ||
{ | ||
public function applies(FieldListItemNode $fieldListItemNode): bool | ||
{ | ||
return strtolower($fieldListItemNode->getTerm()) === 'navigation-title'; | ||
} | ||
|
||
public function apply(FieldListItemNode $fieldListItemNode, BlockContext $blockContext): MetadataNode | ||
{ | ||
return new NavigationTitleNode($fieldListItemNode->getPlaintextContent()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/guides/src/Event/ModifyDocumentEntryAdditionalData.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of phpDocumentor. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @link https://phpdoc.org | ||
*/ | ||
|
||
namespace phpDocumentor\Guides\Event; | ||
|
||
use phpDocumentor\Guides\Compiler\CompilerContext; | ||
use phpDocumentor\Guides\Nodes\DocumentNode; | ||
use phpDocumentor\Guides\Nodes\Node; | ||
|
||
final class ModifyDocumentEntryAdditionalData | ||
{ | ||
/** @param array<string, Node> $additionalData */ | ||
public function __construct( | ||
private array $additionalData, | ||
private readonly DocumentNode $documentNode, | ||
private readonly CompilerContext $compilerContext, | ||
) { | ||
} | ||
|
||
/** @return array<string, Node> */ | ||
public function getAdditionalData(): array | ||
{ | ||
return $this->additionalData; | ||
} | ||
|
||
/** @param array<string, Node> $additionalData */ | ||
public function setAdditionalData(array $additionalData): ModifyDocumentEntryAdditionalData | ||
{ | ||
$this->additionalData = $additionalData; | ||
|
||
return $this; | ||
} | ||
|
||
public function getDocumentNode(): DocumentNode | ||
{ | ||
return $this->documentNode; | ||
} | ||
|
||
public function getCompilerContext(): CompilerContext | ||
{ | ||
return $this->compilerContext; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
packages/guides/src/Nodes/Metadata/NavigationTitleNode.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* This file is part of phpDocumentor. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @link https://phpdoc.org | ||
*/ | ||
|
||
namespace phpDocumentor\Guides\Nodes\Metadata; | ||
|
||
/** | ||
* The organization element contains the name of document author's organization, | ||
* or the organization responsible for the document. | ||
*/ | ||
final class NavigationTitleNode extends MetadataNode | ||
{ | ||
public function __construct(string $plaintext) | ||
{ | ||
parent::__construct($plaintext); | ||
} | ||
} |
Oops, something went wrong.