Skip to content

segmsh/md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

@segmsh/md

Markdown processor for segm.sh. This package parses Markdown files into a document (AST + segments) and stringifies them back, preserving structure while allowing content extraction.

Installation

npm install @segmsh/md

Usage

import MdProcessor from "@segmsh/md";

const processor = new MdProcessor();

const mdContent = "# Hello world";
const document = processor.parse(mdContent);

// ... modify document segments ...

// Stringify back to Markdown
const newMdContent = processor.stringify(document);

Features

  • Structure Preservation: Maintains the original structure of the Markdown document.
  • Round-trip: Ensures that parsing and then stringifying results in the original Markdown structure, preserving as much formatting as possible.

Development

Build

npm run build

Test

npm test

License

Apache-2.0

About

MD processor

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors