SomMark is a declarative, extensible markup language for structured content that can be converted to HTML, Markdown, MDX, JSON, and more.
Test SomMark features live here: https://adam-elmi.github.io/SomMark-Playground/
Warning
Old version(v1) is no longer supported.
SomMark lets you write structured content that can be converted to HTML, Markdown, JSON, or other formats. Unlike standard Markdown, it uses explicit syntax for blocks and elements, making content easier to process, customize, and transform.
To install the Command Line Interface (CLI) globally:
npm install -g sommarkYou can convert files using the terminal.
# Convert to HTML
sommark --html input.smark -o output
# Convert to Markdown
sommark --markdown input.smark -o output.mdYou can use SomMark in your JavaScript or Node.js projects.
import SomMark from "sommark";
const source = `
[Block]
Hello World
[end]
`;
const smark = new SomMark({
src: source,
format: "html"
});
console.log(await smark.transpile());- HTML
- Markdown
- MDX (Only ready components)
- JSON
Detailed guides and API references are available in the docs/ directory:
- Syntax Guide: Master SomMark syntax (Blocks, Inline, At-Blocks).
- Core API: Programmatic usage of the library (
transpile,lex,parse). - Mapper API: Guide for creating custom mappers and rules.
- CLI Reference: Command line options and configurations.
- API Quick Reference: Fast lookup for all classes and functions.
- Configuration Reference: Guide for creating custom configurations.
