see #72: use travis-ci

This commit is contained in:
Changkun Ou
2019-07-15 11:54:30 +02:00
parent 407f6eda32
commit 325b9664a8
13 changed files with 101 additions and 32 deletions

View File

@@ -11,21 +11,21 @@ revision:
pdf: markdown
@echo "Compiling PDF file..."
@pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
--title-prefix $(title) \
--listings -H meta/cpp-listings.tex \
--template=meta/template.tex \
--pdf-engine=`which xelatex`
@echo "Done."
@rm *.md revision.tex
rm *.md revision.tex
markdown:
@echo "Copy markdown files..."
@cp -r ../../book/en-us/* .
cp -r ../../book/en-us/* .
@echo "Aggregating markdown files..."
@python3 aggregator.py
python3 aggregator.py
clean:
rm -rf revision.tex *.md *.pdf
rm -rf revision.tex *.md
.PHONY: markdown pdf clean

Binary file not shown.

View File

@@ -11,21 +11,21 @@ revision:
pdf: markdown
@echo "Compiling PDF file..."
@pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
pandoc -f markdown+smart -s $(filename).md -o $(filename).pdf \
--title-prefix $(title) \
--listings -H meta/cpp-listings.tex \
--template=meta/template.tex \
--pdf-engine=`which xelatex`
@echo "Done."
@rm *.md revision.tex
rm *.md revision.tex
markdown:
@echo "Copy markdown files..."
@cp -r ../../book/zh-cn/* .
cp -r ../../book/zh-cn/* .
@echo "Aggregating markdown files..."
@python3 aggregator.py
python3 aggregator.py
clean:
rm -rf revision.tex *.md *.pdf
rm -rf revision.tex *.md
.PHONY: markdown pdf clean

View File

@@ -1,19 +1,21 @@
# !/usr/bin/env python3
# author: changkun<hi@changkun.us>
import os
import os, io
chapters = ['00-preface.md', '01-intro.md', '02-usability.md', '03-runtime.md', '04-containers.md', '05-pointers.md', '06-regex.md', '07-thread.md', '08-filesystem.md', '09-others.md', '10-cpp20.md', 'appendix1.md', 'appendix2.md']
ignores = ['TOC', '返回目录', '许可', 'license']
with open('modern-cpp-tutorial.md', 'w') as outfile:
outfile.write("""---
head = """---
title: "高速上手 C++11/14/17/20"
author: 欧长坤 <hi@changkun.us>
copyright: cc-by-nc-nd 4.0
---
""")
"""
with io.open('modern-cpp-tutorial.md', 'w', encoding='utf8') as outfile:
outfile.write(head)
for chapter in chapters:
if os.path.isfile(chapter):
with open(chapter) as ch:

Binary file not shown.