Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reST: Support explicit titles for cross-references #472

Open
rhelmot opened this issue Dec 16, 2022 · 6 comments
Open

reST: Support explicit titles for cross-references #472

rhelmot opened this issue Dec 16, 2022 · 6 comments

Comments

@rhelmot
Copy link

rhelmot commented Dec 16, 2022

Problem Description

I would like to .. include:: ../README.rst in my __init__.py module docstring. However, it appears to be parsed as markdown, despite the fact that it has the appropriate file extension and my docstring format is set to rst (i.e. left as default). Is this a missing feature, or am I doing something wrong?

__init__.py

"""
.. include:: ../README.rst
"""

README.rst

...
A :ref:`Task` is connected to repositories through **:ref:`links <Link>`**. A link is a repository plus a collection of properties describing the repository's relationship to the task - i.e. whether it is input or output, whether it should inhibit dependent tasks from starting, etc.
...

rendered

contains :ref: and other ReST junk

System Information

pdoc: 12.3.0
Python: 3.10.6
Platform: Linux-5.17.0-1021-oem-x86_64-with-glibc2.35
@rhelmot rhelmot added the bug label Dec 16, 2022
@mhils
Copy link
Member

mhils commented Dec 16, 2022

Are you running pdoc with --docformat restructuredtext?

@rhelmot
Copy link
Author

rhelmot commented Dec 16, 2022

Yes.

@mhils
Copy link
Member

mhils commented Dec 16, 2022

Ì think the problem here is unrelated to .. include::, it's much rather that we don't support :ref:.

:py:class:`Task`

works as expected for me. Is :ref: something that is properly documented somewhere?

@rhelmot
Copy link
Author

rhelmot commented Dec 16, 2022

Ah, hm. I've been using the sphinx documentation to see what my options were in terms of rst markup. I will switch to :py:class:. Is there a listing somewhere of which roles are supported by pdoc?

@rhelmot
Copy link
Author

rhelmot commented Dec 16, 2022

I am still struggling to get these links working.

README.rst

A :py:class:`Task <pydatatask.task.Task>` is connected to repositories through **:py:class:`links <pydatatask.task.Link>`**. A link is a repository plus a collection of properties describing the repository's relationship to the task - i.e. whether it is input or output, whether it should inhibit dependent tasks from starting, etc.

rendered

image

@mhils
Copy link
Member

mhils commented Dec 16, 2022

Yeah, I think that's extended rST syntax we don't support (yet).

:py:class:`Task`

works if Task is defined in the same file, otherwise

:py:class:`pydatatask.task.Task`

does the trick. I'm happy to accept contributions for this, but it's nothing I'll be actively pursuing.

@mhils mhils added enhancement and removed bug labels Dec 16, 2022
@mhils mhils changed the title Including a ReST file reST: Support explicit titles for cross-references Dec 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants