executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
738 stars 196 forks source link

unknown option `relative-docs` #764

Closed danieltuzes closed 1 year ago

danieltuzes commented 1 year ago

Describe the bug

context I try to import the README.md containing local (relative) links. Without the relative-docs feature, it is expected to show wrong links.

expectation After using the relative-docs feature, proper links are expected.

bug The include directive doesn't support relative-docs

.. include ../../README.md
   :parser: myst_parser.sphinx_
   :relative-docs: docs/
   :relative-images:

By compiling this to html by sphinx, I get the error ERROR: Error in "include" directive: unknown option: "relative-docs".

problem This is a problem for people who want to reuse existing READMEs.

Reproduce the bug

I use the code snippet:

.. include ../../README.md
   :parser: myst_parser.sphinx_
   :relative-docs: docs/
   :relative-images:

In the conf.py I have myst_parser added as extension.

List your environment

myst: 1.0.0 python: 3.9

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 1 year ago

Heya relative-docs and relative-images are options only available from within a myst document. You would have to open an issue with sphinx to have them available more generally