jgm / pandoc

Universal markup converter
https://pandoc.org
Other
34.19k stars 3.36k forks source link

Cross-document reference - internal link markdown to restructured text #8592

Open jpetot opened 1 year ago

jpetot commented 1 year ago

This is my project structure.

project
    |___ file1.md
    |___ file2.rst

I am trying to cross refer a .rst document in a markdown file.

# file1.md
this is an [internal link](file2) to file2.rst

And then I convert the file1.md in to .rst for sphinx poetry run pandoc --from=markdown --to=rst --output=file1.rst file1.md

Actual output

# file1.rst
this is an `internal link <file1>`__

according to the sphinx documentation, the expected format for internal link is :doc:path/to/document` (https://stackoverflow.com/a/54127156/13947877)

Expected output

# file1.rst
this is an :doc:`internal link <file1>`

I don't know if this feature is in the scope of pandoc, but it could be nice. It could be a sphinx issue but I am not sure about it.

jgm commented 1 year ago

Is this a Sphinx feature or part of core reST?

We target reST, not Sphinx specifically.