使用Pandoc批量markdown转html

安装Pandoc

$ sudo apt-get install pandoc

html输出(单文件):

$ pandoc Release-Notest.md -o Release-Notes.html

pdf输出(单文件):

$ pandoc Release-Notest.md -o Release-Notes.pdf

批量:

$ ls *.md > 1.txt
$ cat 1.txt |while read line
> do
> pandoc $line -o $line.html -H header.txt -A footer.txt
> done

-H FILE, –include-in-header=FILE
在header尾部插入文本中的内容.

-B FILE, –include-before-body=FILE
紧跟body后部插入文本中的内容.

-A FILE, –include-after-body=FILE
在body尾部插入文本中的内容.

# pandoc要求输入输出使用utf8编码,可以使用iconv命令进行编码转换

$ iconv -t utf-8 input.txt | pandoc | iconv -f utf-8

更多:
https://pandoc.org/MANUAL.html

Ubuntu 14安装Python 3.6

安装python3.6

sudo add-apt-repository ppa:jonathonf/python-3.6
sudo apt-get update
sudo apt-get install python3.6

如果提示没有add-apt-repository

sudo apt-get install software-properties-common

用python3.6替换python2.7

sudo rm /usr/bin/python
sudo ln -s /usr/local/bin/python3.6 /usr/bin/python

python –version

CentOS安装一些常用包

常用的软件包
Python-pip

rpm -iUvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

#添加EPEL(Extra Packages for Enterprise Linux)源

yum update
yum install python-pip
pip install –upgrade pip

#自更新pip,因为EPEL里面的pip版本还是挺旧的

PHP7+Apache2 Httpd

rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install php70w php70w-cli php70w-opcache php70w-common