1.0.3 • Published 4 years ago

markconv v1.0.3

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

markconv

Feature-rich markdown converter currently supporting HTML and PDF

Quick start

# Install markconv globaly to use in cli
npm i markconv -g

# Example cli command
markconv source=MyFile.md format=pdf

API example

Features

How to use

CLI

# Install markconv globaly
npm i markconv -g

# Use markconv in CLI
markconv --help

API

Install markconv

npm i markconv

Use markconv in your code

const markconv = require('markconv')
const fs = require('fs')

markconv({
    source: "MyFile.md",
    style: "style.css",
    output: "pdf"
},
{
    pdf: {
        sandbox: false,
        page: {
            format: 'A6',
            margin: {
                left: '30px',
                right: '30px',
                top: '30px',
                bottom: '30px'
            }
        }
    }
}).then(file => {
    // Your code here, e.g.:
    fs.writeFileSync(`./MyPDF.pdf`, file, "utf-8")
})

Markdown helpers

Page Break

# First page
---
# Second page
<hr>
# Third page

TOC Generator

@[toc]