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

How to run from the Python IDLE? #51

Closed
karimbahgat opened this issue May 29, 2015 · 1 comment

Comments

Projects
None yet
2 participants
@karimbahgat
Copy link

commented May 29, 2015

The package docs says pdoc is mostly a commandline tool and those were the only examples given. However, it was briefly mentioned that one could use pdoc.Module class or pdoc.html function but without much detail. I tried it and I got an error that pdoc was giving an unexpected argument to the markdown module, possibly due to changes in a newer version of Markdown?

Am I doing it wrong, is there a standard way of using pdoc from Python? There are many cases and for many users that running pdoc from within Python would be preferred.

>>> import pdoc
>>> pdoc.html("pyagg")

Traceback (most recent call last):
  File "<pyshell#13>", line 1, in <module>
    pdoc.html("pyagg")
  File "C:\Python27\lib\site-packages\pdoc\__init__.py", line 270, in html
    link_prefix=link_prefix, source=source)
  File "C:\Python27\lib\site-packages\pdoc\__init__.py", line 675, in html
    **kwargs)
  File "C:\Python27\lib\site-packages\mako\template.py", line 443, in render
    return runtime._render(self, self.callable_, args, data)
  File "C:\Python27\lib\site-packages\mako\runtime.py", line 803, in _render
    **_kwargs_for_callable(callable_, data))
  File "C:\Python27\lib\site-packages\mako\runtime.py", line 835, in _render_context
    _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
  File "C:\Python27\lib\site-packages\mako\runtime.py", line 860, in _exec_template
    callable_(context, *args, **kwargs)
  File "_html_mako", line 237, in render_body
  File "_html_mako", line 37, in show_module
  File "_html_mako", line 479, in render_show_module
  File "_html_mako", line 110, in mark
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 493, in markdown
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 159, in __init__
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 185, in registerExtensions
    ext_args = ext_name[pos+1:-1]
  File "C:\Python27\lib\site-packages\markdown\__init__.py", line 291, in build_extension
    root = self.parser.parseDocument(self.lines).getroot()
TypeError: makeExtension() got an unexpected keyword argument 'linenums'
@cortesi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2018

Hi there - use from the REPL is not a priority for now, I think. It's possible that we could sprout an API for interactive use later on, but I'd want it to be pretty well motivated.

@cortesi cortesi closed this Jun 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.