-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(documentator)!: Markdown
Document
mutations (#180)
Further improvements of #179. Added mutation concept and few useful mutations: - `FootnotesPrefix` - Adds unique prefix for all footnotes. - `FootnotesRemove` - Removes all footnotes. - `Move` - Changes path and updates all relative links. - `ReferencesInline` - Inlines all references. - `ReferencesPrefix` - Adds unique prefix for all references.
- Loading branch information
Showing
35 changed files
with
2,108 additions
and
684 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace LastDragon_ru\LaraASP\Documentator\Markdown\Contracts; | ||
|
||
use LastDragon_ru\LaraASP\Documentator\Markdown\Document; | ||
use LastDragon_ru\LaraASP\Documentator\Markdown\Location\Location; | ||
use League\CommonMark\Node\Block\Document as DocumentNode; | ||
|
||
interface Mutation { | ||
/** | ||
* @return array<array-key, array{Location, ?string}> | ||
*/ | ||
public function __invoke(Document $document, DocumentNode $node): array; | ||
} |
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,22 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace LastDragon_ru\LaraASP\Documentator\Markdown\Data; | ||
|
||
use Override; | ||
|
||
/** | ||
* @internal | ||
* @implements Value<int> | ||
*/ | ||
readonly class BlockPadding implements Value { | ||
public function __construct( | ||
private int $value, | ||
) { | ||
// empty | ||
} | ||
|
||
#[Override] | ||
public function get(): mixed { | ||
return $this->value; | ||
} | ||
} |
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,22 @@ | ||
<?php declare(strict_types = 1); | ||
|
||
namespace LastDragon_ru\LaraASP\Documentator\Markdown\Data; | ||
|
||
use Override; | ||
|
||
/** | ||
* @internal | ||
* @implements Value<int> | ||
*/ | ||
readonly class Length implements Value { | ||
public function __construct( | ||
private int $value, | ||
) { | ||
// empty | ||
} | ||
|
||
#[Override] | ||
public function get(): mixed { | ||
return $this->value; | ||
} | ||
} |
Oops, something went wrong.