Giter VIP home page Giter VIP logo

Comments (4)

PanPeople avatar PanPeople commented on June 14, 2024 1

Thank you very much

from zero-md.

zerodevx avatar zerodevx commented on June 14, 2024

Hi, do you have an example or a reproduction of what you wish to do?

from zero-md.

PanPeople avatar PanPeople commented on June 14, 2024

Hmmm... example would be fine.
But here how i want to make it:

my-markdown.md looks like that:
##Hello World
$a_2 + b^2 = d^e $

part of my site:

How it looks:
No conversion at all even if i add special settings to math_jax script part which allow me to use $ $

from zero-md.

zerodevx avatar zerodevx commented on June 14, 2024

So.. say you have a markdown file:

my-markdown.md:

## Hello World

$a_2 + b^2 = d^e $

and you have a HTML file:

index.html:

<head>
  <!-- Configure your MathJax settings here -->
  <script>
    MathJax = {
      tex: {
        inlineMath: [ ['$', '$'], ['\\(', '\\)'], ],
      },
    };
  </script>

  <!-- Load `zero-md` -->
  <script async src="https://cdn.jsdelivr.net/gh/zerodevx/zero-md@1/src/zero-md.min.js"></script>
</head>
<body>
  <!-- Add the `no-shadow` attribute -->
  <zero-md id="md" src="my-markdown.md" no-shadow></zero-md>

  <!-- Load the MathJax library AFTER markdown is rendered -->
  <script>
    md.addEventListener('zero-md-rendered', () => {
      let el = document.createElement('script');
      el.src = 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js';
      document.head.appendChild(el);
    });
  </script>
</body>

Here's the working example: https://plnkr.co/edit/SdzWj39SOVpntGTn?open=lib%2Fscript.js

from zero-md.

Related Issues (20)

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.