gl-website-deployer/vendor/doctrine/rst-parser/docs/en/builder.rst
2024-11-19 08:02:04 +01:00

1.4 KiB

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> </head>

Builder

The Doctrine\RST\Builder class will parse a whole tree of documents and generate an output directory containing formatted files.

It can be used like this:

use Doctrine\RST\Builder;

$builder = new Builder();
$builder->build('/path/to/source', '/path/to/output');

It will parse all the files in the /path/to/source directory, starting with index.rst, scan for dependencies and will generate target files in the /path/to/output directory. The Default format is HTML.

Configuration

If you want to customize the builder you can pass a Doctrine\RST\Kernel instance with a Doctrine\RST\Configuration that allows you to customize the configuration used by the builder:

use Doctrine\RST\Builder;
use Doctrine\RST\Configuration;
use Doctrine\RST\Kernel;

$configuration = new Configuration();
$configuration->setBaseUrl('https://www.google.com');
$kernel = new Kernel($configuration);

$builder = new Builder($kernel);

You can read more about what configuration options exist in the :ref:`Configuration <configuration>` chapter.

System Message: ERROR/3 (<stdin>, line 39); backlink

Unknown interpreted text role "ref".

Custom Index Name

If your index file is not index.rst and it is something like introduction.rst you can customize that using the setIndexName() method:

$builder->setIndexName('introduction');
</html>