Closed thatlittleboy closed 2 years ago
You can rebase on main
branch to fix Windows builds.
Only implemented for Google and Numpy for now. I'm not sure how to do it for Rst, it doesn't seem like Rst is parsing examples explicitly (or at all?). If there is a way to implement for Rst, I would be grateful if you could nudge me in the right direction. I'll try to incorporate it into this PR as well. (since our pyjanitor project is using the rst / legacy-python combination sweat_smile
Indeed, the RST parser does not even parse code examples. I will not ask you to add it, but if you want to do so, be my guest. Also, are you really using reStructuredText in your pyjanitor docstrings? I have to say that I strongly recommend switching to a style more akin to Markdown (google or even numpydoc): after all, you are generating docs with MkDocs, which uses Markdown exclusively :confused: Maybe you have this planned though, in that case, just ignore my comment :slightly_smiling_face:
As to pointing you in the right direction if you want to try and implement code example parsing in the RST parser: I won't be of any help unfortunately. The RST parser was implemented by @plannigan.
@pawamoy
main
? I don't see a main branch on the pytkdocs
repo 😅griffe
.Arf, I thought I was on another repo, my bad! The main branch is master
here indeed :slightly_smiling_face:
I checked your docstrings: you're not really using RST I think, I just mislead myself by naming the parser "RST", when the :param name:
syntax is just Sphinx-style I think. This is why I renamed this parser to sphinx
in Griffe, less confusing.
The type check failed but I will fix it just after merging your PR if you don't mind.
Sure, thanks!
Related to: https://github.com/mkdocstrings/mkdocstrings/issues/386
I've decided to start the work on the above issue starting from the legacy parser. Please take a look and see if I'm going in the right direction or if I've missed anything crucial.
Key PR pointers
# doctest:
and<BLANKLINE>
via regex; in both cases where 1. line starts with>>>
and 2. line is "in a code example block". This is activated via the newtrim_doctest_flags
parameter / option.trim_doctest_flags
to be True. To keep consistent with Sphinx.pyjanitor
project is using the rst / legacy-python combination 😅 )trim_doctest_flags=False
as default argument in the test suite.docstring_options
.Addendum