npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@mathcrowd/mmarked

v1.8.2

Published

A customized markdown parser/renderer with tex2svg.

Downloads

744

Readme

mmarked

npm version License: Custom

A powerful TypeScript library for rendering customized markdown syntax with LaTeX support, designed for mathematical visualization in educational contexts.

🌟 Features

  • Full CommonMark syntax support: Comprehensive compatibility with CommonMark standards.
  • 🔢 Footnotes Blocks: Supports rendering auto-numbered footnotes with easy reference links.
  • 📘 Theorem-like blocks: Supports rendering mathematical theorems, lemmas, and examples in a block format with titles, auto-numbering, and reference links.
  • 🖼️ Image resizing capabilities: Allows for customizable rendering of images and videos using simple syntax.
  • 🔍 Hidden/show solution blocks: Provides a solution block with a toggle button for easy visibility control, implemented with straightforward syntax.
  • 🧮 TeX to SVG conversion: Converts TeX equations to scalable vector graphics for high-quality rendering.
  • 🔗 Easy Integration with Existing Systems: Supports both server-side and browser-side implementations for flexible use.

🚀 Quick Start

Editor Integeration

Use mmarked in VSCode : https://marketplace.visualstudio.com/items?itemName=MCLab.mmarked

Server Side Integration

Installation

npm install @mathcrowd/mmarked mathjax-full highlight.js

Basic Usage

import { tex2svg, renderMarkdown } from '@mathcrowd/mmarked'

// Convert TeX to SVG
const svg = tex2svg('$x^2$')

// Render Markdown to HTML
const html = renderMarkdown('### Heading').parsed

Web Browser Side Integration

<!doctype html>
<html>

<head>
    <meta charset="utf-8" />
    <title>Marked in the browser</title>
</head>

<body>
    <div id="content"></div>
    <script src="dist/browser.umd.js"></script>
    <script>
        const { tex2svg, renderMarkdown } = marked
        document.getElementById('content').innerHTML =
            tex2svg(renderMarkdown('# Marked in the browser \n\n $x^2+y^2=1$ \n\nRendered by **mmarked**.').parsed);
        console.log(renderMarkdown('# Marked in the browser\n\nRendered by **mmarked**.').lexed)
    </script>
</body>

</html>

📚 API Reference

| Function | Description | |----------|-------------| | tex2svg(tex: string): string | Converts TeX to SVG in HTML format | | renderMarkdown(markdown: string): {parsed:string, lexed: Token[], time: number} | Renders Markdown to HTML | | renderMarkdownCompact(markdown: string): {parsed:string, lexed: Token[], time: number} | Renders Markdown to HTML without <p> tags |

⚠️ Important: Always purify the output HTML using DOMPurify to prevent XSS attacks.

📖 Documentation

For detailed documentation in Chinese, visit our Product Page.

🎮 Demo

Try out our interactive demo here.

👥 About Mathcrowd

Mathcrowd is an innovative startup founded by experienced independent developers and mathematics educators. We're on a mission to revolutionize math education in China through cutting-edge technology. Our goal is to create an engaging online community for math enthusiasts and self-learners, offering rich, interactive, and visualized learning content.

🌐 MCLab Official Website: https://lab.mathcrowd.cn

🌐 Our Online Math Community: https://www.mathcrowd.cn

💬 Join Our Discord: https://discord.gg/6VMUVA5Yq2

📄 License

LICENSE

For commercial use, please contact [[email protected]] for details on commercial licensing.

🤝 Contributing

We welcome contributions! Please see our Contributing Guidelines for more details.

📞 Support

For any questions or issues, please open an issue on our GitHub repository.