Skip to content

[Bug]: Relative paths for Literalincludes in included files are resolved incorretly #1068

Open
@linawolf

Description

@linawolf

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:

image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions