Giter Club home page Giter Club logo

tongjian's Introduction

《资治通鉴》胶片版

Netlify Status

TLDR: https://tongjian.qiaopang.com

作为一个喜欢且经常读史读古文的程序员,《资治通鉴》这样的大部头我读起来还是觉得非常费力。首先是时间上的开销很大 —— 一页纸往往要读上半小时到一小时,其中免不了查阅词典,了解生僻字词的读音和释义;其次是难以深度阅读 —— 大量的地名人名和时间的关系,无法很快厘清,因而对错综复杂的历史事件读之依旧是懵懵懂懂;再次,无论是实体书的阅读,还是电子书的阅读,笔记都很难处理,比如人物的图像,事件(主要是战争)的地图,无法和原文很好地一一对照。最后,三百万字,二百九十四卷的内容,往往令读者还未开始阅读便自我放弃了。

于是我便萌生了制作《资治通鉴》胶片版的念头。我可阅读的时间往往比较碎片化,所以希望闲暇时可以读上一小段,这样不必抱着大部头望而兴叹;我希望文档本身是活的,帮助理解内容的佐料(注释,图片,地图等)可以不断以一种简单轻量的方式被添加进来;此外,文档本身应该是精美的,看着舒服。这便是这个胶片版的最初的目标。

这个目标进一步细化,便成了这个样子:

  • 选取质量上乘的《资治通鉴》 txt 版本
  • 将文档切分成 294 卷,每卷一个胶片
  • 自动生成符合 marp 格式的胶片,做一些格式上的处理
    • 为引文生成不同的格式
    • 每页胶片都自动放置一个 audio tag,可以播放本页的语音素材,比如:臣光曰
  • 找相熟的小伙伴们创作每一张胶片的语音素材 为每一张胶片自动生成语音素材
  • 通读之,添加注释,相关图片和地图

制作出来的 slides 截图如下:

运行

本地需要有 nodejs 运行时,然后安装依赖:

make init
make dep

之后可以 make run 运行 http 服务器。服务器运行完毕后,可以在浏览器中打开 http://localhost:8080/ 查阅。

如果要批量生成 html / pdf 版本,可以 make build 或者 make build-pdf

语音素材的生成

《资治通鉴》胶片版内的所有语音素材均使用 科大讯飞开放平台 的在线语音合成技术提供。目前使用的发音人为 讯飞楠楠。感谢科大讯飞的开放平台,我得以自动化生成所有语音素材。由于目前我使用的免费版有日 API 访问上限,所以所有内容生成语音素材尚需时日。

如果你想生成自己的语音素材,可以在科大讯飞开放平台创建账户,生成你的 appid / app_key,并将其配置到环境变量 XF_TTS_IDXF_TTS_KEY 中。之后你可以使用 make gen-audios CHAPTER=xxx 来生成对应卷的语音素材。

如果你对生成语音素材感兴趣,可以看这几个工具:

  • tools/cli/normalizer.js: 把原始的文本素材转化为 JSON。
  • tools/cli/generator.js: 将 JSON 转化为 marp slides。
  • tools/cli/tts.js: 读取 resources/_meta 中的文件,按章节生成语音素材。

如何编辑及添加素材

所有的素材都放在 slides/assets 下,按卷命名。

添加图片或者地图

以这张 slide 为例:

可以把对应的图片拷贝至 assets/images/001/jinyang.jpg,然后在对应的 slide 页中使用 marp 的 图片语法,如下:

---

![bg left](assets/images/001/jinyang.jpg)

![](assets/audios/001/16.mp3)

赵襄子使张孟谈潜出见二子,曰:__「臣闻唇亡则齿寒。今智伯帅韩、魏而攻赵,赵亡则韩、魏为之次矣。」__ 二子曰:__「我心知其然也,恐事末遂而谋泄,则祸立至矣」__ 。张孟谈曰:__「谋出二主之口,入臣之耳,何伤也?」__ 二子乃阴与张孟谈约,为之期日而遣之。襄子夜使人杀守堤之吏,而决水灌智伯军。智伯军救水而乱,韩、魏翼而击之,襄子将卒犯其前,大败智伯之众。遂杀智伯,尽灭智氏之族。唯辅果在。

---

添加注释

注释使用 abbr 完成。以这张 slide 为例:

要注释的内容用 *[]: 括起来,注释放在 : 后即可。注意如果注释的内容前后没有标点或者空格,需要再原文中手工插入空格。

---

![](assets/audios/001/11.mp3)

及智宣子卒,智襄子为政,与韩康子、魏桓子宴于蓝台。智伯戏康子而侮段规,智国闻之,谏曰:__「主不备,难必至矣!」__ 智伯曰:__「难将由我。我不为难,谁敢兴之?」__ 对曰:__「不然。《夏书》有之曰:‘一人三失,怨岂在明,不见是图。’夫君子能勤小物,故无大患。今主一宴而耻人之君相,又弗备,曰不敢兴难,无乃不可乎!蜹、蚁、蜂、虿,皆能害人,况君相乎!」__ 弗听。

*[蜹]: ruì,指蠛 miè 蠓 měng,"醯酸而蠛蠓聚焉。" 《荀子 劝学篇》;古同「蚋」:"蚋蚁蜂虿,皆能害人。"

---

添加脚注

脚注比较特殊,正常的 markdown 脚注会放在整个文档最后,并不方便阅读,这里生成了 <div class="note"> 完成。以这张 slide 为例:

其语法是在要注释的地方使用上标语法 ^xx^,然后用 ::: note::: 标注脚注的开始和结束。

---

![](assets/audios/001/64.mp3)

秦侵晋^1^。


::: note
在《吴子 励士 第六》中有这样两段文字:“行之三年,秦人兴师,临于西河,魏士闻之,不待吏令,介胄而奋击之者,以万数。”,“于是武侯从之。兼车五百乘,骑三千匹,而破秦五十万众。”区区52个字,记录了阴晋之战的经过。
:::

---

贡献

目前的版本是自动生成的,还很粗糙,我自己也在边读边整理。如果你遇到任何问题,欢迎提 issue,当然跟欢迎发 pull request。

鸣谢

河洛·基督大伯爵

原始 txt 素材来自 河洛中文社区,由【河洛·基督大伯爵 】整理校对。

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
 精校小说尽在河洛中文社区:http://www.horou.com/
 本电子书由【河洛·基督大伯爵 】整理校对,请勿转载。
 版权归原作者所有,文本仅供试读,请勿用于一切商业用途!
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

科大讯飞开放平台

tts 的质量相当上乘,在此感谢!

tongjian's People

Contributors

tyrchen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tongjian's Issues

Weekly Digest (27 October, 2019 - 3 November, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 5 stagazers.
l00c00l
zhuxiaoyi
eddiechen1008
JPCui
kunzhang2
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (22 September, 2019 - 29 September, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 19 stagazers.
boenfu
LYLsGit
hqdmyjsw
jiaxinxuan
chenjiaxi1993
sxyuanhAlex
yxw
cx2c
boyangwang
github-amazingboy
unknow16
BeeDances
SeauWong
fishSteak
winguse
inrtgdje
suyeq
run-ze
lengthmin
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (6 October, 2019 - 13 October, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 6 stagazers.
ncihnegn
joshua7v
Miazzy
jaydinwang
xutunan
qiangshou007
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (3 November, 2019 - 10 November, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 2 stagazers.
lijian-cai
AiDaiP
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (13 October, 2019 - 20 October, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 6 stagazers.
damonchen
chnape
consolejs
yemahuang
zela2
mrsgzg
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (20 October, 2019 - 27 October, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 5 stagazers.
Pookii
egolearner
JimmyLv
fxrcode
rsj217
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (15 September, 2019 - 22 September, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week 2 issues were created.
Of these, 0 issues have been closed and 2 issues are still open.

OPEN ISSUES

💚 #9 免费tts api 供你使用,和讯飞发音差不多,无单日使用限制,直接用就行, by simzhangbest
💚 #8 语音加个广东话版本?, by hezhizheng


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 61 stagazers.
szanlin
88250
chenlingmin
vanishcode
zhd173
ronething
JunaYa
Paladinhanxiao
JianfeiMa
zxc135781
wuquanyao
thanhtoan1196
Ahoo-Wang
fangjian0423
smileboywtu
zhyzhyzhy
JalanJiang
corlin
rcarlosdasilva
wuyc
biuaxia
JackEggie
oopsno
joyc
cnyy7
3Flos
MinionsDave
NGLSL
chanyipiaomiao
proxygit
Clausding
zdt3476
lvHiei
guanguans
Spartucas
PerrorOne
zaaack
mayuzx
selfdialog
xieren58
Gourds
Jackeriss
GeorgeShrek
songtianlun
entimm
nocb
abombone
XtaoBai
29DCH
fifths
renpingsheng
luoweikingjj
hanhuoer
lhzcc
OpenGemini
YUANTHONY
391546581
skyismine2010
xuduofeng
409915016
UncleThree
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (1 September, 2019 - 8 September, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week 2 issues were created.
Of these, 0 issues have been closed and 2 issues are still open.

OPEN ISSUES

💚 #5 谁有《史姓韵编》的 txt 版本?, by tyrchen
💚 #4 白话文对照?, by yufengwhy

NOISY ISSUE

🔈 #4 白话文对照?, by yufengwhy
It received 1 comments.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were 41 commits.
🛠️ change image for simaqian by tyrchen
🛠️ change to use custom domain by tyrchen
🛠️ fix package json by tyrchen
🛠️ fix typos of origin file and correct the audios by tyrchen
🛠️ add 280-294 by tyrchen
🛠️ add 260-279 by tyrchen
🛠️ add 245-259 by tyrchen
🛠️ beautify index page by tyrchen
🛠️ use netlify links by tyrchen
🛠️ fix netlify build error by tyrchen
🛠️ fix netlify build by tyrchen
🛠️ use netlify to build the docs by tyrchen
🛠️ add 237-244 by tyrchen
🛠️ add 214,218-232 by tyrchen
🛠️ add 201-218 by tyrchen
🛠️ add 183-200 by tyrchen
🛠️ add 173-182 by tyrchen
🛠️ add 163-172 by tyrchen
🛠️ add 153-162 by tyrchen
🛠️ add 143-152 by tyrchen
🛠️ add 135-142 by tyrchen
🛠️ bump version by tyrchen
🛠️ add 127-134 by tyrchen
🛠️ gen index page with filename by tyrchen
🛠️ add 120-126 by tyrchen
🛠️ add 111-119 by tyrchen
🛠️ add resources 103-110 by tyrchen
🛠️ add audio resources til 103 by tyrchen
🛠️ add 83-90 audio resources by tyrchen
🛠️ add new audio resources. by tyrchen
🛠️ fix readme by tyrchen
🛠️ fix readme by tyrchen
🛠️ fix readme generator by tyrchen
🛠️ add generated readme by tyrchen
🛠️ add generate html by tyrchen
🛠️ add audio resource by tyrchen
🛠️ revise chapter 012 by tyrchen
🛠️ revise 009-011 by tyrchen
🛠️ revise chapter 004-008 by tyrchen
🛠️ update chapter 003 by tyrchen
🛠️ revise 001/002 and fix meta issues, change font by tyrchen


CONTRIBUTORS

Last week there was 1 contributor.
👤 tyrchen


STARGAZERS

Last week there were 110 stagazers.
rockyzhengwu
laserx
zhongweili
xingxing
zhmz1326
madawei2699
zhangpanrobot
macingo
tmomy
ZhangJin233
MichaelMary
WangWenchao
yinjialu
NicodeLee
dongmen
nezhahh
icmcm
xuchuanqiu
jiangzhifei
liujie-gd
zsk425
iMiracle
ck0379
fifar
biaaib
qgchou
CHWJ
y-xiang
zuyu
PKUbuntu
FremdSprach
trampboy
chaozh
jiangguoren
BillZong
PreAnti
xgz123
imlcl
livingworld
billie66
DigitalPig
Xudong-Huang
hello2dj
qtxie
codeyu
Hayden-Yu
tyrchen
Lihuanghe
Psli
Laymer
sunboshan
szy0syz
xinde
u2
afterbase
forever139
FingerLiu
GreatStone
dongyuwei
lichuang
cch123
WeJie
wenpengfei
Terry-bear
oangeor
kwanCCC
junfsir
damonxiao154
chuanlei
crcms
ox0spy
onestarshang
JohnyXu
xinghu
dydyistc
freefcw
xiaopeifeng
gaominghui
darjun
Snile826
alei76
fantiq
zhanxw
942kid
CaoGongHui
shunsen
CharlesSong
lionful
xizhibei
wyixin
naore
WakerD
bqwhnn
ZexiCAI
EggmanQi
springfieldking
zccq11
Alvin4Jay
zffgithub
ahxxm
RossiYu
kamidox
ejacky
zhengminhui
royeo
pnp200
oayul
SummerLius
yangzuwei
imsail
You all are the stars! 🌟


RELEASES

Last week there were 18 releases.
🚀 v0.17.4
🚀 v0.17.2
🚀 v0.17.1
🚀 v0.16.0
🚀 v0.15.5
🚀 v0.15.4
🚀 v0.15.3
🚀 v0.15.2
🚀 v0.15.1
🚀 v0.15.0
🚀 v0.14.0
🚀 v0.13.0
🚀 v0.12.0
🚀 v0.11.4
🚀 v0.11.3
🚀 v0.11.2
🚀 v0.11.1
🚀 v0.11.0


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (8 September, 2019 - 15 September, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were 2 commits.
🛠️ fx 014 by tyrchen
🛠️ fix 012-013 by tyrchen


CONTRIBUTORS

Last week there was 1 contributor.
👤 tyrchen


STARGAZERS

Last week there were 11 stagazers.
makulu1987
cucy
ssjia
Koprvhdix
moshuqi
lanlyhs
thearyong
flyingfz
what0o0
zhangjianjun31
zuoyan
You all are the stars! 🌟


RELEASES

Last week there were 2 releases.
🚀 v0.18.1
🚀 v0.18.0


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (10 November, 2019 - 17 November, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there was 1 stargazer.
zheng5510
You are the star! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (29 September, 2019 - 6 October, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week, no issues were created.


PULL REQUESTS

Last week, no pull requests were created, updated or merged.


COMMITS

Last week there were no commits.


CONTRIBUTORS

Last week there were no contributors.


STARGAZERS

Last week there were 3 stagazers.
wy-luke
JustZiya
markwwl
You all are the stars! 🌟


RELEASES

Last week there were no releases.


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

Weekly Digest (25 August, 2019 - 1 September, 2019)

Here's the Weekly Digest for tyrchen/tongjian:


ISSUES

Last week 2 issues were created.
Of these, 2 issues have been closed and 0 issues are still open.

CLOSED ISSUES

❤️ #2 add readme and other resources, by tyrchen
❤️ #1 Feature/smart splitter, by tyrchen


PULL REQUESTS

Last week, 2 pull requests were created, updated or merged.

MERGED PULL REQUEST

Last week, 2 pull requests were merged.
💜 #2 add readme and other resources, by tyrchen
💜 #1 Feature/smart splitter, by tyrchen


COMMITS

Last week there were 14 commits.
🛠️ reformat slides by tyrchen
🛠️ reformat generated meta by tyrchen
🛠️ revise chapter 003 and add audio resources to chapter 035 by tyrchen
🛠️ revise chapter 002 by tyrchen
🛠️ make chapter 1 better, add other resources. by tyrchen
🛠️ udpate readme by tyrchen
🛠️ [add readme and other resources (#2) * add readme and other resources


CONTRIBUTORS

Last week there was 1 contributor.
👤 tyrchen


STARGAZERS

Last week there were no stargazers.


RELEASES

Last week there was 1 release.
🚀 v


That's all for last week, please 👀 Watch and Star the repository tyrchen/tongjian to receive next weekly updates. 😃

You can also view all Weekly Digests by clicking here.

Your Weekly Digest bot. 📆

白话文对照?

很赞的工作。阅读体验极佳。如果加上白话文的提示或者对照能够帮助更多的读者?用对应的白话版;或者谷歌能找到很多文言文机器翻译。

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.