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

Allow inline links in Google style docstrings #11316

Merged

Conversation

picnixz
Copy link
Member

@picnixz picnixz commented Apr 11, 2023

Fix #11246

Detail

  • Inline links are now allowed in the first line of a docstring when sphinx.ext.napoleon is active.

Discussion

In order to allow arbitrary colons that are not meant to separate the documented member type from its description, escaping : could be considered (but the parser would require a more careful analysis).

Related

@picnixz picnixz changed the title Fix Google docstring Napoleon parser (#11246) Fix Google docstring Napoleon parser to allow inline links (#11246) Apr 11, 2023
@picnixz picnixz marked this pull request as draft April 14, 2023 09:06
@picnixz picnixz force-pushed the fix/11246-napoleon-allow-top-inline-link branch from 1ff73a6 to 981c507 Compare April 14, 2023 09:25
@picnixz
Copy link
Member Author

picnixz commented Apr 14, 2023

After investigation, I also needed to add some escape mechanism for :meta [...]: since otherwise, we cannot simply write :meta public:. I also took into consideration a future :meta field: value syntax (that I implemented for my own extension).

@picnixz picnixz marked this pull request as ready for review April 14, 2023 10:17
@picnixz picnixz force-pushed the fix/11246-napoleon-allow-top-inline-link branch 3 times, most recently from 3b92c59 to 227e097 Compare April 17, 2023 10:56
@picnixz picnixz force-pushed the fix/11246-napoleon-allow-top-inline-link branch 2 times, most recently from aa0bbfa to e4364d9 Compare April 21, 2023 15:57
@AA-Turner AA-Turner added this to the some future version milestone Apr 29, 2023
@AA-Turner
Copy link
Member

Please may you add an entry to CHANGES?

@AA-Turner AA-Turner changed the title Fix Google docstring Napoleon parser to allow inline links (#11246) Allow inline links in Google style docstrings Aug 12, 2023
@AA-Turner AA-Turner merged commit af38180 into sphinx-doc:master Aug 12, 2023
@picnixz
Copy link
Member Author

picnixz commented Aug 12, 2023

Thank you !

@picnixz picnixz deleted the fix/11246-napoleon-allow-top-inline-link branch August 12, 2023 12:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants