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

Add NumPy Docstring Style Support #52

Closed
EthanC opened this issue Dec 28, 2019 · 9 comments · Fixed by #69
Closed

Add NumPy Docstring Style Support #52

EthanC opened this issue Dec 28, 2019 · 9 comments · Fixed by #69
Labels
enhancement New feature or request

Comments

@EthanC
Copy link

EthanC commented Dec 28, 2019

Just as discussed in #47 with the Google Docstring format, it would be great to have support for NumPy Docstrings; An example of which can be found here.

@TejasAvinashShetty
Copy link

Maybe one could make use of mktheapidocs plugin from Mkdocs plugins list

@tcbegley
Copy link

@TejasAvinashShetty have you managed to get that working? I tried it, but don't think I configured things quite correctly.

@TejasAvinashShetty
Copy link

Nope, I have not tried it yet. I just suggested it as a quick fix. Hopefully, when I get time I will try it out.

@lsorber
Copy link

lsorber commented Aug 16, 2020

  • Are there any plans to support NumPy-style docstrings?
  • If not, what is the recommended documentation format to use with portray? In my opinion, Markdown is by itself is not a documentation format but a document markup language.

@timothycrosley timothycrosley added the enhancement New feature or request label Aug 27, 2020
@rtbs-dev
Copy link

@timothycrosley @kylebarron @sanzoghenzo This is possible to solve once this is merged. However, portray is using it's own text.mako, it appears, so installing the PR doesn't directly solve this issue.

Is it possible to make portray rely on the pdocs mako template by default? Otherwise the files will need to be updated in both places to maintain feature parity.

@sanzoghenzo
Copy link
Contributor

I see that portray's template adds a class_level variable to the function function that determines the level of the heading ("h3" if class_level is false, "h5" otherwise); pdocs has it fixed at "h4".

@timothycrosley is this an intended feature, or can this be merged in pdocs and proceed as @tbsexton asked?

@rtbs-dev
Copy link

rtbs-dev commented Oct 6, 2020

Following up to link the work @sanzoghenzo and @kylebarron did on pdocs that adds the mentioned class_level and enables other docstring formats.

I suppose the last step is relying on pdocs' own text.mako, or at least duplicating the functionality from there. I believe mako has the ability to inherit/extend templates?

@sanzoghenzo
Copy link
Contributor

I didn't test it, but I think all that is needed is to remove the text.mako file and this line, so that portray doesn't force the default template and pdocs uses its own.

@JannikKlauke
Copy link

@sanzoghenzo I monkey patched it locally and it seems to work by deleting that line and the default text.mako. At least for very simple documentations mixing several docstring styles produced no errors and looked clean to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants