-
Notifications
You must be signed in to change notification settings - Fork 428
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
Feature request: math #208
Comments
Why bother if the README file is to be displayed on github anyways? This sounds like it should be a feature request for github's README renderer, not for grip. |
@JasonYao: I wasn't talking about README files, I'm thinking of .md files in general |
Right, I'm saying that if the github .md renderer doesn't render latex code, why would The main purpose of grip is to preview .md files and see how they'd look on github, if |
@JasonYao: yeah, I guess it depends on what people wanna use this for. I've found that If you're worried about divergence from github, make the LaTeX feature opt-in |
@krey Thanks for the kind words 😄 If you want to use Grip more generally, may I suggest using the Python API to inject the custom pieces you need? Something like: # gripjax.py
from grip import GitHubRenderer, Grip
MATHJAX_SCRIPT = """
<script async src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML"></script>
<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" onload="javascript:MathJax.Hub.Queue(['Typeset', MathJax.Hub]);">
"""
class MathJaxRenderer(GitHubRenderer):
def patch(self, html):
return super(MathJaxRenderer, self).patch(html) + MATHJAX_SCRIPT
Grip(renderer=MathJaxRenderer()).run() Then run Note that this is a bit of a hack. Namely, using I'm considering adding a way to more easily inject styles and scripts using the API or even globally with configuration. Until then, this should work for you. However, I don't plan to hardcode MathJax or any other custom library into this repo. Hope this helps! |
I'll just put it here: github/markup#897 |
@joeyespo it looks like f17a68a broke this quick fix. This is out of my wheelhouse, but happy to work on it to the extent that I can help |
It looks like github now support math equations. How can we achieve with grip? |
@ztlevi Is that true? Source or link to how it works? |
@nh2 I forget where I see it. But I just did a little google, and it turns out Gitlab supports it natively https://gitlab.com/gitlab-org/gitlab/blob/master/doc/user/markdown.md#math |
@ztlevi Ah, that's Gitlab though, not Github. Still interesting to know Gitlab supports it. |
Now GitHub supports math formulas (See this blog). Will this be supported by grip? |
It would be great to resurrect this, grip support for math to match GitHub previews would be very useful. |
Why does |
While GitHub does not support the insertion of latex into markdown, it would be a very useful feature for grip.
In-browser this can be using MathJax
The text was updated successfully, but these errors were encountered: