claudioc / jingo

Node.js based Wiki
MIT License
1.02k stars 185 forks source link

KaTeX support #226

Closed denkiwakame closed 5 years ago

denkiwakame commented 6 years ago

90 #84

I tried to implement TeX syntax support with minimal changes,

Thank you for distributing jingo.

Examples:

## $$: renders the center aligned expression in block
`$$ f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $$`
`$$ \begin{aligned}a = b+c \\ c=d+e\end{aligned}$$`

## $: renders the expression inline
matrix `$\mathbf{M}$`, vector `$\mathbf{v}^\top$`
equation `$f(x) = \int_{-\infty}^\infty \hat f(\xi)\,e^{2 \pi i \xi x}\,d\xi $`

Rendered as: image

claudioc commented 6 years ago

Hey @denkiwakame thank you for your contribution! :)

Unfortunately (but this is a problem with the current Jingo infrastructure) this PR is a bit too big to be included in the main branch. I guess the number of Jingo users using this feature will not big enough to justify all the assets it needs (fonts and css, for example). Additionally, on another PR someone asked to replace Marked with something more modern markdown parser (see https://github.com/claudioc/jingo/issues/187) which may or may not be compatible with Katex (I never used Latex myself, so I don't know).

Could you please provide a screenshot to attach to this PR in case someone would be curious to try it?

Thanks so much!

denkiwakame commented 6 years ago

@claudioc Thank your for your kind reply ! and I attached some examples and its screenshot in this PR.

Additionally, on another PR someone asked to replace Marked with something more modern markdown parser (see #187) which may or may not be compatible with Katex (I never used Latex myself, so I don't know).

also checked #229, I'm truly looking forward to using Jingo 2.0. Since I use jingo as daily research/coding notes, I would appreciate if you could consider supporting TeX in the future. TeX expression is also supported by Gollum wiki. Some of jingo-users may be interested in the functionality (I'm not so sure about the actual number though ...)

Unfortunately (but this is a problem with the current Jingo infrastructure) this PR is a bit too big to be included in the main branch.

I agree with u on that point, sorry for causing you trouble ... you can now close this PR. Again, thank you for distributing jingo!