Skip to content

Rafi993/pico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pico

Very small markdown like syntax parser

Why?

This parser allows you to use markdown like syntax or to build your own custom markdown parser with modules it provided easily

Installation

$ npm i pico-markdown-parser

or

yarn add pico-markdown-parser

Usage

You can use your parser as such or you can import sub modules from this parser and build your own parser easily

Simple usage

import pico from "pico-markdown-parser";

const htmlOutput = pico(`
  # Hello

  This is a sample text!!
`);

Advanced usage

import { choice, many, heading, bold, anything } from "pico-markdown-parser";

// This new parser now supports only bold and heading
const parser = (input) =>
  many(choice([heading, bold, anything]))
    .run(input)
    .result.join("");

const htmlOutput = parser(`
  # Hello

  This is a **sample** text!!
`);

Spec

Things supported by this parser are listed here

About

Really tiny markdown like syntax parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published