Giter Club home page Giter Club logo

Comments (5)

hagenw avatar hagenw commented on May 24, 2024

Hi, thanks for the suggestion.
So far it is not supported. For me as a non-expert regarding Node.js, the documentation provided by KaTeX was not sufficient to consider it.

Are you able to create a pull request for it?

from sphinxcontrib-katex.

ezyang avatar ezyang commented on May 24, 2024

I'd have to look into it. What I expect to happen is that we invoke KaTeX via nodejs, it gives a bunch of html, and then we need to dump it into the Sphinx generated HTML. So, shouldn't be too bad, if this extension is setup to inject raw html (which it should be?)

from sphinxcontrib-katex.

hagenw avatar hagenw commented on May 24, 2024

yes, it injects HTML, compare

def html_visit_math(self, node):
self.body.append(self.starttag(node, 'span', '', CLASS='math'))
self.body.append(self.builder.config.katex_inline[0] +
self.encode(get_latex(node)) +
self.builder.config.katex_inline[1] + '</span>')
raise nodes.SkipNode
def html_visit_displaymath(self, node):
self.body.append(self.starttag(node, 'div', CLASS='math'))
if node['nowrap']:
self.body.append(self.encode(get_latex(node)))
self.body.append('</div>')
raise nodes.SkipNode
# necessary to e.g. set the id property correctly
if node['number']:
number = get_node_equation_number(self, node)
self.body.append('<span class="eqno">(%s)' % number)
self.add_permalink_ref(node, _('Permalink to this equation'))
self.body.append('</span>')
self.body.append(self.builder.config.katex_display[0])
self.body.append(get_latex(node))
self.body.append(self.builder.config.katex_display[1])
self.body.append('</div>\n')
raise nodes.SkipNode

from sphinxcontrib-katex.

ezyang avatar ezyang commented on May 24, 2024

This ended up being pretty easy. I'll post a shitty version of the patch (that breaks some existing functionality and is not configurable) and maybe we can talk about how to support the other bits correctly.

from sphinxcontrib-katex.

hagenw avatar hagenw commented on May 24, 2024

KaTeX server side pre-rendering is included with sphinxcontrib-katex 0.5.0.

from sphinxcontrib-katex.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.