Way to explicitly shorten identifier in a docstring
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
Problem Description
In a docstring for earhinov_utils.kedro.datasets.gsheets.GoogleSheetsDataset, I would like to mention earshinov_utils.kedro.datasets.pandas.PandasWrapperDataset, and:
- I would like the latter to be turned into a hyperlink
- I would like the text of the hyperlink to be
PandasWrapperDatasetinstead ofearshinov_utils.kedro.datasets.pandas.PandasWrapperDataset, as- I assume that by this moment the user is already familiar with
PandasWrapperDataset - even if they are not, they can follow the hyperlink
- I assume that by this moment the user is already familiar with
There seems to be no way to achieve this currently with pdoc. A couple of things that I tried:
- PandasWrapperDataset (in backticks, which I cannot use here) is naturally not hyperlinked
[PandasWrapperDataset](earshinov_utils.kedro.datasets.pandas.PandasWrapperDataset)results in a broken markup (even without backticks)[PandasWrapperDataset][earshinov_py_utils.kedro.datasets.pandas.PandasWrapperDataset]is not recognized
Proposal
I assume, mkdocs, or rather mkdocstrings, or maybe the underlying Griffe, do recognize this syntax:
[PandasWrapperDataset][earshinov_py_utils.kedro.datasets.pandas.PandasWrapperDataset]
(See, for example, the description of mkdocstrings-python-xref)
With pdoc being the best API doc generator for Python, it would be nice if it had this feature as well :)
I would also appreciate if the first bracket supported arbitrary syntax, particularly backticks.
Alternatives
Keep using the full identifier (earshinov_py_utils.kedro.datasets.pandas.PandasWrapperDataset), which makes the rendered documentation harder to read and less visually appealing due to messy line breaks.
Additional context
Thank you for a wonderful tool. Discovered it just this week, and enjoyed the fact that it works out of the box
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
Start by tracing how pdoc parses docstring markup and resolves cross-references, using the proposed shortened-link syntax as the behavioral example. Confirm the rendered documentation uses the short label while linking to the fully qualified Python identifier, including support for backticks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100