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

refactor: port mistletoe + MathJax changes from doc-gen #165

Merged
merged 5 commits into from
Feb 17, 2021

Conversation

bryangingechen
Copy link
Collaborator

@bryangingechen bryangingechen commented Feb 14, 2021

This ports the changes to the mistletoe CustomHTMLRenderer class from leanprover-community/doc-gen#110 that are needed to make it work well with MathJax:

  • moved all CustomHTMLRenderer code to mistletoe_renderer.py
  • added helper module mathjax_editing.py (only called by mistletoe_renderer)
  • added test file latex.md (will be viewable at https://leanprover-community.github.io/latex.html after this is deployed, but should not be linked to from anywhere else)

One non-MathJax-related change in behavior in CustomHTMLRenderer is that the syntax highlighting now defaults to lean, rather than attempting to guess a language. This makes it agree with both Zulip and doc-gen. I thus added info strings to the markdown files that needed them.

```latex
You can use LaTeX using `$$` to enclose inline LaTeX and
````md
```math
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, at least, was wrong previously.

@gebner
Copy link
Member

gebner commented Feb 16, 2021

Is this consistent with doc-gen?

@bryangingechen
Copy link
Collaborator Author

Is this consistent with doc-gen?

It will be now that leanprover-community/doc-gen#110 is merged. (I will try to backport some of the MathJax related changes here next.)

@bryangingechen
Copy link
Collaborator Author

Actually, let me rework this more along the lines of leanprover-community/doc-gen#110. Namely, I want to see if I can factor out the markdown processing into another module like I did there.

@bryangingechen bryangingechen marked this pull request as draft February 16, 2021 15:24
@gebner
Copy link
Member

gebner commented Feb 16, 2021

__pycache__ should probably be in gitignore.

@bryangingechen bryangingechen changed the title make syntax highlighting default to lean refactor: port mistletoe + MathJax changes from doc-gen Feb 16, 2021
@bryangingechen bryangingechen marked this pull request as ready for review February 16, 2021 21:49
@gebner gebner merged commit 120f854 into newsite Feb 17, 2021
@gebner gebner deleted the default_lean_syntax_highlight branch February 17, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants