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 🙏

© 2026 – Pkg Stats / Ryan Hefner

somarkdown

v1.0.0

Published

A Markdown parsing library with support for math formulas, SMILES, code highlighting, and more components.

Readme

SoMarkDown

NPM version GitHub

SoMarkDown is a Markdown superset built upon markdown-it, providing enhanced support for professional rendering capabilities including mathematical formulas, chemical structures (SMILES), code syntax highlighting, and more.

SoMarkDown was established with the dual objective of delivering a powerful and flexible Markdown rendering solution for professional users while providing LLMs with a concise, unambiguous, and easily parsable Markdown standard. SoMarkDown also serves as the target protocol for parsing results in the SoMark document intelligence parsing product.

🧬 Key Features:

  • Markdown Superset: Compliant with CommonMark specification, fully compatible with standard Markdown.
  • Paragraph Mapping: Automatic injection of line number attributes, enabling essential functionalities like synchronized scrolling and mapping navigation similar to VSCode's Markdown implementation.
  • High-Speed Rendering: Optimized based on markdown-it, delivering fast rendering performance with support for large document processing.
  • Multiple Themes: Built-in support for various themes (light, dark, academic style).
  • Universal Compatibility: Supports both browser and Node.js server-side rendering.

✨ Specialized Components:

  • 📐 Mathematical Formulas: Integrated KaTeX support for LaTeX mathematical expressions, including mhchem chemical equation extensions.
  • 🧪 Chemical Structures: Integrated SmilesDrawer for rendering SMILES strings. Innovatively supports syntax merging between LaTeX and SMILES, significantly expanding chemical structure expression capabilities.
  • 🎨 Code Syntax Highlighting: Automatic detection and highlighting of code blocks through highlight.js.
  • 📑 Table of Contents Generation: Automatic generation of table of contents (TOC).
  • 🖼️ Image Understanding: Support for image comprehension and display.
  • 🏷️ Caption Support: Support for figure and table caption expressions.

Installation

Install via npm:

npm install somarkdown

For browser usage, include via CDN:

<script src="https://cdn.jsdelivr.net/npm/somarkdown/dist/somarkdown.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/somarkdown/dist/somarkdown.css">

Build from source:

git clone https://github.com/SoMarkAI/SoMarkDown.git
cd somarkdown
npm install
npm run build

Usage

Basic Usage

The project includes a browser example in example/browser. After compilation, you can directly open example/browser/index.html to view the demonstration.

Usage example in code:

import SoMarkDown from 'somarkdown';
import 'somarkdown/dist/somarkdown.css'; // Import base styles

const somarkdown = new SoMarkDown({
  lineNumbers: {
    enable: true
  }
});

const markdown = `
# SoMarkDown Demo

## Math
$$ E = mc^2 $$

Inline: $e^{i\\pi} + 1 = 0$

## Chemical Structure
$$\\smiles{CC(=O)Oc1ccccc1C(=O)O}$$

## Chemistry (mhchem)
$$ \\ce{CO2 + C -> 2 CO} $$
`;

const html = somarkdown.render(markdown);
console.log(html);

Configuration

You can pass a configuration object to the constructor:

const config = {
  linkify: true,     // Automatically convert URL-like text to links
  typographer: true, // Enable language-neutral replacements + quotes beautification
  
  // Core functionality configuration
  imgDescEnabled: true, // Whether to display image descriptions
  lineNumbers: {
    enable: true,    // Enable source code line number injection (for bidirectional synchronization)
    nested: true     // Whether to inject line numbers for nested blocks (list items, quotes, etc.)
  },

  // Plugin configuration
  katex: {
    throwOnError: false,
    errorColor: '#cc0000'
  },
  toc: {
    includeLevel: [1, 2, 3]  // Heading levels to include in TOC
  },
  smiles: {
    disableColors: false,  // Whether to disable colors in SMILES rendering
    width: 300,
    height: 200
  }
};

const somarkdown = new SoMarkDown(config);

Full configuration options are available in src/core/config.js.

Themes

SoMarkDown includes built-in themes that can be imported via somarkdown.css. Apply theme classes to containers:

  • theme-light: Light theme (default), suitable for general reading.
  • theme-dark: Dark theme designed for low-light environments, featuring deep colors and high contrast.
  • theme-academic: Academic-style theme optimized for research papers, with strong color contrast and larger fonts.

API Reference

new SoMarkDown(config)

Creates a new instance.

render(src: string): string

Renders Markdown source code to HTML string.

License

MIT