-
-
Notifications
You must be signed in to change notification settings - Fork 146
Docstrings using reST missing formatting. #243
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
Comments
Duplicate of #110. ReST support, other than some explicitly listed directives, is non-existent. Text is interpreted as markdown. Have tried to override default Lines 17 to 18 in cd84fb3
# config.mako:
def to_html(text):
return text.replace('\n', '<br>') |
I was able to follow the little breadcrumb kernc provided and I wanted to expand it for others that are looking to sort out the same issue. It appears pdoc allows you to customize how things are rendered via some config files. These are discussed more here: https://pdoc3.github.io/pdoc/doc/pdoc/#custom-templates. So what I did is I created a directory in my project that I called I then updated the
This caused the rendered template to treat the docstring as preformatted text. This broke all other rendering, which is fine for us, but markdown and such will not be rendered. Kernc did reference |
I did mean config.mako. I was under the impression function overrides in config.mako are used preferentially. Apparently this is not the case. 😬 |
I get that there is limited support for reST, but docstrings using that format seem to turn into a jumbled mess in the HTML documentation as the carriage returns are stripped out. Is there a way to just have the docs include the docstring as a preformatted text? I didn't see this option in the docs, so if I missed it then I apologize.
For example, I have this function:
`def clear_evaluations(rule_name: str, region: str = None, session: boto3.Session = boto3.Session()) -> None:
"""Clears the evaluations for a specified config rule.
But in the HTML docs it shows up as shown in this screenshot which is hard for a human to read:
I tried the Google style and that does come out formatted well, but all our docstrings are in reST given that is the default for PyCahrm. I don't care about bolding or any other format of the text, just want the carriage return preserved so it's human-readable.
Thanks for any guidance you can provide.
Additional info
$ pip freeze | grep pdoc pdoc3==0.8.4
The text was updated successfully, but these errors were encountered: