t3docs / intersphinx
Intersphinx extension for the doctrine rst parser
Requires
- php: ^7.4 || ^8.0
- doctrine/rst-parser: ^0.6@dev
- rector/rector: ^0.15.1
Requires (Dev)
- dg/bypass-finals: ^1.4.1
- doctrine/coding-standard: ^10.0
- ergebnis/composer-normalize: 2.28.*
- gajus/dindent: ^2.0.2
- phpstan/phpstan: ^1.9
- phpstan/phpstan-deprecation-rules: ^1.0
- phpstan/phpstan-phpunit: ^1.2
- phpstan/phpstan-strict-rules: ^1.4
- phpunit/phpunit: ^9.5
- symfony/css-selector: 4.4 || ^5.2 || ^6.0
- symfony/dom-crawler: 4.4 || ^5.2 || ^6.0
This package is auto-updated.
Last update: 2023-05-15 07:31:07 UTC
README
Intersphinx extension for the doctrine rst parser
Usage
Create a new T3DocsIntersphinxIntersphinx object with the static method Intersphinx::getIntersphinxFromUrlArray, pass the DoctrineRSTConfiguration and an array<String,String> to it. Intersphinx listens to an event when references could not be resolved in the rendering. Therefore the Builder does not need to know about Intersphinx. However the Kernel used in the Builder and Interspinx have to use the same Configuration instance.
<?php require 'vendor/autoload.php'; use Doctrine\RST\Builder; use Doctrine\RST\Configuration; use Doctrine\RST\Kernel; use T3Docs\Intersphinx\Intersphinx; $configuration = new Configuration(); $intersphinx = Intersphinx::getIntersphinxFromUrlArray( $configuration, [ 't3coreapi' => 'https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/', 't3tsconfig' => 'https://docs.typo3.org/m/typo3/reference-tsconfig/main/en-us/', 't3tsref' => 'https://docs.typo3.org/m/typo3/reference-typoscript/main/en-us/', 't3start' => 'https://docs.typo3.org/m/typo3/tutorial-getting-started/11.5/en-us/', ] ); $kernel = new Kernel($configuration); $builder = new Builder($kernel); $builder->build('Documentation', 'output');
Now you can link to another manual in rst like this:
Learn how to :ref:`Install TYPO3 with composer <t3start:composer>`!
The links of the current document get written into objects.inv.json in the documentations main directory.
Contribution
Contribution is welcome, you can run tests as follows:
composer update ;Fix Coding Guidelines vendor/bin/phpcbf ;PHP stan vendor/bin/phpstan ;PHP Unit vendor/bin/phpunit ;Rector vendor/bin/rector process lib