doctrine / doctrine/rst-parser

A Fatal break the build when I config my theme

Open
#121 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
63
Forks
26
PR merge metrics
No merged PRs in 30d

Description

**Env**

OS: macOS 10.15.6

php:
```
PHP 7.3.11 (cli) (built: Jul 5 2020 03:23:39) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.11, Copyright (c) 1998-2018 Zend Technologies
```

**Some Code**

```php
#!/usr/bin/env php

setFileExtension(Format::HTML);
$configuration->setIndentHTML(true);
$configuration->setCustomTemplateDirs(
[
ROOT . '/docs/themes',
]
);
$configuration->setTheme('nim');

$kernel = new Kernel($configuration);

$builder = new Builder($kernel);
$builder->setIndexName('quick_start');

$builder->build($source, $target);
```

**File Struction**

* docs/
* rst/
* *Some RST file*
* ……
* themes/
* nim/
* xxx.css
* html/
* layout.html.twig

**Error Info**
```
Fatal error: Uncaught Twig\Error\LoaderError: The "/path/to/vendor/doctrine/rst-parser/lib/Templates/nim/html" directory does not exist ("/path/to/vendor/doctrine/rst-parser/lib/Templates/nim/html"). in /path/to/vendor/twig/twig/src/Loader/FilesystemLoader.php:106
```

**Expect**

I don't think it should be break when I have been specify the themes' dir.
Maybe there should be some thing make it pass as long as one of custumized dir and other per-build path.

------
Thanks for any helps!

Contributor guide

Open the contributing guide

Research direction

Start with Configuration::setCustomTemplateDirs(), Configuration::setTheme(), and the Twig template-loading path implicated by the LoaderError. Reproduce the build using the PHP example and the docs/themes/nim/html/layout.html.twig structure; done means a configured custom theme directory is accepted without requiring the missing default path.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.