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

Closed
igordertigor opened this issue Jan 25, 2016 · 4 comments
Closed

docstrings styles #89

igordertigor opened this issue Jan 25, 2016 · 4 comments

Comments

@igordertigor
Copy link

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
Copy link
Contributor

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
Copy link
Author

Thank you.

@peterjc
Copy link

peterjc commented Aug 24, 2017

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

@mhils
Copy link
Member

mhils commented Jan 19, 2021

I'm closing this in favor of #153. :)

@mhils mhils closed this as completed Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants