We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This may be a bug, or just me doing it wrong, but I don't know which.
I am able to implement custom filters to my docstrings using pdoc.render.env.filters, but these filters stop working if I ask for math mode.
pdoc.render.env.filters
hello.py
""" foo bar baz """ def foo(): """ foo bar baz """ return 0
make_doc.py
import pdoc print(pdoc.__version__) # prints out "15.0.1" def myfilter(txt): out = txt.replace('foo', 'FoO') return out pdoc.render.env.filters['myfilter'] = myfilter pdoc.render.configure(template_directory = 'pdoc_templates') # pdoc.render.configure(math = True) with open('index.html', 'w') as fid: fid.write(pdoc.pdoc('hello'))
pdoc_templates
math.html.jinja2
module.html.jinja2
{% extends "default/module.html.jinja2" %} {% macro docstring(var) %} {% if var.docstring %} <div class="docstring">{{ var.docstring | to_markdown | myfilter | to_html | linkify(namespace=var.qualname) }}</div> {% endif %} {% endmacro %}
FoO
foo
math = True
myfilter
15.0.1
The text was updated successfully, but these errors were encountered:
No branches or pull requests
This may be a bug, or just me doing it wrong, but I don't know which.
Problem Description
I am able to implement custom filters to my docstrings using
pdoc.render.env.filters
, but these filters stop working if I ask for math mode.Steps to reproduce the behavior:
hello.py
:make_doc.py
to generate documentation:pdoc_templates
directory with the following files:math.html.jinja2
, copied from source with no modificationsmodule.html.jinja2
with the following contents:make_doc.py
and check the output, which usesFoO
instead offoo
, as intended.make_doc.py
withmath = True
.make_doc.py
again. The output now usesfoo
everywhere, implying thatmyfilter
was ignored.System Information
15.0.1
The text was updated successfully, but these errors were encountered: