Convert markdown format to bootstrap style HTML

Source: Internet
Author: User

The files in markdown format are very popular these years, and the project documentation in GitHub is written in markdown format.

On the one hand, we can convert the markdown file to HTML through Pandoc, so that the HTML file can be explained by putting it on its own server. Install pandoc See my GitHub link.

On the one hand, Bootstrap is a better web front-end framework in recent years, so we want to convert markdown files to bootstrap-style HTML files. Already someone has done this module MARKDOWN2BOOTSTRAP.


1. Installing Nodejs and NPM

sudo apt-get install npmsudo apt-get install Nodejssudo ln-s/usr/bin/nodejs/usr/bin/node
The third line is to make a link, or you might encounter an error such as the following

/usr/bin/env:node:no such file or directory


2. Install Markdown2bootstrap to the current folder

NPM Install Markdown2bootstrap

If your computer is a proxy, you have to set up the NPM agent before using the above command, such as the following format

NPM Config set proxy=http://175.186.53.20:3128

3. Convert markdown to HTML command


Suppose you don't want to generate a list of numbers with-N parameters

./node_modules/.bin/markdown2bootstrap-n index.md

4. The final step is to copy the package to your site root folder, mine is ~/www

Cp-r Node_modules/markdown2bootstrap/bootstrap ~/www

This way your HTML files will be correctly explained on your website.

The interface style is as follows:



My OS is Ubuntu 14.04


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.