-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
How to enable markdown extensions? #158
Comments
It's non-amendable as nobody needed/proposed it yet. Seems reasonable. I think template tunables would allow for greater configurability (e.g. extension configs). A PR would be much appreciated. 👍 |
I could spend some time on implementing this, but have no idea what you mean by "template tunables" and haven't worked with mako templates before. Could you point me in the right direction? Specifically I'm not quite sure in which of the templates this should be added. I'm assuming you would want to move the whole list of extensions and config into some template, so users can also choose to leave out extensions, or are there any extensions that pdoc depends on, so must be kept in? |
Great! Sorry, I meant config.mako template, which is consulted before rendering the real html/text/pdf templates.
I'm not sure, best run the tests and see. Lines 356 to 365 in 1709915
I'm afraid creating a new markdown converter instance for each piece of docstring will be too inefficient. The alternative is a CLI switch |
Okay, let's append things then. I think I like a template-based solution, as it keeps the functionality for CLI and programmatic usage the same. Would handling it exactly the same as the LaTeX maths be an acceptable solution? Lines 17 to 18 in 1709915
A problem with this solution is that you can't deregister an extension like you can deregister patterns, meaning that you can't use different extensions during the same run. Is this a problem? If so, the global Lines 69 to 90 in 1709915
Some stuff for (future) reference
|
Lines 17 to 18 in 1709915
I must say, this looks one hella ugly piece of hack, sending values back and forth like insane. I'm not sure that wasn't a mistake. I wonder if most preferences couldn't instead be applied earlier, like in Lines 93 to 121 in 1709915
|
Expected Behavior
I am looking for some configuration switch to tell Python Markdown which extensions to use, specifically something like PyMdown Extensions to enable task-lists and strike-through.
Actual Behavior
The list of extensions seems to be hard-coded and not amendable using templates (or consequently command-line arguments).
See:
pdoc/pdoc/html_helpers.py
Line 69 in 1709915
Steps to Reproduce
N.A.
Additional info
The text was updated successfully, but these errors were encountered: