phpDocumentor / phpDocumentor/guides
[Bug]: Relative paths for Literalincludes in included files are resolved incorretly
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36
- Forks
- 22
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 24
Description
Summary
Relative paths are resolved from the location where the file is included not from the location oft the file itself
Code snippet that reproduces the problem
I have the following directory structures:
They are all included in Index.rst
Now if one of the properties or examples has a literalinclude using relativ paths I would expect the following to work:
.. literalinclude:: ../_CodeSnippets/_creationOptions.php
:language: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
But have to do
.. literalinclude:: _CodeSnippets/_creationOptions.php
:language: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
Or an absolute path like
.. literalinclude:: /Types/_CodeSnippets/_creationOptions.php
:language: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
Expected output
I would expect
.. literalinclude:: ../_CodeSnippets/_creationOptions.php
:language: php
:caption: EXT:my_extension/Configuration/TCA/Overrides/tt_content.php
To work
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the shown included-file structure and the relative literalinclude examples. Compare resolution from the including file with resolution from the file containing the directive; done means the ../_CodeSnippets/_creationOptions.php path works as shown while preserving the expected code output.
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