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

docstrings styles #89

Open
igordertigor opened this issue Jan 25, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@igordertigor
Copy link

commented Jan 25, 2016

Does (and how) pdoc support different established docstring styles (e.g. google style, numpy style, javadoc, reST)? Are there other "best practice" docstring conventions for formatting docstrings using markdown?

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jan 25, 2016

This is all that happens: https://github.com/BurntSushi/pdoc/blob/master/pdoc/templates/html.mako#L62-L72

In my opinion, best practice is to simply describe the contract of the function you're documenting or the invariants of the data you're documenting. The latter can be somewhat tricky to do in Python, but it is one reason why pdoc goes to extra lengths to include documentation on instance variables, for example: https://github.com/BurntSushi/nfldb/blob/master/nfldb/types.py#L475-L479

I tend to also document the types of parameters when it makes sense too, typically by incorporating the type into the description of the contract.

pdoc doesn't otherwise have any rigid guidelines. For example, there's no markup to specifically describe the type of each parameter in a function like what reST supports.

@igordertigor

This comment has been minimized.

Copy link
Author

commented Jan 26, 2016

Thank you.

@peterjc

This comment has been minimized.

Copy link

commented Aug 24, 2017

See also #111 for supporting other markup languages like RST, epytext, ... as well as markdown.

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.