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

Formulas in pdoc #87

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

Comments

Projects
None yet
3 participants
@igordertigor
Copy link

commented Jan 18, 2016

I really like pdoc and I'm considering to use it for a machine learning project. Yet, with machine learning documentation it is often useful to also include formulas in some places. Are there plans to allow for mathematical equations in pdoc any time soon? Or does pdoc even support equations already and I just didn't see it?

@igordertigor

This comment has been minimized.

Copy link
Author

commented Jan 18, 2016

I feel that a simple way to solve this would be to include the following in pdoc/templates/html.mako line 455:

<script type="text/javascript" async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML"> </script>

This way, the resulting html file would support mathjax style formulas. I can send a patch if desired.

@BurntSushi

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2016

pdoc interprets doc strings as Markdown. That's the extent of formatting done.

I'm not keen on maintaining support for formula formatting in pdoc proper. I think it is a useful but niche feature. This is one of the reasons why I separated out the templates from core pdoc so that they could be customized downstream. I admit that this didn't work out as well as I'd hoped, since the view logic is quite complex and likely to be changed/tweaked over time.

You could add this yourself by copying html.mako and modifying it to support formula formatting. pdoc can then be configured to use your custom template.

@igordertigor

This comment has been minimized.

Copy link
Author

commented Jan 18, 2016

Thank you, that sounds like a good option.

@cortesi

This comment has been minimized.

Copy link
Member

commented Jun 3, 2018

Please see #153 for a unified discussion ticket about docstring flavors.

@cortesi cortesi closed this Jun 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.