Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
/ markconv Public archive

Feature-rich markdown converter currently supporting HTML and PDF

Notifications You must be signed in to change notification settings

devicarus/markconv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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]