Giter Site home page Giter Site logo

md2html's Introduction

md2html

Markdown to single HTML converter.

Feature

The md2html converts Markdown to a single file HTML.
All scripts and css will be embedded in the file
and thus the converted file is viewable even offline.
Additionally, the md2html has option to embed image to HTML by base64 encode
and hence the file is conveyable without any resources.

Sample

GitHub Pages

The html file is generated by following command

md2html example/*.md -e -t -m -s -f example/img/go.png -c example/css/custom-css.css -o gh-pages/index.html --html-title 示例文档

Installation

go install github.com/godoes/md2html/v2@latest

Usage

md2html -i <input Markdown> [-o <output HTML>] [-h <custom html title>] [-e] [-t] [-m] [-s] [-f <path to icon>]

if -o option was abbreviated, input Markdown file name + .html will be used as output HTML file name.

Embedding images

-e/--embed option enables embedding images that are located local storage by Base64 encoding.

Specify HTML title

-h/--html-title option enables setting custom html title, default is the output file name.

TOC

-t/--toc option enables generating TOC.

Using MathJax

-m/--mathjax option enables using MathJax.

Table row/col span

-s/--span option enables using rowspan/colspan for table tag

Favicon

-f/--favicon <path/to/icon> option enables embedding icon for favicon

Add custom CSS

-c/--css <path/to/css> option enables additional CSS

Example

Please execute the following commands to make example files.

# make html files from each markdown files
$ md2html -e example/*.md

# make a concatenated single html file from markdown files
$ md2html -e -t example/*.md -o example/concat.html

Custom JS & CSS

$ go get -d github.com/godoes/md2html
$ cd ${GOPATH}/src/github.com/godoes/md2html

###########################################################
# customize "{$GOPATH}/src/github.com/godoes/md2html/src/" #
###########################################################

$ npm install && gulp
$ assets.go.rb
$ go install

Use libraries

Go

JS

CSS

md2html's People

Contributors

nocd5 avatar itanken avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.