Reputation: 4155
does the output of help(something)
follow some markup language that is easy to format in html? I know about pydoc -w [topic]
but there are two problems:
pydoc -w
fails for some topics (http://stackoverflow.com/a/10333615/1318686)Below is some example output generated by help('def')
. It has some typical characteristics of other markup languages. E.g. spaces for code blocks, ` for inline code, ** to highlight...
Any ideas?
Thanks!
Function definitions
********************
A function definition
Multiple decorators are applied in
nested fashion. For example, the following code:
@f1(arg)
@f2
def func(): pass
just like a function defined by a lambda form. The "``def``" form is
actually more powerful since it allows the execution of multiple
statements.
**Programmer's note:** Functions are first-class
Upvotes: 0
Views: 94
Reputation: 318688
Most people use reStructuredText and use Sphinx to convert it to HTML and other formats.
There are no requirements on how to format the docstring of a function though.
Upvotes: 1