t3docs/intersphinx

此包已被弃用且不再维护。没有建议替代包。

Doctrine RST 解析器的 Intersphinx 扩展

0.1.1 2023-01-15 06:46 UTC

This package is auto-updated.

Last update: 2023-05-15 07:31:07 UTC


README

Doctrine RST 解析器的 Intersphinx 扩展

使用方法

使用静态方法 Intersphinx::getIntersphinxFromUrlArray 创建一个新的 T3DocsIntersphinxIntersphinx 对象,传入 DoctrineRSTConfiguration 和一个 String,String 的数组。Intersphinx 在渲染过程中无法解析引用时监听事件。因此,构建者不需要了解 Intersphinx。但是,构建者中使用的内核和 Interspinx 必须使用相同的配置实例。

<?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');

现在您可以在 rst 中像这样链接到另一份手册

Learn how to :ref:`Install TYPO3 with composer <t3start:composer>`!

当前文档的链接将被写入文档主目录中的 objects.inv.json 文件。

贡献

欢迎贡献,您可以通过以下方式运行测试

composer update

;Fix Coding Guidelines
vendor/bin/phpcbf

;PHP stan
vendor/bin/phpstan

;PHP Unit
vendor/bin/phpunit

;Rector
vendor/bin/rector process lib