Skip to content

Commit 73cff61

Browse files
committed
2 parents 41c61bb + b257133 commit 73cff61

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

taiyangxue/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Python 代码实例
22

3+
- [pypandoc](https://github.com/JustDoPython/python-examples/tree/master/taiyangxue/pypandoc) : 神器 Pypandoc —— 实现电子书自由
34
- [python-thread](https://github.com/JustDoPython/python-examples/tree/master/taiyangxue/python-thread) : 这么一搞,再也不怕线程打架了
45
- [python-op2](https://github.com/JustDoPython/python-examples/tree/master/taiyangxue/python-op2) : 只需一招,Python 将系统秒变在线版!
56
- [python-op](https://github.com/JustDoPython/python-examples/tree/master/taiyangxue/python-op) : YYDS! Python 帮我扛起运营大旗!

taiyangxue/pypandoc/code.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import pypandoc
2+
3+
input = "**Hello World!**"
4+
output = pypandoc.convert_text(input, 'html', format='md')
5+
6+
print(output)
7+
8+
input = """
9+
# Pandoc
10+
11+
Pandoc 是个牛X的工具
12+
13+
## 用法
14+
15+
- `convert_text`
16+
- `convert_file`
17+
"""
18+
output = pypandoc.convert_text(input, 'html', format='md')
19+
print(output)
20+
21+
output = pypandoc.convert_text(input, 'rst', format='md')
22+
print(output)
23+
24+
convert_test(input, 'epub', format='md', outputfile='test.epub')

0 commit comments

Comments
 (0)