Closed jdthorpe closed 4 years ago
Hey @jdthorpe ,
Thanks for reporting this issue. This is because Pydoc-Markdown 2 actual executes the code and cannot know that the default value for the fun
argument was originally DEFAULT
in the source code.
A while back someone added a call to use yapf
to format function arguments, but as you have noted the repr()
of the lambda is not valid syntax. We could resolve this by catching it and just not using yapf
for the argument formatting (or never use it).
Anyway, I strongly suggest that you take a look at Pydoc-Markdown 3, which you can find in the develop
branch at the moment. It will also be released on PyPI soon. There isn't currently a similar CLI to pydocmd simple
in v3, the closest you can get with the current CLI is
$ pydoc-markdown '{loaders: [{type: python, modules: [some_module], search_path: [.]}]}'
Output:
To disable the table of contents, add
, renderer: {type: markdown, render_toc: false}}
Hey @jdthorpe , I had some time to fix this for Pydoc-Markdown v2. This should be fixed in 2.1.1 (available on PyPI).
Trying to generate docs for a module like this:
by calling:
generates a
lib2to3.pgen2.parse.ParseError
withbecause the the string returned by
DEFAULT.__str__()
begins with a<
.