├── data └── book │ ├── system │ ├── userAccount.md │ ├── userlist.md │ ├── book.mdo │ ├── README.md │ ├── error.html │ ├── logout.html │ ├── booklist.md │ ├── createBook.html │ ├── signup.html │ └── login.html │ ├── ccc │ ├── article.md │ ├── grandpaIphone.md │ ├── HeavenMoney.md │ ├── book.mdo │ ├── js1.md │ ├── codelist.md │ ├── knife.md │ ├── booklist.md │ ├── ChildMagneto.md │ ├── litchi.md │ ├── DrMagneto.md │ ├── archaeology.md │ ├── strongestKongfu.md │ ├── queen.md │ ├── HeavenMoney5.md │ ├── novel.md │ ├── HeavenMoney3.md │ ├── paper.md │ ├── lover.md │ ├── README.md │ ├── chief.md │ ├── course.md │ ├── MonsterWorld.md │ ├── DrMagnetoEnglish.md │ ├── HeavenMoney7.md │ ├── HeavenMoney6.md │ ├── HeavenMoney1.md │ ├── ai1.md │ ├── HeavenMoney4.md │ ├── HeavenMoney2.md │ ├── tako.md │ ├── sc1.md │ ├── assistant.md │ └── blender.md │ └── bookdown │ ├── book.mdo │ ├── README.md │ ├── math.md │ ├── table.md │ ├── markdown.md │ ├── mdo.md │ └── CC-BY-SA_icon.svg ├── changelog.md ├── web ├── katex │ ├── fonts │ │ ├── KaTeX_AMS-Regular.eot │ │ ├── KaTeX_AMS-Regular.ttf │ │ ├── KaTeX_Main-Bold.eot │ │ ├── KaTeX_Main-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-Italic.eot │ │ ├── KaTeX_Main-Italic.ttf │ │ ├── KaTeX_Math-Italic.eot │ │ ├── KaTeX_Math-Italic.ttf │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.eot │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.eot │ │ ├── KaTeX_Main-Regular.ttf │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_Math-Regular.eot │ │ ├── KaTeX_Math-Regular.ttf │ │ ├── KaTeX_Math-Regular.woff │ │ ├── KaTeX_Size1-Regular.eot │ │ ├── KaTeX_Size1-Regular.ttf │ │ ├── KaTeX_Size2-Regular.eot │ │ ├── KaTeX_Size2-Regular.ttf │ │ ├── KaTeX_Size3-Regular.eot │ │ ├── KaTeX_Size3-Regular.ttf │ │ ├── KaTeX_Size4-Regular.eot │ │ ├── KaTeX_Size4-Regular.ttf │ │ ├── KaTeX_Caligraphic-Bold.eot │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.eot │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.eot │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_Math-Regular.woff2 │ │ ├── KaTeX_SansSerif-Bold.eot │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.eot │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ ├── KaTeX_Script-Regular.eot │ │ ├── KaTeX_Script-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.eot │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_Typewriter-Regular.eot │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.eot │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.woff │ │ └── KaTeX_Typewriter-Regular.woff2 │ ├── contrib │ │ └── auto-render.min.js │ └── README.md ├── highlight │ └── default.min.css ├── js │ └── ui.js ├── purecss │ └── ui.js ├── main.css ├── bookdown.js └── css │ └── pure-min.css ├── test ├── mdTest.js ├── mtTest.js └── test.md ├── setting ├── setting.mdo ├── csr.pem ├── cert.pem └── key.pem ├── tool └── md2db.js ├── lib ├── mt.js ├── view.js ├── markdown.js ├── io.js ├── model.js └── mongo.js ├── .gitignore ├── locale ├── zh.json └── buildChineseDict.js ├── package.json ├── README.md ├── view └── view.html ├── server.js └── install /data/book/system/userAccount.md: -------------------------------------------------------------------------------- 1 |

User Account

2 | 3 | -------------------------------------------------------------------------------- /changelog.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/changelog.md -------------------------------------------------------------------------------- /data/book/ccc/article.md: -------------------------------------------------------------------------------- 1 | # Article 2 | 3 | chinese: 4 | 5 | # 陳鍾誠散文集 6 | 7 | -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_AMS-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_AMS-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Bold.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Italic.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Italic.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Bold.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size1-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size1-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size2-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size2-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size3-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size3-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size4-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size4-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Bold.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-BoldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-BoldItalic.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Bold.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Italic.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Script-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Script-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Typewriter-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Typewriter-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Regular.eot -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /web/katex/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cccunimportant/bookdown/HEAD/web/katex/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /data/book/system/userlist.md: -------------------------------------------------------------------------------- 1 | user | name 2 | ---------|--------------------------- 3 | [system](/view/system/) | System Manager (系統管理員) 4 | [ccc](/view/ccc/) | Chung-Chen Chen (陳鍾誠) -------------------------------------------------------------------------------- /test/mdTest.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | var MD = require("../lib/markdown"); 3 | 4 | var md = fs.readFileSync("test.md", "utf8") 5 | var p = MD.parse(md); 6 | console.log("jsons=%s", JSON.stringify(p.jsons, null, 2)); 7 | -------------------------------------------------------------------------------- /setting/setting.mdo: -------------------------------------------------------------------------------- 1 | port:80 2 | portSsl:443 3 | home:/view/ccc/README.md 4 | signup:false 5 | useLocal:false 6 | db:{user:"ccc", password:"ccc1234567", port:27017} 7 | users: 8 | user | password 9 | ---------|----------- 10 | system | ccc1234567 11 | ccc | ccc1234567 -------------------------------------------------------------------------------- /data/book/bookdown/book.mdo: -------------------------------------------------------------------------------- 1 | title:Bookdown User Guide = Bookdown 使用手冊 2 | editor:ccc 3 | chapters: 4 | title | link 5 | --------------|--------- 6 | Preface=前言 | README.md 7 | Syntax=語法 | markdown.md 8 | Table=表格 | table.md 9 | Math=數學 | math.md 10 | Object=物件 | mdo.md 11 | -------------------------------------------------------------------------------- /data/book/system/book.mdo: -------------------------------------------------------------------------------- 1 | title:Bookdown 2 | editor:system 3 | chapters: 4 | title | link 5 | -------------|--------- 6 | Bookdown | README.md 7 | Signup | signup.html 8 | Login | login.html 9 | NewBook | createBook.html 10 | Users | userlist.md 11 | Books | booklist.md -------------------------------------------------------------------------------- /data/book/bookdown/README.md: -------------------------------------------------------------------------------- 1 | # Preface 2 | 3 | This book is the user guide for Bookdown. Bookdown is a book publishing system in Markdown. 4 | 5 | This book is also a Markdown book. 6 | 7 | chinese: 8 | # 前言 9 | 10 | 本書簡單介紹 Bookdown 的用法,包含 Bookdown 支援的 Markdown 語法。 11 | 12 | 本書也是用 Markdown 所撰寫的! 13 | 14 | 15 | -------------------------------------------------------------------------------- /data/book/system/README.md: -------------------------------------------------------------------------------- 1 | # Welcome to Bookdown 2 | 3 | Bookdown is a book writing system for Markdown. 4 | 5 | [Login](login.html) and [create your books](createbook.html) ! 6 | 7 | Chinese: 8 | # 歡迎來到 Bookdown 9 | 10 | Bookdown 是採用 Markdown 語法的書籍寫作系統。 11 | 12 | 請 [登入](login.html) 後開始 [創建新書](createbook.html) ! 13 | 14 | -------------------------------------------------------------------------------- /data/book/system/error.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

4 | 5 |
6 |
7 | 8 | -------------------------------------------------------------------------------- /data/book/ccc/grandpaIphone.md: -------------------------------------------------------------------------------- 1 | # 爺爺的回憶錄 2 | 3 | 孫子:爺爺、你還在用你的 iPhone 喔! 4 | 5 | 爺爺:對阿!這個東西好用喔! 6 | 7 | 爺爺:不像你們現在,都在頭上貼那種膠布,那個不好啦。這樣你怎麼知道哪些是你真的看到的,哪些是膠布噴到你腦袋裡的呢? 8 | 9 | 孫子:爺爺,可是膠布只要輕輕一貼,不用拿著東西,就可以看也可以玩,世界超大的。不像你們還得拿個東西在手上,螢幕又那麼小,哪有甚麼好玩的! 10 | 11 | 爺爺:現在的小孩,動不動就 VR, VR 的,腦袋都壞掉了阿!不像我們以前那個單純的年代,大家都拿著真實的東西在手上,也不會用被那些膠布貼在腦袋上,誰知道那些膠布裡到底藏著甚麼東西啊! 12 | 13 |

西元 2050 年,爺爺的回憶錄

14 | -------------------------------------------------------------------------------- /data/book/ccc/HeavenMoney.md: -------------------------------------------------------------------------------- 1 | # 天國來的鈔票 -- 完整版 2 | 3 | | 標題 | 說明 | 4 | |--------|-----------| 5 | | [天國來的鈔票 (1)](HeavenMoney1.md) | 國王篇 | 6 | | [天國來的鈔票 (2)](HeavenMoney2.md) | 皇后篇 | 7 | | [天國來的鈔票 (3)](HeavenMoney3.md) | 大臣篇 | 8 | | [天國來的鈔票 (4)](HeavenMoney4.md) | 人民篇 | 9 | | [天國來的鈔票 (5)](HeavenMoney5.md) | 革命篇 | 10 | | [天國來的鈔票 (6)](HeavenMoney6.md) | 銀行家 | 11 | | [天國來的鈔票 (7)](HeavenMoney7.md) | 完結篇 | 12 | -------------------------------------------------------------------------------- /data/book/ccc/book.mdo: -------------------------------------------------------------------------------- 1 | title:C.C.Chen @ Bookdown=陳鍾誠 @ Bookdown 2 | editor:ccc 3 | locale:tw 4 | chapters: 5 | title | link 6 | ----------------------|-------------- 7 | C.C.Chen=陳鍾誠 | README.md 8 | Course=課程地圖 | course.md 9 | Book=書籍著作 | booklist.md 10 | Code=程式作品 | codelist.md 11 | Novel=小說故事 | novel.md 12 | Article=散文記事 | article.md 13 | Paper=論文研究 | paper.md 14 | Slide=十分鐘系列 | ../slide/ 15 | -------------------------------------------------------------------------------- /data/book/ccc/js1.md: -------------------------------------------------------------------------------- 1 | # JavaScript 程式設計 2 | 3 | 類型 | 書籍 | 作者 4 | -------|---------------------|---------- 5 | 教科書 | [專為中學生寫的 JavaScript 程式書](../jsh/) | 陳鍾誠 6 | 教科書 | [專為中學生寫的 JavaScript 程式書 - 網站設計篇](../jsw/) | 陳鍾誠 7 | 參考書 | [JavaScript 标准参考教程](http://javascript.ruanyifeng.com/) | 阮一峰 8 | 參考網站 | | [菜鸟教程](http://www.runoob.com/) | 9 | 英文入門 | [Learn Javascript](https://www.gitbook.com/book/gitbookio/javascript/details) | 10 | -------------------------------------------------------------------------------- /data/book/system/logout.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 |
8 |
9 |
10 |
11 |
12 | 13 | -------------------------------------------------------------------------------- /data/book/bookdown/math.md: -------------------------------------------------------------------------------- 1 | # Math 2 | 3 | Source 4 | 5 | ``` 6 | \int_0^{\infty} f(x) dx 7 | ``` 8 | 9 | Small font embedded 10 | 11 | $$\int_0^{\infty} f(x) dx$$ 12 | 13 | Big font centered 14 | 15 | $$ 16 | \int_0^{\infty} f(x) dx 17 | $$ 18 | 19 | Chinese: 20 | 21 | # 數學式 22 | 23 | 原始碼 24 | 25 | ``` 26 | \int_0^{\infty} f(x) dx 27 | ``` 28 | 29 | 小字體嵌入式呈現 30 | 31 | $$\int_0^{\infty} f(x) dx$$ 32 | 33 | 34 | 大字體置中呈現 35 | 36 | $$ 37 | \int_0^{\infty} f(x) dx 38 | $$ 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /tool/md2db.js: -------------------------------------------------------------------------------- 1 | var co = require('co'); 2 | var M = require('../lib/model'); 3 | 4 | co(function*() { 5 | yield M.init("../"); 6 | yield M.uploadToDb(); 7 | // yield M.query({type:"json"}); 8 | // yield M.search("陳鍾誠 email"); 9 | // yield M.search("八極語 grammar"); 10 | // yield M.search("Africa"); 11 | var results = yield M.search("十分鐘小論文", {type:"md"}); 12 | console.log("results=%j", results); 13 | var results = yield M.search("十分鐘小論文"); 14 | console.log("results=%j", results); 15 | yield M.close(); 16 | }); 17 | 18 | -------------------------------------------------------------------------------- /data/book/ccc/codelist.md: -------------------------------------------------------------------------------- 1 | # Code Project 2 | 3 | Project | Brief 4 | --------------|----------------------------- 5 | [Bookdown](https://github.com/ccckmit/bookdown) | Markdown E-Book Writing System 6 | [ECMT](https://github.com/ccckmit/english_chinese_machine_translation) | English-Chinese Machine Translation 7 | 8 | chinese: 9 | # 程式作品 10 | 11 | 專案 | 說明 12 | --------------|----------------------------- 13 | [Bookdown](https://github.com/ccckmit/bookdown) | Markdown 電子書撰寫出版系統 14 | [ECMT](https://github.com/ccckmit/english_chinese_machine_translation) | 英漢翻譯系統 15 | 16 | -------------------------------------------------------------------------------- /data/book/ccc/knife.md: -------------------------------------------------------------------------------- 1 | # 神劍 2 | 3 | 有位年輕人,一心想得到一把傳說中的神劍。 4 | 5 | 於是,他出發尋找那把神劍。 6 | 7 | 他走過了無數的路,問了無數的人。 8 | 9 | 一路上,愛劍的他也與無數愛劍的朋友切磋了武藝,其中也不乏許多高手! 10 | 11 | 當然,他也遭遇到不少的風險,遇見過馬賊、強盜,以及無數的江湖人士。 12 | 13 | 但是,一路上的風險也使得他成為身經百戰的劍客,武藝也更加精湛了! 14 | 15 | 與他切磋過的人越來越多,知道他武功高強的人也就越來越多。 16 | 17 | 隨著時間經過,許多年輕的劍客都把擊敗他當成了目標! 18 | 19 | 無數的劍客開始要找他挑戰,他與各路高手比試的次數也越來越多! 20 | 21 | … 22 | 23 | 十年後,有一天,他終於打聽到了神劍的下落, 24 | 25 | 經過了千里跋涉的旅程之後,他終於找到了神劍!但是,那把劍早已鏽蝕,輕輕一碰就化成了灰。 26 | 27 | 他把劍給丟了,然後、他明白了一件事! 28 | 29 | 真正的神劍,從來都不存在。 30 | 31 | 現在,任何東西到了他的手上,都會成為威力強大的武器! 32 | 33 | 神劍,就是劍神手上的那把劍! 34 | 35 | 而現在,他已經成了那位劍神! 36 | 37 | -------------------------------------------------------------------------------- /lib/mt.js: -------------------------------------------------------------------------------- 1 | var io = require("./io"); 2 | var path = require("path"); 3 | 4 | var MT = module.exports = { 5 | dictionary:{} 6 | } 7 | 8 | MT.loadDictionary = function(locale) { 9 | MT.dictionary[locale] = io.readJsonSync(path.join(__dirname, "../locale/"+locale+".json")); 10 | } 11 | 12 | MT.init = function() { 13 | MT.loadDictionary("zh"); 14 | } 15 | 16 | MT.mt = function(msg, locale) { 17 | if (typeof locale === 'undefined') 18 | return msg; 19 | var d = MT.dictionary[locale]; 20 | if (typeof d === 'undefined') 21 | return msg; 22 | return d[msg]; 23 | } 24 | 25 | -------------------------------------------------------------------------------- /data/book/ccc/booklist.md: -------------------------------------------------------------------------------- 1 | Book | About 2 | -------|--------------------------- 3 | [Learn Agile Programming](../learnagile/) | How to learn coding ? 4 | [JavaScript Programming](../jsh/) | use Node.js 5 | [Statistics](../st/) | use R 6 | [C# Programming](../csharp/) | use Window Forms 7 | [Bookdown Writing Guide](../bookdown/) | Write in Markdown 8 | 9 | chinese: 10 | 書籍 | 說明 11 | -------|--------------------------- 12 | [敏捷程式學習](../learnagile/) | 學習程式的方法 13 | [專為中學生寫的 JavaScript 程式書](../jsh/) | 使用 Node.js 14 | [機率統計](../st/) | 使用 R 軟體 15 | [C# 程式設計](../csharp/) | 使用老派的 Window Forms 16 | [Bookdown 寫作手冊](../bookdown/) | 如何用 bookdown 寫書 -------------------------------------------------------------------------------- /data/book/ccc/ChildMagneto.md: -------------------------------------------------------------------------------- 1 | # 萬磁王小時候 2 | 3 | 在萬磁王小的時候,他的磁力功能還沒有很強,發功後大概只能吸起迴紋針和圖釘之類的東西。 4 | 5 | 就在他第一次發現自己有這種《磁力特異功能》的時候,他展示給自己的爸媽看! 6 | 7 | 爸媽看了之後搖搖頭,說:「這種能力有甚麼用呢?你還是好好的念書,以後考上好大學,這樣未來才不會沒飯吃啊!」。 8 | 9 | 但是、自從萬磁王發現自己有這種功能之後,就整天沉迷在鍛鍊自己的磁力上,完全不想念書。 10 | 11 | 結果、他考試當然考得很糟,每天都被老師打,被爸媽唸,被同學嘲笑! 12 | 13 | 被打、被唸、被嘲笑,一次、兩次、無數次 .... 14 | 15 | 萬磁王不禁開始懷疑,自己到底活著還有甚麼意思。 16 | 17 | 於是他決定要自殺! 18 | 19 | 他找了一個峭壁,眼睛一閉,縱身往下跳。 20 | 21 | 此時、他體內的求生機制被啟動了,周圍的所有鐵器都被他吸了上來,圍繞成一個防護罩,讓他緩緩地飛了起來。 22 | 23 | 萬磁王心想:我竟然連要死都這麼困難! 24 | 25 | 他的心裡開始產生了一些變化,決定要幹一番大事業! 26 | 27 | 於是、他開始尋找《變種人朋友》,將那些和他一樣被歧視的變種人組織起來。 28 | 29 | 自然而然的,他成了《立志毀滅人類的變種人族群領袖》 ..... 30 | 31 | 從此、人類的世界,就再也平靜不下來了 ..... 32 | 33 | -------------------------------------------------------------------------------- /data/book/ccc/litchi.md: -------------------------------------------------------------------------------- 1 | # 非關歷史:愛吃荔枝的楊貴妃 2 | 3 | 話說楊貴妃原本是位水果西施,超愛吃水果的! 4 | 5 | 但是自從進宮之後,就沒辦法吃到他最心愛的荔枝了。 6 | 7 | 於是有一天,楊小姐癮頭犯了,就對唐明皇 ㄋ ㄞ 了幾聲。 8 | 9 | 唐明皇想,要吃荔枝有甚麼問題?包在我身上。 10 | 11 | 於是就下令請人去買荔枝。 12 | 13 | 結果那個人買回來的時候,已經是一個月後了。 14 | 15 | 荔枝早就變成了龍眼。 16 | 17 | 所以楊貴妃當然就拒吃了。 18 | 19 | 唐明皇臉上掛不住,就把那個荔枝採辦撤職查辦了。 20 | 21 | .... 22 | 23 | 為了能拿到新鮮荔枝,唐明皇找來軍情單位,請他們派出『六百里加急』快馬,去把荔枝買來。 24 | 25 | 這『六百里加急』是為了傳遞緊急軍情用的,方法是一個人騎上快馬,從這個驛站出發,飛奔到下一個驛站。 26 | 27 | 然後交給下一個人,繼續騎上另一匹快馬,再飛奔到下一個驛站交給下一匹快馬。 28 | 29 | 當然,回程時他們得帶上一些冰塊,以確保荔枝的新鮮度。 30 | 31 | 於是,這次楊貴妃終於吃到新鮮的荔枝了。 32 | 33 | 她真的好滿足! 34 | 35 | .... 36 | 37 | 但是、那些軍人都很憤怒。 38 | 39 | 有一天,安祿山叛變了,楊貴妃和唐明皇逃難去。 40 | 41 | 路上、將領們要求處死楊貴妃。 42 | 43 | 唐明皇捨不得,但是無奈:『形勢比人強』 ! 44 | 45 | 唐明皇只好賜楊貴妃一死! 46 | 47 | 這就是我所要說的:『荔枝的故事』! 48 | 49 | -------------------------------------------------------------------------------- /data/book/system/booklist.md: -------------------------------------------------------------------------------- 1 | Book | Author 2 | -----------------------------------|------------------ 3 | [Regular English Grammar](../egrammar/) | [Chung-Chen Chen](../ccc/) 4 | [Bookdown User Guide](../bookdown/) | [Chung-Chen Chen](../ccc/) 5 | [System](../system/) | [system](../system/) 6 | [egrammar](../egrammar/) | [system](../system/) 7 | [ccccourse](../ccccourse/) | [ccc](../ccc/) 8 | [learnagile](../learnagile/) | [ccc](../ccc/) 9 | [jsh](../jsh/) | [ccc](../ccc/) 10 | [nand2tetris](../nand2tetris/) | [ccc](../ccc/) 11 | [blender](../blender/) | [ccc](../ccc/) 12 | [csharp](../csharp/) | [ccc](../ccc/) 13 | [ai](../ai/) | [ccc](../ccc/) 14 | [st](../st/) | [ccc](../ccc/) 15 | [slide](../slide/) | [ccc](../ccc/) -------------------------------------------------------------------------------- /web/highlight/default.min.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:0.5em;background:#F0F0F0}.hljs,.hljs-subst{color:#444}.hljs-comment{color:#888888}.hljs-keyword,.hljs-attribute,.hljs-selector-tag,.hljs-meta-keyword,.hljs-doctag,.hljs-name{font-weight:bold}.hljs-type,.hljs-string,.hljs-number,.hljs-selector-id,.hljs-selector-class,.hljs-quote,.hljs-template-tag,.hljs-deletion{color:#880000}.hljs-title,.hljs-section{color:#880000;font-weight:bold}.hljs-regexp,.hljs-symbol,.hljs-variable,.hljs-template-variable,.hljs-link,.hljs-selector-attr,.hljs-selector-pseudo{color:#BC6060}.hljs-literal{color:#78A960}.hljs-built_in,.hljs-bullet,.hljs-code,.hljs-addition{color:#397300}.hljs-meta{color:#1f7199}.hljs-meta-string{color:#4d99bf}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold} -------------------------------------------------------------------------------- /data/book/ccc/DrMagneto.md: -------------------------------------------------------------------------------- 1 | # X 戰警的口試 -- 萬磁王篇 2 | 3 | 今天是 X 大學特異功能系的畢業口試。 4 | 5 | 口試一開始,萬磁王進來時,口試委員們的杯子就紛紛飛起來致敬! 6 | 7 | 然後、萬磁王做了一場表演,他首先將學校的所有金屬物,通通吸到門口,堵住教室出口。接著、口試委員們看到「歐巴馬」從窗戶飛了進來,因為他有繫皮帶。 8 | 9 | 正當歐巴馬還搞不清楚狀況的時候,大家看到原本的白天已經變成黑夜了,因為萬磁王將地球旋轉了半圈。 10 | 11 | 在這些精彩的表演之後,一位口試委員開始問了第一個問題: 12 | 13 | 口委A 說: 14 | 15 | > 我們看到你的論文了,題目是「移動任何金屬的特異功能研究」,但是、你沒有引用足夠的參考文獻,像是我的那篇「論鞭毛蟲移動時是哪根毛先動」的文章,你就沒有引用到。 16 | 17 | 「萬磁王」臉上閃過一道陰影,「魔形女」看到之後寒毛都豎了起來! 18 | 19 | 接著、口委 B 說: 20 | 21 | > 可以解釋一下你論文裏的那個「用人體磁場操控金屬的方程式」是甚麼意義嗎? 22 | 23 | 24 | 此時只看到萬磁王口沫橫飛的在黑板上寫了起來,不過他沒有動手,而是一支套有金屬圈的粉筆,飛來飛去寫了一整個黑板。 25 | 26 | 然後,換口委 C 發言了: 27 | 28 | 29 | > 我覺得你的論文還有些缺點,因為雖然你可以移動金屬,但是你如果能夠操控萬有引力,那不就任何物體都可以移動了嗎?所以我覺得你的研究其實還不夠好,所以應該在未來展望中將「操控萬有引力的方法」放入待研究項目中。 30 | 31 | 32 | 最後、在三位口委討論過後,做出結論,萬磁王應該再留下來一年,繼續研究「操控萬有引力的方法」。 -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # exe 6 | *.exe 7 | 8 | # bak 9 | *.bak 10 | bak 11 | 12 | # node 13 | node_modules 14 | 15 | # database 16 | db 17 | 18 | # mac 19 | .DS_Store 20 | 21 | # Runtime data 22 | pids 23 | *.pid 24 | *.seed 25 | 26 | # Directory for instrumented libs generated by jscoverage/JSCover 27 | lib-cov 28 | 29 | # Coverage directory used by tools like istanbul 30 | coverage 31 | 32 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 33 | .grunt 34 | 35 | # node-waf configuration 36 | .lock-wscript 37 | 38 | # Compiled binary addons (http://nodejs.org/api/addons.html) 39 | build/Release 40 | 41 | # Dependency directory 42 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 43 | node_modules 44 | -------------------------------------------------------------------------------- /data/book/bookdown/table.md: -------------------------------------------------------------------------------- 1 | # Table 2 | 3 | Syntax: 4 | 5 | ``` 6 | | Name | email | 7 | |--------|---------------------| 8 | | Chung-Chen Chen | | 9 | | Snoopy | | 10 | ``` 11 | 12 | Show as: 13 | 14 | | Name | email | 15 | |--------|---------------------| 16 | | Chung-Chen Chen | | 17 | | Snoopy | | 18 | 19 | chinese: 20 | # 表格 21 | 22 | 語法: 23 | 24 | ``` 25 | | 姓名 | email | 26 | |--------|---------------------| 27 | | 陳鍾誠 | | 28 | | Snoopy | | 29 | ``` 30 | 31 | 呈現結果: 32 | 33 | | 姓名 | email | 34 | |--------|---------------------| 35 | | 陳鍾誠 | | 36 | | Snoopy | | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /data/book/ccc/archaeology.md: -------------------------------------------------------------------------------- 1 | # 二十二世紀考古學的「亞伯拉斯之謎」 2 | 3 | 西元 2107 年,地球的科技變得越來越發達,但更重要的是,政治領域也不再像一個世紀前那樣的黑暗。當人們回顧一世紀前的那個時代,總會以「政治的黑暗時期」來稱呼。 4 | 5 | 然而、不知道是甚麼原因,在 2020 年之後,地球的政治經濟開始進入一個前所未有的大改變,所有國家的政治狀況都開始逐步提升。 6 | 7 | 原本到處充斥的貪汙、政客、戰爭等等黑暗因子,突然在 2020-2030 年之間快速地減少,以至於到 2040 年之後,很多人甚至不知道這些名詞代表的是甚麼意義。 8 | 9 | 22 世紀的科學家們,在運用「超大數據的智慧型比對分析」時發現,在三萬七千八百四十二個與政治相關的因子當中,竟然找不出任何一個因子可以解釋「政治的黑暗時期」是如何消失的,這個問題困擾了一代又一代的考古學家。 10 | 11 | 由於這個問題是 2100 年時大考古學家「亞伯拉斯」在展望下一世紀考古學研究時所提出來的,因此被稱為「亞伯拉斯之謎」。 12 | 13 | 想不到,在 2189 年的時候,有個 17 歲的神童「司圖亞特」發現了答案。 14 | 15 | 原來、那「三萬七千八百四十二個」政治相關因子,雖然是由二十二世紀的科學家們所精心整理出來的,但是他們卻遺漏了一個在二十一世紀網路啟蒙時代獨有的,難以辨認的因子。 16 | 17 | 而那位發現答案的神童,原本是立志當化學家的,但是在解開「亞伯拉斯之謎」以後,竟然成了 22 世紀最偉大的考古學家。 18 | 19 | 為何 「司圖亞特」 能發現這個因子呢? 其實答案並不意外,因為先前的人都一直往「政治相關因子」去尋找,所以當然很難發現那種「非政治因子卻嚴重影響前一世紀政治」的現象。 20 | 21 | 這個因子是化學上面的一個重要指標,簡稱為 pH 值 .... -------------------------------------------------------------------------------- /data/book/bookdown/markdown.md: -------------------------------------------------------------------------------- 1 | # Level 1 title 2 | 3 | ## Level 2 title 4 | 5 | ### Level 3 title 6 | 7 | Inner Text, _Strong_ , *Strong*, **Super Strong**, __Super Strong__ , 8 | 9 | Horizontal Line 10 | 11 | --- 12 | 13 | Unordered List 14 | 15 | * Item 1 16 | * Item 2 17 | * Item 3 18 | 19 | Ordered List 20 | 21 | 1. Item 1 22 | 2. Item 2 23 | 3. Item 3 24 | 25 | yahoo: [Yahoo](http://tw.yahoo.com/). 26 | 27 | ![](CC-BY-SA_icon.svg) 28 | 29 | chinese: 30 | # 第1層標題 31 | 32 | ## 第2層標題 33 | 34 | ### 第3層標題 35 | 36 | 內文, _強調_ , *強調*, **超強調**, __超強調__ , 37 | 38 | 水平線 39 | 40 | --- 41 | 42 | 無號項目 43 | 44 | * 項目1 45 | * 項目2 46 | * 項目3 47 | 48 | 編號項目 49 | 50 | 1. 項目1 51 | 2. 項目2 52 | 3. 項目3 53 | 54 | yahoo: [Yahoo](http://tw.yahoo.com/). 55 | 56 | ![](CC-BY-SA_icon.svg) 57 | 58 | -------------------------------------------------------------------------------- /locale/zh.json: -------------------------------------------------------------------------------- 1 | { 2 | "edit":"編輯", 3 | "view":"檢視", 4 | "save":"存檔", 5 | "signup":"註冊", 6 | "login":"登入", 7 | "logout":"登出", 8 | "home":"首頁", 9 | "book":"書籍", 10 | "search":"搜尋", 11 | "# Error\nFile not found.\nYou may edit and save to create a new file !":"# 錯誤\n檔案不存在.\n你可以編輯後存檔以創建新檔案!", 12 | "Please login to save!":"請先登入後才能存檔!", 13 | "Save fail: You are not editor of the book !":"存檔失敗:你不是本書的編輯!", 14 | "Save Success!":"存檔成功", 15 | "Save Fail!":"存檔失敗", 16 | "Signup success!":"註冊成功", 17 | "Signup Fail: User name already taken by some others!":"註冊失敗:該名稱已被佔用!", 18 | "Login Success!":"登入成功!", 19 | "Login Fail!":"登入失敗!", 20 | "Logout Success!":"登出成功!", 21 | "Please login at first !":"請先登入!", 22 | "Create Book Success!":"創建書籍成功!", 23 | "Fail: Book already exist!":"登入失敗!" 24 | } -------------------------------------------------------------------------------- /test/mtTest.js: -------------------------------------------------------------------------------- 1 | var zh={ 2 | "edit":"編輯", 3 | "view":"檢視", 4 | "save":"存檔", 5 | "signup":"註冊", 6 | "login":"登入", 7 | "logout":"登出", 8 | "home":"首頁", 9 | "book":"書籍", 10 | "search":"搜尋", 11 | "# Error\nFile not found.\nYou may edit and save to create a new file !":"# 錯誤\n檔案不存在.\n你可以編輯後存檔以創建新檔案!", 12 | "Please login to save!":"請先登入後才能存檔!", 13 | "Save fail: You are not editor of the book !":"存檔失敗:你不是本書的編輯!", 14 | "Save Success!":"存檔成功", 15 | "Save Fail!":"存檔失敗", 16 | "Signup success!":"註冊成功", 17 | "Signup Fail: User name already taken by some others!":"註冊失敗:該名稱已被佔用!", 18 | "Login Success!":"登入成功!", 19 | "Login Fail!":"登入失敗!", 20 | "Logout Success!":"登出成功!", 21 | "Please login at first !":"請先登入!", 22 | "Create Book Success!":"創建書籍成功!", 23 | "Fail: Book already exist!":"登入失敗!", 24 | } -------------------------------------------------------------------------------- /data/book/ccc/strongestKongfu.md: -------------------------------------------------------------------------------- 1 | # 最強的武術 2 | 3 | [Facebook 原文](https://www.facebook.com/notes/%E9%99%B3%E9%8D%BE%E8%AA%A0/%E6%9C%80%E5%BC%B7%E7%9A%84%E6%AD%A6%E8%A1%93/10154769153201893) 4 | 5 | 有個年輕人,他一心想要學習全世界最強的武術,所以他拜別了自己的師傅,到世界各地去尋找名師! 6 | 7 | 雖然師傅已經教了他一些武功,但是他學來學去總覺得,這些武功沒有甚麼神妙之處,他要去尋找更強的武學。 8 | 就這樣、他從《螳螂拳、五形拳、刀法、棍法、雙節棍、一路學到太極拳》,但他總覺得這些武功還不是很厲害,於是他繼續上路尋找更強的師傅。 9 | 10 | 終於、經過了十年,他認為自己學會絕世武功了,於是回到家鄉,回到師傅的身邊! 11 | 師傅很開心、徒弟終於學成回來了。 12 | 徒弟對師傅說,我已經學成最強的武功了,師傅! 13 | 然後徒弟開始展示所學到的武功給師父看,師傅看得眼花撩亂,覺得徒弟果然厲害,果然有出息。 14 | 於是師傅說:徒弟,我們來過兩招吧! 15 | 徒弟說、好啊,師傅你要小心了,別被我打傷。 16 | 於是、五秒鐘後 17 | ... 18 | 19 | ... 20 | 21 | 22 | ... 23 | 24 | 徒弟躺在那裏,一招斃命了! 25 | 26 | ... 27 | 28 | ... 29 | 30 | 師傅心裡很懊悔: 31 | 32 | ... 33 | 34 | 徒弟阿!我好不容易才找到了過招的對象,你怎麼才一招就掛了阿。 35 | 36 | ... 37 | 38 | 我都還沒出到十分之一的力氣呢 .... 39 | 40 | ... 41 | 42 | 但是、死人是不會說話的。師傅把徒弟送醫急救,但終究還是回天乏術了 .... 43 | 44 | ---- 45 | (完) .... -------------------------------------------------------------------------------- /data/book/ccc/queen.md: -------------------------------------------------------------------------------- 1 | # 愛乾淨的皇后 2 | 3 | 從前從前,有一位仁慈的國王,他總是為老百姓著想,而且非常節儉,從不亂課稅。 4 | 5 | 而他的皇后,也是一位美麗端莊,非常有愛心的人。而且、皇后非常愛乾淨,他很難認受有任何的髒亂! 6 | 7 | 他們的皇宮雖然不是很大,但是還蠻溫暖的。宮裡的僕人們也都很愛戴國王和皇后。 8 | 9 | 有一天,不幸的事情發生了! 10 | 11 | 國王染上了一種病,不久就去世了。 12 | 13 | 於是、這個國家的大小事務,就只好由皇后來處理。 14 | 15 | 皇后心想,國王會生病,應該是皇宮裏不夠乾淨,所以她就聘用了幾位僕人進來打掃皇宮。 16 | 17 | 由於多聘了幾位僕人,但原本就不太寬敞的皇宮裏並沒有足夠的房間給他們住,於是皇后只好請總管幫忙,找人來蓋新的屋舍。 18 | 19 | 蓋屋舍的人們每天進進出出,水泥磚瓦,灰塵難免飄到皇后的寢宮裡面,於是皇后只好再多請幾位僕人進來幫忙打掃寢宮。 20 | 21 | 但是、僕人們並不像皇后那樣愛乾淨,因為他們都是從外面來的,能夠有個地方住就很好了,哪還會挑三揀四的呢? 22 | 23 | 結果,更多的僕人帶來更多的髒亂,於是皇后只好再請更多人進來打掃。 24 | 25 | 就這樣,皇宮內的人變得越來越多,而皇宮也變得越來越大 ..... 26 | 27 | 更多的人進來,就要提供更多的食物,也要發出更多的薪資 .... 28 | 29 | 而變得更大的皇宮,也就更難打掃乾淨了。 30 | 31 | 後來、這個國家滅亡了。 32 | 33 | 34 | .... 35 | 36 | .... 37 | 38 | .... 39 | 40 | 後世的史學家,對皇宮進行考察後發現,整個國家有五分之一的人都住進了皇宮,這是導致滅亡的間接原因 .... 41 | 42 | 而導致滅亡的直接原因則是,皇后有潔癖 ..... 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /locale/buildChineseDict.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | var text = fs.readFileSync("tw2cn.dic", "utf8"); 3 | var lines = text.split(/\r?\n/); 4 | var tw2cn = {}, cn2tw = {}, tw2cnAll = {}, cn2twAll = {}; 5 | for (var i=0; i 2 |
3 |
4 |
5 |
6 | 7 | 8 |
9 |
10 | 11 |
12 |
13 |
14 |
15 | 16 | 17 | -------------------------------------------------------------------------------- /data/book/ccc/novel.md: -------------------------------------------------------------------------------- 1 | # Novel 2 | | Title | Introduction | 3 | |--------|-----------| 4 | | [The oral defense of Magneto](DrMagnetoEnglish.md) | X-Men in School | 5 | 6 | chinese: 7 | # 陳鍾誠小說集 8 | 9 | | 標題 | 說明 | English | 10 | |--------|-----------|-----| 11 | | [天國來的鈔票](HeavenMoney.md) | 和錢有關的小說 | | 12 | | [萬磁王的口試](DrMagneto.md) | 變種人唸博士班囉! | [The oral defense of Magneto](DrMagnetoEnglish.md) | 13 | | [萬磁王小時候](ChildMagneto.md) | 變種人的童年 | | 14 | | [魔獸世界](MonsterWorld.md) | 科幻寓言類 | | 15 | | [愛乾淨的皇后](queen.md) | 古典寓言類 | | 16 | | [章魚圓圓烏賊尖尖](tako.md) | 適合小朋友看! | | 17 | | [神劍](knife.md) | 武俠寓言類 | | 18 | | [助理](assistant.md) | 寫實愛情類 | | 19 | | [戀の人](lover.md) | 科幻愛情類 | | 20 | | [盟主](chief.md) | 武俠寓言類 | | 21 | | [二十二世紀考古學的「亞伯拉斯之謎」](archaeology.md) | 科幻寓言類 | | 22 | | [非關歷史:愛吃荔枝的楊貴妃](litchi.md) | 古典寓言類 | | 23 | | [爺爺的回憶錄](grandpaIphone.md) | 古典寓言類 | | 24 | | [最強的武術](strongestKongfu.md) | 武俠寓言類 | | -------------------------------------------------------------------------------- /data/book/bookdown/mdo.md: -------------------------------------------------------------------------------- 1 | # MarkDown Object (MDO) 2 | 3 | Markdown has no object like JSON, so we extend it with an Markdown Object Format (MDO). 4 | 5 | Chinese: 6 | # 物件 (MarkDown Object, MDO) 7 | 8 | Markdown 當中沒有表達像 JSON 一樣的物件機制,因此不能表達階層性的東西。 9 | 10 | 雖然 Bookdown 裏允許大家直接撰寫 JSON 檔案,但是 JSON 檔案表達《表格類》物件時,每筆紀錄都要寫欄位名稱,會變得很囉唆! 11 | 12 | 因此我們對 Markdown 語法進行延伸,加入了 mdo (MarkDown Object) 這種結構,這個結構有點類似 JSON,但是簡化了不少,而且可以加入 markdown 表格在欄位當中,讓您能用精簡的語法輕易地表達物件。 13 | 14 | 以下是一個 Markdown Object (mdo) 的範例: 15 | 16 | ```mdo 17 | type:book 18 | title:Markdown 寫作手冊 19 | editor:ccc 20 | coeditor: ["snoopy", "garfield"] 21 | keywords: [ 22 | "markdown", 23 | "bookdown", 24 | "電子出版" 25 | ] 26 | table_of_contents: 27 | title | link 28 | ---------|--------- 29 | 前言 | README.md 30 | 基本語法 | markdown.md 31 | 表格 | table.md 32 | 數學式 | math.md 33 | 物件 | object.md 34 | ``` 35 | 36 | 基本上 mdo 物件都採用《欄位:內容》的方式撰寫,欄位一定是在行首,欄位後面跟的值可以有多行,這些值可以是《JSON 物件、表格或字串》,若不是物件或表格,就會被認為是單純的字串。 37 | 38 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bookdown", 3 | "version": "1.4.0", 4 | "description": "Book Editing System for Markdown", 5 | "main": "server.js", 6 | "dependencies": { 7 | "co-body": "^4.2.0", 8 | "handlebars": "^4.0.6", 9 | "katex": "^0.6.0", 10 | "koa": "^1.2.4", 11 | "koa-route": "^2.4.2", 12 | "koa-session": "^3.4.0", 13 | "koa-static": "^2.0.0", 14 | "markdown-it": "^8.2.2", 15 | "mdo": "^0.2.0", 16 | "mongodb": "^2.2.16", 17 | "mz": "^2.6.0" // , "object-hash": "^1.1.5" 18 | }, 19 | "devDependencies": {}, 20 | "scripts": { 21 | "start": "node server.js" 22 | }, 23 | "bin": {}, 24 | "keywords": [], 25 | "homepage": "https://github.com/ccckmit/bookdown", 26 | "repository": { 27 | "type": "git", 28 | "url": "http://github.com/ccckmit/bookdown.git" 29 | }, 30 | "author": { 31 | "name": "Chung-Chen Chen", 32 | "email": "ccckmit@gmail.com", 33 | "url": "http://ccc.nqu.edu.tw" 34 | }, 35 | "license": "MIT" 36 | } 37 | -------------------------------------------------------------------------------- /data/book/system/signup.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 |
14 | 15 |
16 | 17 |
18 |
19 |
20 |
21 |
22 | -------------------------------------------------------------------------------- /data/book/ccc/HeavenMoney3.md: -------------------------------------------------------------------------------- 1 | ## 天國來的鈔票 (3) 2 | 3 | … 4 | 5 | 海拉進了宮,跪在皇后面前! 6 | 7 | 皇后對著海拉說,我看了你的奏摺,但是加薪這件事情會有所困難! 8 | 9 | 皇后一五一十的將印鈔機的困境告訴了海拉! 10 | 11 | 海拉感覺到很失望,因為這樣下去他連自己的老婆與小孩都會養不活了,於是他請求皇后讓他「罷官經商」! 12 | 13 | 皇后知道海拉是一位好官員,很不希望讓這位全國唯一不貪污的大臣離開,但是她卻又想不出好辦法。 14 | 15 | 時間凝結在僵化的氣氛中,幾乎停了下來! 16 | 17 | … 18 | 19 | 突然間,海拉靈光一閃,似乎想到甚麼事情! 20 | 21 | 他問了皇后一個問題:「請問皇后娘娘是否可以讓我看看印鈔機」。 22 | 23 | 皇后想說,反正僕人們也都知道印鈔機的事了,多一位大臣知道也無所謂了。 24 | 25 | 於是皇后帶著海拉進入密室。 26 | 27 | … 28 | 29 | 海拉一開始呆望著印鈔機,然後很仔細的檢查印鈔機的每一部分零件,接著他看到印鈔機上列印頭的字母排列,發現列印頭還有點空間,可以再塞入一個鉛字。 30 | 31 | 於是海拉告訴皇后說,他想試試看能不能請工匠刻一個 0 字塞到那個洞裡,這樣就可以讓印鈔機印出來的鈔票數值多一個零,這樣印出來的鈔票價值就會增加十倍,如此就可以解決印鈔機來不及印刷的問題了。 32 | 33 | 皇后聽到這個建議,想想這真是個好辦法,於是找了工匠打造好鉛字,再度找來海拉。 34 | 35 | 海拉將鉛字塞進印鈔機,然後根據皇后的指示啟動了印鈔機,於是印鈔機又開始喀啦喀拉的印出了一堆鈔票,這些鈔票與先前的鈔票沒有太大不同,只不過後面又多了一個零。 36 | 37 | … 38 | 39 | 於是,大臣們都加薪了,而海拉也因為這個卓越的貢獻,被皇后提升為「皇家財務長」,掌管著皇室僕人與大臣們的薪水! 40 | 41 | … 42 | 43 | 於是這個繁榮的國家,經濟更加的繁榮了。 44 | 45 | … 46 | 47 | 海拉所提出的聰明政策,不但解決了皇后的難題,也解決了大臣們薪資不夠的問題。 48 | 49 | 皇后利用海拉多出來的那個 0,為每位大臣都加薪了五倍,然後再用剩下的錢犒賞皇室與有功人員,於是薪資不足的問題得到了解決。 50 | 51 | ----- 52 | 53 | … [繼續看下一集](HeavenMoney4.md) … 54 | 55 | -------------------------------------------------------------------------------- /setting/csr.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE REQUEST----- 2 | MIICxjCCAa4CAQAwgYAxCzAJBgNVBAYTAlRXMQ8wDQYDVQQIEwZraW5tZW4xDzAN 3 | BgNVBAcTBmtpbm1lbjEMMAoGA1UEChMDbnF1MQ0wCwYDVQQLEwRjc2llMRAwDgYD 4 | VQQDEwdjY2NrbWl0MSAwHgYJKoZIhvcNAQkBFhFjY2NrbWl0QGdtYWlsLmNvbTCC 5 | ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMBcaUO77WDFVDf2LXiRCL8n 6 | NusFYgBZpUzq97SXAxZC+Zj+61y5VY7oW8dKflhRH2ksbDyBd17AxNijTSyNZq+u 7 | n/nYtV51dr76WtfrbiLJQXVaaM7f3t20/9AJqV4DkI7KTOWSKnbmSUbRCZHP9Irh 8 | zsLutMM3TQa5g7SGI7FHeqWULByFExix+yd2RuK1/JYBeq/c2BD52Ej0FSkHE+Yv 9 | hgWpLERO4QrozDVZnsW8FYKcqdFa56uFl8lTPiUsct1Hwzsm9j/q12AO3ZL7e9k+ 10 | j+jmBcw5F49ysn4UGNzxKya+S3w48D0rqVn/ZpmxE+KPZtYtbxDgiR9wjT9Q+QMC 11 | AwEAAaAAMA0GCSqGSIb3DQEBCwUAA4IBAQCbvmSxMNb75jZdtcJPmAUs4g4cyaxs 12 | yqqWuAZhzq/ArLdIB6wvHSeZvH45tDz6GGA+Y1ETh2vQ6eL8ZhOdYemUgR+yemlA 13 | 26fhAzxezugRph3lXBqczR//U6udhIuv6iR0g4oK2pgRgrG6FE9Kj3jAmnCEqNaI 14 | 2MHwCjWR6DO2RCKguzcjPeg217dg5fWisEe0mBj1CJ3N7isjGx8odwxB8tsqiHig 15 | uMOR201j7o9ZSjKinSWL394dxiIVqnWVHNXo0SBxmUgMhwummZXLsp3LkVMGunqi 16 | K26jYzRSWZr36T1lnp+bURVjWfuZqiJlHSPdCc9LJgB5f01QEtvlfnlU 17 | -----END CERTIFICATE REQUEST----- 18 | -------------------------------------------------------------------------------- /lib/view.js: -------------------------------------------------------------------------------- 1 | var fs = require("fs"); 2 | var path = require("path"); 3 | var MD = require("./markdown"); 4 | // var showdown = require('showdown'); 5 | var handlebars = require('handlebars'); 6 | var converter = require('markdown-it')(); 7 | // var converter = new showdown.Converter(); 8 | // converter.setOption('tables', true); 9 | 10 | var V = module.exports = {} 11 | 12 | V.init = function(root) { 13 | V.viewPath = path.join(root, "view"); 14 | V.render = { 15 | view:V.newTemplate("view.html"), 16 | } 17 | } 18 | 19 | V.newTemplate= function(file) { 20 | return handlebars.compile(fs.readFileSync(path.join(V.viewPath, file), "utf8")); 21 | } 22 | 23 | V.mdToHtml = function(md) { 24 | // return converter.makeHtml(md); 25 | return converter.render(md); 26 | } 27 | 28 | V.viewRender=function(bookObj, fileObj, useLocal, user) { 29 | if (fileObj.file.endsWith(".md")) 30 | fileObj.html = V.mdToHtml(fileObj.text); 31 | else 32 | fileObj.html = '```\n'+fileObj.text+'\n```'; 33 | return V.render.view({book:bookObj, file:fileObj, useLocal:useLocal, user:user}); 34 | } 35 | 36 | 37 | -------------------------------------------------------------------------------- /data/book/ccc/paper.md: -------------------------------------------------------------------------------- 1 | # Paper 2 | 3 | | Paper | Slide | 4 | |--------|-----------| 5 | | [XML Retrieval - A slot filling approach](http://www.slideshare.net/ccckmit/xml-retrieval-a-slot-filling-approach) | [SlideShare](http://www.slideshare.net/ccckmit/xml-69397282) | 6 | | [A Document Similarity Measurement without Dictionaries](http://www.slideshare.net/ccckmit/a-document-similarity-measurement-without-dictionaries) | | 7 | 8 | chinese: 9 | # 論文研究 10 | 11 | ## 十分鐘小論文 12 | 13 | | 十分鐘小論文 | 網路版 | 影片 | 討論 | 14 | |---------------|----------|------|------| 15 | | [最佳化問題的公理化方法](10minAiMethod.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-69310214) | | | 16 | 17 | 18 | ## 學術論文 19 | 20 | | 論文 | 投影片 | 21 | |--------|-----------| 22 | | [基於欄位填充機制的 XML 文件檢索方法](http://www.slideshare.net/ccckmit/xml-retrieval-a-slot-filling-approach) | [SlideShare](http://www.slideshare.net/ccckmit/xml-69397282) | 23 | | [結合統計與規則的多層次中文斷詞系統](http://www.slideshare.net/ccckmit/ss-69397638) | | 24 | | [A Document Similarity Measurement without Dictionaries](http://www.slideshare.net/ccckmit/a-document-similarity-measurement-without-dictionaries) | | 25 | 26 | -------------------------------------------------------------------------------- /data/book/ccc/lover.md: -------------------------------------------------------------------------------- 1 | # 戀の人 2 | 3 | 陽光和昫的從窗戶照進小屋,讓整個家都溫暖了起來。廚房的電子爐上,一鍋銀耳蓮子湯正慢慢的煮著、煮著。 4 | 5 | 李寧坐在他的電子鋼琴前,緩緩的彈出他最喜歡的一首曲子,旋律緩慢而優雅,有時柔和,有時輕快。 6 | 7 | 唯一美中不足的,是這首曲子,應該是雙人彈奏的曲子,鋼琴的聲音必須搭配小提琴,才能顯示出那種甜蜜溫馨的味道,由李寧手上彈奏出來的曲調,雖然既優美又富有感情,但由於是李寧一個人獨奏,不免讓人感到一絲絲的孤獨。 8 | 9 | 當李寧彈奏到副歌時,他身旁的電腦,開始傳出微弱的提琴聲,這兩種琴聲一來一往,似乎在進行著某種對話。 10 | 11 | 慢慢的,兩種聲音開始交纏、鬆開,然後再度交纏、再鬆開。就好像是初戀的男女一般,又期待又怕受傷害的那種感覺。 12 | 13 | 接著,旋律開始慢慢的轉為柔美而華麗的曲調,似乎兩個人開始熱戀一般,就像一對分別已久的情侶,再次見面後熱烈的擁抱著,然後開始跳起舞來,互相摟著對方的腰,興奮的轉阿轉的。 14 | 15 | 然後,曲調開始上升、加速、再上升、再加速,兩人彷彿飛上了空中,在空中互相交纏、旋轉,愈飛愈高,愈轉愈快。 16 | 17 | 忽然、咚的一聲,就像夜空中突然一抹閃亮美麗的煙火,從寂靜的深夜中爆了出來,在一聲燦爛的巨響之後,又回到了極度安靜的狀態。這就好像男女雙方經過了熱烈的交纏之後,全身三萬六千個毛孔全都張開了,然後兩人精疲力盡的相互依偎著,一同沉沉的睡去。 18 | 19 | 過了許久,李寧開始對著嘴邊的麥克風說:「靈兒,最近好嗎?你在 New York 學音樂的感覺如何呢?」。 20 | 21 | 說完後大約三秒鐘,從電腦上傳來了趙靈的聲音:「當然好嘍!我最近在學校阿,可成了大紅人了。月底阿,我們就要開第一場演奏會了呢!到時候你可要來捧場喔!」。 22 | 23 | 李寧一邊喝著湯,一邊說著:「一定一定,我很快就會去找妳了,在 New York 可不許給我偷偷的交男朋友喔!否則看我到時怎麼修理妳」。 24 | 25 | 李寧接著說:「對了,我現在正喝著你最愛的銀耳蓮子湯呢?要不要來一碗啊!」。 26 | 27 | 趙靈回說:「死李寧,明知道我不能回來,還故意釣我胃口,不說了,我要斷線了,bye bye!」。 28 | 29 | 李寧急忙說:「別、別掛,我是說真的,我馬上就要去找妳了,你不信,等著、等著,別掛啊!」。 30 | 31 | 李寧轉身拿起一碗銀耳蓮子湯,然後從口袋中取出一顆藥丸,連同湯一起喝了下去。 32 | 33 | 然後,他沉沉的、沉沉的睡去,再也沒有醒來。 34 | 35 | 大約一炷香的時間過後,電腦的畫面突然開啟了,畫面的場景是某個異國的街頭,街頭上出現了李寧和趙靈兩個人的身影。 36 | 37 | 李寧一手提著熱騰騰的銀耳蓮子湯,另一手摟著趙靈,兩人親密的依偎在一起,相擁著走在紐約的街頭。 -------------------------------------------------------------------------------- /data/book/ccc/README.md: -------------------------------------------------------------------------------- 1 | # Chung-Chen Chen 2 | 3 | Field | Content 4 | --------------|------------------------------------------------------------ 5 | Job | Professor, Computer Science, National Quemoy University 6 | Focus | Coding (Node.js + JavaScript) , Writing (Markdown) 7 | Contacts | ccckmit@gmail.com , [Facebook](https://www.facebook.com/ccckmit) 8 | Account | [Github](https://github.com/ccckmit) , [SlideShare](http://www.slideshare.net/ccckmit/) , [YouTube](https://www.youtube.com/user/ccckmit) 9 | Works | [Courses](course.md) , [Books](booklist.md) , [Codes](codelist.md) , [Novels](novel.md) , [Articles](article.md) , [Slides](../slide/) 10 | 11 | chinese: 12 | # 陳鍾誠 13 | 14 | 欄位 | 內容 15 | --------------|------------------------------------------------------------ 16 | 職務 | 金門大學 資訊工程系 教師 17 | 專長 | 寫程式 (Node.js + JavaScript) , 寫書 (Markdown) 18 | 聯絡 | ccckmit@gmail.com , [Facebook](https://www.facebook.com/ccckmit) 19 | 帳號 | [Github](https://github.com/ccckmit) , [SlideShare](http://www.slideshare.net/ccckmit/) , [YouTube](https://www.youtube.com/user/ccckmit) 20 | 作品 | [課程](course.md) , [書籍](booklist.md) , [程式](codelist.md) , [小說](novel.md) , [散文](article.md) , [十分鐘系列](../slide/) 21 | -------------------------------------------------------------------------------- /data/book/system/login.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 | 7 | 8 |
9 | 10 |
11 | 12 | 13 |
14 | 15 |
16 | 17 | 18 |
19 |
20 |
21 |
22 |
23 | 24 | -------------------------------------------------------------------------------- /setting/cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDfjCCAmYCCQDbPWmIdX0AIDANBgkqhkiG9w0BAQUFADCBgDELMAkGA1UEBhMC 3 | VFcxDzANBgNVBAgTBmtpbm1lbjEPMA0GA1UEBxMGa2lubWVuMQwwCgYDVQQKEwNu 4 | cXUxDTALBgNVBAsTBGNzaWUxEDAOBgNVBAMTB2NjY2ttaXQxIDAeBgkqhkiG9w0B 5 | CQEWEWNjY2ttaXRAZ21haWwuY29tMB4XDTE1MDQwMTAzMTEyM1oXDTE1MDUwMTAz 6 | MTEyM1owgYAxCzAJBgNVBAYTAlRXMQ8wDQYDVQQIEwZraW5tZW4xDzANBgNVBAcT 7 | Bmtpbm1lbjEMMAoGA1UEChMDbnF1MQ0wCwYDVQQLEwRjc2llMRAwDgYDVQQDEwdj 8 | Y2NrbWl0MSAwHgYJKoZIhvcNAQkBFhFjY2NrbWl0QGdtYWlsLmNvbTCCASIwDQYJ 9 | KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMBcaUO77WDFVDf2LXiRCL8nNusFYgBZ 10 | pUzq97SXAxZC+Zj+61y5VY7oW8dKflhRH2ksbDyBd17AxNijTSyNZq+un/nYtV51 11 | dr76WtfrbiLJQXVaaM7f3t20/9AJqV4DkI7KTOWSKnbmSUbRCZHP9IrhzsLutMM3 12 | TQa5g7SGI7FHeqWULByFExix+yd2RuK1/JYBeq/c2BD52Ej0FSkHE+YvhgWpLERO 13 | 4QrozDVZnsW8FYKcqdFa56uFl8lTPiUsct1Hwzsm9j/q12AO3ZL7e9k+j+jmBcw5 14 | F49ysn4UGNzxKya+S3w48D0rqVn/ZpmxE+KPZtYtbxDgiR9wjT9Q+QMCAwEAATAN 15 | BgkqhkiG9w0BAQUFAAOCAQEAHJ+NMupQ7yQsE2Fgs9N+XKR8+Ck7Ia70+/NR4r8k 16 | AEXPrO6m62kThcN3GxCnnaZeAtyUJOMY5vyCMXMnoEyYXYsApKop0il//J7rWJa7 17 | x3lG+mwC+ZjiX/sHYYwpuDlf32SII+Poeekj3N0UQVAFepILCcYnwM680eObh7uV 18 | WTwL6crBhR05NpG9COd5RpJiVtUMDZ1MgbsChqTB7nONDnpF7yqHkFkgJ+CO4y0b 19 | UhE3yDB0MbuTChY6VRRk8jPp4qSS8v1LlJ2IheqkO+yPVcGuz5q9IdENnEDuqTud 20 | ftXpkc4n1aMWXhKq5J7Tz+wfgqhO6/4eHVqiJ/U5nlqbrg== 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /data/book/ccc/chief.md: -------------------------------------------------------------------------------- 1 | # 盟主 2 | 3 | 有一個高手,打從他出江湖以來,就沒有輸過。 4 | 5 | 他從一個默默無名的武者,一路打遍江湖,直到成為武林盟主。 6 | 7 | 他一直想要嘗試失敗的滋味,但是卻從來沒有任何人能夠打敗他。 8 | 9 | 10 |   11 | 12 |    13 | 14 | ... 15 | 16 |   17 |   18 |   19 | 20 | 21 |   22 |   23 | 24 | 於是、盟主在武林大會上直接宣佈,只要有人能夠打敗他,就可以成為下一任盟主。 25 | 26 | 27 |   28 |   29 | 30 | ... 31 | 32 | 33 |   34 |   35 | 36 | 這個消息一出,挑戰的人從四面八方而來 .... 37 | 38 | 39 |   40 |   41 | 42 | ... 43 | 44 | 45 |   46 |   47 | 48 | 但是、十年過去了,始終沒有人能夠打敗盟主 49 | 50 | 51 |   52 |   53 | 54 | 55 | ... 56 | 57 | 58 |   59 |   60 | 61 | 62 | 盟主的內心感到很孤單... 63 | 64 | 65 |   66 |   67 | 68 | .... 69 | 70 |   71 |   72 | 73 | 74 | 於是、盟主的心裡開始產生了一些變化.... 75 | 76 | 77 |   78 |   79 | 80 | ... 81 | 82 | 83 |   84 |   85 | 86 | 87 | 有一天,他走在路上,碰到一個女生。 88 | 89 | 他說了一句:「你好胖」! 90 | 91 | 92 |   93 |   94 | 95 | .... 96 | 97 |   98 |   99 | 100 | 101 | 102 | 103 | 104 | 隔天、有人發現,盟主死在半路。 105 | 106 | 經過江湖法醫驗屍後確認,殺死盟主的人所使用的招數是: 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | ...... 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 泰山壓頂! 125 | 126 | 127 | 128 | 129 | .... 130 | 131 | 132 | 133 | 134 | 135 | 盟主的直接致死原因是: 136 | 137 | 138 | 139 | 140 | 141 | .... 142 | 143 | 144 | 145 | 146 | 147 | 缺乏氧氣! 148 | -------------------------------------------------------------------------------- /web/js/ui.js: -------------------------------------------------------------------------------- 1 | (function (window, document) { 2 | 3 | var layout = document.getElementById('layout'), 4 | menu = document.getElementById('menu'), 5 | menuLink = document.getElementById('menuLink'), 6 | content = document.getElementById('main'); 7 | 8 | function toggleClass(element, className) { 9 | var classes = element.className.split(/\s+/), 10 | length = classes.length, 11 | i = 0; 12 | 13 | for(; i < length; i++) { 14 | if (classes[i] === className) { 15 | classes.splice(i, 1); 16 | break; 17 | } 18 | } 19 | // The className is not found 20 | if (length === classes.length) { 21 | classes.push(className); 22 | } 23 | 24 | element.className = classes.join(' '); 25 | } 26 | 27 | function toggleAll(e) { 28 | var active = 'active'; 29 | 30 | e.preventDefault(); 31 | toggleClass(layout, active); 32 | toggleClass(menu, active); 33 | toggleClass(menuLink, active); 34 | } 35 | 36 | menuLink.onclick = function (e) { 37 | toggleAll(e); 38 | }; 39 | 40 | content.onclick = function(e) { 41 | if (menu.className.indexOf('active') !== -1) { 42 | toggleAll(e); 43 | } 44 | }; 45 | 46 | }(this, this.document)); 47 | -------------------------------------------------------------------------------- /web/purecss/ui.js: -------------------------------------------------------------------------------- 1 | (function (window, document) { 2 | 3 | var layout = document.getElementById('layout'), 4 | menu = document.getElementById('menu'), 5 | menuLink = document.getElementById('menuLink'), 6 | content = document.getElementById('main'); 7 | 8 | function toggleClass(element, className) { 9 | var classes = element.className.split(/\s+/), 10 | length = classes.length, 11 | i = 0; 12 | 13 | for(; i < length; i++) { 14 | if (classes[i] === className) { 15 | classes.splice(i, 1); 16 | break; 17 | } 18 | } 19 | // The className is not found 20 | if (length === classes.length) { 21 | classes.push(className); 22 | } 23 | 24 | element.className = classes.join(' '); 25 | } 26 | 27 | function toggleAll(e) { 28 | var active = 'active'; 29 | 30 | e.preventDefault(); 31 | toggleClass(layout, active); 32 | toggleClass(menu, active); 33 | toggleClass(menuLink, active); 34 | } 35 | 36 | menuLink.onclick = function (e) { 37 | toggleAll(e); 38 | }; 39 | 40 | content.onclick = function(e) { 41 | if (menu.className.indexOf('active') !== -1) { 42 | toggleAll(e); 43 | } 44 | }; 45 | 46 | }(this, this.document)); 47 | -------------------------------------------------------------------------------- /data/book/ccc/course.md: -------------------------------------------------------------------------------- 1 | # Course Map 2 | 3 | Course | Tools | Related 4 | -----------------|----------------------|----------- 5 | [Programming 1](js1.md) |JavaScript + Node.js | HTML , CSS , JavaScript 6 | [Programming 2](js1.md) | JavaScript + C | Browser, Server, Node.js 7 | [Computer Architecture](../nand2tetris/) | JavaScript + Verilog | nand2tetris (Part I) , CPU 8 | [System Software](../nand2tetris/) | JavaScript + C | nand2tetris (Part II) , Compiler 9 | [Scientific Computing](sc1.md) | JavaScript + R | Calculus , Statistics 10 | [Artificial Intelligence](../ai/) | JavaScript + Node.js | NLP , Machine Learning 11 | [3D Animation](../blender/) | Blender+Krita + Natron | Movie Making 12 | [C# Programming](../csharp/) | VisualStudio + WinForm | Window Programming 13 | 14 | chinese: 15 | # 陳鍾誠的課程地圖 16 | 17 | 課程 | 語言與軟體 | 學期 | 註 | 相關主題 18 | -----------------|----------------------|------|----|----------- 19 | [程式設計](js1.md) |JavaScript + Node.js | 一上 | 必 | 修課須知 , HTML , CSS , JavaScript 20 | [程式設計進階](js1.md) | JavaScript + C 語言 | 一下 | 必 | C語言 前端瀏覽器, 後端伺服器 21 | [計算機結構](../nand2tetris/) | JavaScript + Verilog | 二上 | 必 | nand2tetris (Part I) , CPU設計 22 | [系統程式](../nand2tetris/) | JavaScript + C 語言 | 二下 | 必 | nand2tetris (Part II) , 編譯器 , 系統軟體 23 | [科學計算](sc1.md) | JavaScript + R 軟體 | 三上 | 選 | 微積分 , 機率統計 , 線性代數 , 數值分析 24 | [人工智慧](../ai/) | JavaScript + Node.js | 三下 | 選 | 離散數學 , 計算理論 , 自然語言 , 機器學習 25 | [3D 動畫設計](../blender/) | Blender+Krita + Natron | 一上 | 選 | 電影後製 26 | [C#程式設計](../csharp/) | VisualStudio + WinForm | 二上 | 選 | 視窗程式 , Thread , 網路程式 27 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bookdown -- Book Editing System for Markdown 2 | 3 | ## Install 4 | 5 | ``` 6 | $ git clone https://github.com/ccckmit/bookdown.git 7 | $ cd bookdown 8 | $ npm install 9 | $ node server // if you would like to store data in mongodb, start mongod before this command 10 | ``` 11 | 12 | Visiting https://localhost/ for a demo site. 13 | 14 | If you do not start a mongodb server, bookdown will not save data into mongodb, but still can work on the file system. 15 | 16 | ## License 17 | 18 | The Bookdown project is licensed in MIT license. 19 | 20 | Copyright (c) 2013 ccckmit 21 | 22 | Permission is hereby granted, free of charge, to any person obtaining a copy 23 | of this software and associated documentation files (the "Software"), to deal 24 | in the Software without restriction, including without limitation the rights 25 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 26 | copies of the Software, and to permit persons to whom the Software is 27 | furnished to do so, subject to the following conditions: 28 | 29 | The above copyright notice and this permission notice shall be included in 30 | all copies or substantial portions of the Software. 31 | 32 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 33 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 34 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 35 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 36 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 37 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 38 | THE SOFTWARE. 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /data/book/ccc/MonsterWorld.md: -------------------------------------------------------------------------------- 1 | # 魔獸世界 2 | 3 | 這是一個奇特的世界! 4 | 5 | 在這個世界裏,凡是肥沃的土地上,都住著一隻怪獸! 6 | 7 | 越肥沃的土地,住的怪獸也就越大隻,差不多剛好可以把那些土地上的食物吃光。 8 | 9 | 人們為了生存,必須要住在怪獸的腳下,想辦法在不引起怪獸注意的情況下,找到一些還沒被怪獸吃掉的食物,然後填飽自己的肚子。 10 | 11 | 還好、這些怪獸的視力不好,感覺也不敏銳,因此人們只要小心不被怪獸壓到,就可以在怪獸的腳下好好生活。 12 | 13 | 不過、這些怪獸對光線很敏感,如果有任何人身上發出光的話,怪獸就會伸出他長長的舌頭,直接把你吃掉。 14 | 15 | 就算你閃得夠快,可以避開舌頭的攻擊,但是由於你是住在怪獸腳下的,所以怪獸一旦挪動龐大的身軀,也總是有人會遭殃的。 16 | 17 | 於是、住在這裡的人,都學會了一件事,那就是千萬別發光,千萬別讓怪獸注意到你,否則、就有人要倒大楣了! 18 | 19 | 那些年長的人們,在這個世界裡早已住了超過五十年,他們早就學會了如何避免怪獸的攻擊,不要發光、默默地低頭撿拾地上的食物來吃,想辦法填飽自己的肚子。 20 | 21 | 然後、日復一日,年復一年,漸漸的、他們連光是甚麼都不知道了,有些人的眼睛,因此而退化,再也看不到任何光線了。 22 | 23 | 而那些視覺細胞還沒死透的人們,由於幾乎沒有看過光線,因此光線對他們來說,也只不過是一種傳說而已。 24 | 25 | 傳說、看到光線是一種不祥的象徵,代表這個人已經快要死了,而且會發生可怕的災難。 26 | 27 | 但是、由於很少人看過光線,而且看過光線的人大部分都死了,所以也很少人知道這個傳說到底是真的還是假的。 28 | 29 | 但是、越少出現的東西,對人們總是有著莫名的吸引力,特別是對那些好奇心強大的年輕人而言,更是具有致命的吸引力。 30 | 31 | 於是、這些年輕人,總是對任何會發出光線的東西,感到好奇。雖然他們很多人一輩子都沒有看過,但是在他們的心中,總是將光線想像成一種異常美好的事物。 32 | 33 | 在這些年輕男女的世界裡,要形容一個女人的美麗,年輕的男人會說,她好閃亮啊! 而年輕女孩在接受一個男孩的追求時,則會說:請照亮我的未來吧! 34 | 35 | 這些熱情的年輕人,總是相約去追逐光線,並且將這樣的行動視為一種勇敢而美好的行為。 36 | 37 | 但是、怪獸腳下任何可以發光的物體,早就都被長輩們銷毀了,因此年輕的人們不得不離家出走,到遠處去尋找光的蹤跡。 38 | 39 | 於是、這些年輕人前仆後繼的離開怪獸腳下,想要去尋找光的訊息。 40 | 41 | 不過、這個世界是殘酷的,離開了怪獸的腳下,也就離開了食物,離開了那些流著牛奶與蜜的區域。 42 | 43 | 很多出去的年輕人,都再也沒有回來了! 44 | 45 | 而那些幸運回來的年輕人,通常是在出發不久就返回的人,他們走得不夠遠,因此也沒有看到光。 46 | 47 | 於是、這些回到原怪獸腳下的年輕人,總是會失望的說:「這個世界根本沒有光」! 48 | 49 | 當這些探索失敗的年輕男女回到家之後,他們通常就死心了,然後接受父母的安排,準備結婚,然後生兒育女,撫養下一代! 50 | 51 | 然後、他們的視覺神經,也開始漸漸退化了。 52 | 53 | 這時候,就算出現了任何光的蹤跡,他們也完全無法看見了。 54 | 55 | 當他們的下一代出生後,他們會告訴這些新生代,關於光的傳說與禁忌,然後要求下一代要遵守這些禁忌。 56 | 57 | 下一代的兒童,通常會對傳說非常好奇,但是卻忘了那些禁忌。 58 | 59 | 到底、那些沒有回來的年輕人,究竟去了哪裡呢? 60 | 61 | 那些滿懷希望、出去追尋光線蹤跡的年輕人,究竟有沒有看到光呢? 62 | 63 | 關於這個問題的答案,我們也沒有辦法非常確定。 64 | 65 | 但是、傳說曾經有個年輕人,他離開怪獸腳下之後,向東走了兩千哩路,然後定居下來。 66 | 67 | 不久之後,那邊又出現了一隻怪獸,而且是一隻非常巨大的超級怪獸! 68 | 69 | -------------------------------------------------------------------------------- /setting/key.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEowIBAAKCAQEAwFxpQ7vtYMVUN/YteJEIvyc26wViAFmlTOr3tJcDFkL5mP7r 3 | XLlVjuhbx0p+WFEfaSxsPIF3XsDE2KNNLI1mr66f+di1XnV2vvpa1+tuIslBdVpo 4 | zt/e3bT/0AmpXgOQjspM5ZIqduZJRtEJkc/0iuHOwu60wzdNBrmDtIYjsUd6pZQs 5 | HIUTGLH7J3ZG4rX8lgF6r9zYEPnYSPQVKQcT5i+GBaksRE7hCujMNVmexbwVgpyp 6 | 0Vrnq4WXyVM+JSxy3UfDOyb2P+rXYA7dkvt72T6P6OYFzDkXj3KyfhQY3PErJr5L 7 | fDjwPSupWf9mmbET4o9m1i1vEOCJH3CNP1D5AwIDAQABAoIBAQC7Z0yGWMfix1xN 8 | SODz3RiQYjv2q7/WZ3/Ld/7rSVQQlB9nFrNmGoloOKdxePmuQRpA9K5eJCOPhG5C 9 | QJYnGXs5HP9uAdpwtC+Dz5RBV3RtH3VOR05kfWY6yOOQYllG5mInOp+/6K7GN4Sc 10 | IXsZO2gbBfLRpo0kwvOf4YyWiziqtC+SKcD7ppzf5IksBej6yRy+hPavDVTCxGtz 11 | yCBqrkj3mXIxhjpcJm/cOF5fNrmUr4aOuComhn0J5AfoZ9Kez63TOHz09W6IJUIL 12 | JP/1fTFhPr4G+4LZImFDr5WOmGI+2uPLqnIveLrva+gmCSfrCh90OaxUFHUaIZaf 13 | ZEsJLTRBAoGBAOqUVOLqYxXPHEz0zwNGpjNDExKtriFBqL1WmieAw3RdSeqBvtEv 14 | zue6R8Ycj7DpNceeqwF7RyaY79WZJWMuJPV/axfqq6Mhiwr8uJBiykYcRGFYTaAF 15 | hcCNu9I65WbTdkTEqPBTQf/7n8iESQvTi2/EfGQTRg2lKY5lUXD61ycNAoGBANHt 16 | J/xqdc1nWIHFJiMthM1d9Wj8ngDPJtYDoEEsInEY0CQuE/FpXsqBUdlyzmJx1bY9 17 | wyz5++AOgczJofV/WAOwqEm/tlzpXoGuVcaeYqTTA1vNJiKGn5p4fTK0nK5qXJPK 18 | 8o/itMF0zwwpdT+GRnHsxMZWvWNZ2oRMP7jfoJxPAoGAB49ALQ/goZNLFi/NfA2K 19 | zZwbwT5Xnjq/dVqVHTDJG7bl6ujDfXpM8KrQJVJGTy00znoOiL2wTU4gbIHC8q9K 20 | AZ9ZlCu73EX4dSIv0HdejWPb0EdIOR/0b4AhzWSYf/fQl+a+iwAj4Fv7ijq5H+hx 21 | Vei/GXqFh2sLK8uYFEwBIwECgYAD4Qj7HhB9MiqtgzIYNlAc516QiRJ2W12RWNHO 22 | Qn2Eb3vxHzTZIiRRQ6B6jyeHJClZy7xeiWQBGOOHIDaw7aB3uPzzF+rLvrgzV0BY 23 | gja6avfF632H58rtNMrDdBjtFCQPyxE+XWcPqBPnWqDDAr0sf76HF7U6L7/c7/fB 24 | d8hk+wKBgHZeYZN1FjekqN4ad/7zeIUkZmRZdgXJurB8kusHQ8cNkxTfODR80YRy 25 | KapA7Gw++zowfPQKVQavYu0On50NhXlzSy/Iyih+z82kKxZBbfyNek0/CGCSepsU 26 | phD9QJu44WpGl405/kBNXEBMy6mcgQwftZsUulusSzB0sfusIB/r 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /lib/markdown.js: -------------------------------------------------------------------------------- 1 | var M = module.exports = require("mdo"); 2 | 3 | // 1. md 分解出 parts 4 | // 2. 取得 Markdown Object (mdo) 的 json 5 | // 3. 取得表格的 json 6 | M.parse = function(md) { 7 | var lines = md.split(/\r?\n/), partLines = [], codeHeader, codeLines; 8 | var partList = [], jsonList = [], mdoLines = []; 9 | for (var i=0, len = lines.length; i 0) 17 | partList.push({part:partList.length, level:m[0].length, text:partMd, type:"mdpart" }); 18 | } else { 19 | partLines.push(line); 20 | } 21 | if (line.startsWith("```")) { // 處理 code 22 | if (typeof codeHeader === 'undefined') { // code start 23 | codeHeader = line; 24 | codeLines = []; 25 | } else { // code end 26 | if (codeHeader.toLowerCase().startsWith("```mdo")) { 27 | jsonList.push(M.parseMdo(codeLines.join("\n"))); 28 | } 29 | codeHeader = undefined; 30 | } 31 | } else if (typeof codeHeader === 'undefined' && line.indexOf("|")>=0) { 32 | if (i0 && lines[i+1].match(/^[\-|]+$/) && !lines[i-1].startsWith("```")) { 33 | var table=[], head=lines[i]; 34 | for (;i We have read your Dr. Thesis in title "A research of ESP that moving any metal objects". But you have not enough citation and reference in your thesis. For example, you do not cite my paper with title "A research about which hair moving first when flagellate is moving". 18 | 19 | At that time, there was shadows show on Magneto's face. When Mystique saw it, her hair stand up. 20 | 21 | And then, committee member B said : 22 | 23 | > Could you please explain the meaning of "the equation of manipulate magnetic field by human body" ? 24 | 25 | Suddenly, you saw the Magneto explain quickly and write on the blackboard without moving his hand. 26 | In fact, he manipulate a chalk with metal ring flying to write on the blackboard。 27 | 28 | Finally, the committee member C said : 29 | 30 | > I think your thesis has some weak point. Because you can move metal but cannot move the other objects. Your research is not good enough. So you should have another research about the topic of manipulate gravity. 31 | 32 | At the end of oral defense , committee members have the conclusion that Magneto should stay for one more year to have another research for the topic "A method of manipulate gravity". 33 | -------------------------------------------------------------------------------- /data/book/ccc/HeavenMoney7.md: -------------------------------------------------------------------------------- 1 | ## 天國來的鈔票 (7) 2 | 3 | 國王下令海拉全權負責執行這個計畫,於是海拉開始又找來那群調查庫拉銀行的人,開始執行「撕庫拉」計畫。 4 | 5 | 計畫的第一步是,國王與海拉開動了印鈔機,每天都印出一大堆的鈔票,然後交給幾位神秘人,這些神秘人的任務就是到庫拉的銀行去,把錢存入銀行。 6 | 7 | 這個動作連續做了三個月,國王下令:「第二階段任務開始」。 8 | 9 | 隔天,一大群的神秘人,紛紛向庫拉銀行的各個分行前進,然後在早上 10:00 時,同時填寫提款單,準備將他們在庫拉銀行的所有存款全部一次提領完畢。 10 | 11 | 一開始的幾位神秘人,都提領到自己的錢了,但是由於神秘人一波接著一波的來,銀行的現金紛紛開始被提領一空,很多分行都已經沒有鈔票可以付給他們了。於是分行經理開始變得非常著急,紛紛都打電話請總部運錢過來。總部的運鈔車一車又一車的出動,但總是來不及應付神秘人的需求,而那些來銀行提款的其他民眾,都等得非常不耐煩了,只想趕快領到自己要領的錢,於是整個銀行大排長龍,領錢的隊伍都排到銀行外面了。 12 | 13 | 當其他的人看到銀行排隊排得這麼長,都紛紛詢問「到底發生了甚麼事」,而那些民眾於神祕人通常都會回答:「銀行的錢快用光了,我們都快領不到錢了」。 14 | 15 | 這些民眾一聽到這樣的消息,有些人馬上回家拿存款簿,有些人趕快回家告訴其他人:「銀行快沒錢了,在不去領可能就領不到了」。 16 | 17 | 於是全國的人都急著回家拿出存款簿,衝向庫拉的銀行裡去,把自己的存款全部提領出來。 18 | 19 | 銀行門口的排隊領錢的民眾越來越多,排隊的隊伍於是越來越長,越來越長,越來越長,....。 20 | 21 | 這些隊伍從白天排到晚上,眼看著營業結束時間就快到了,排在後面的民眾都還是不願意回家,有些人回家拿出了帳篷與睡袋,就在街上搭起來了,準備明天一大早繼續排隊,將自己的錢全部領出來,而有些人想造插隊,於是後面憤怒的民眾破口大罵,另外有一些人直接衝進銀行與經理吵了起來,但是經理也沒有辦法,那些人只好又回去排隊。 22 | 23 | 隔天,銀行一開門,大批排隊的民眾好不容易等到這一刻的到來,但是銀行卻掛出了「今日庫拉銀行休息一天」的牌子,於是憤怒的民眾有人打破了銀行的玻璃,衝進裡面把經理與職員抓了出來,一大群民眾將這些行員團團圍住,有些行員甚至已經血流滿地了。 24 | 25 | 這時很多警察來到銀行門口維持秩序,並且將憤怒的民眾隔離開來,想辦法保護行員的安全,但是憤怒的民眾仍然在街上大聲叫囂,可憐的行員們都嚇得半死。 26 | 27 | 海拉出面了,他帶著一批武裝警察,站在庫拉銀行總行的門口,請庫拉先生出來說明。庫拉先生早已嚇得半死,於是那批武裝警察進去把庫拉先生抬了出來,庫拉先生被抬到了大街上,顫抖的對大家說,銀行已經沒有現金了,請大家不要再繼續提領,否則銀行就要破產了。 28 | 29 | 海拉站在大街上對庫拉說:「庫拉先生、我身為這個國家的金融主管,有責任維持金融市場的穩定,既然庫拉先生的銀行已經破產了,那我在此宣布,從現在開始,國家將會強制接管庫拉銀行,而你庫拉先生,將會被監禁並接受法官的判決」。 30 | 31 | 庫拉先生被武警帶上了囚車,送往監獄囚禁,而海拉則對著其他民眾說:「庫拉銀行已經由國家監管了,大家不用著急,國家的錢絕對足夠讓大家領回自己的存款,請大家放心。」 32 | 33 | 接著,海拉宣佈,所有庫拉銀行的行員,都必須回到自己的崗位上,繼續負責讓大家提款的業務,國家會負責將鈔票運送到各個分行,行員們只要繼續負責原本的任務就行了。 34 | 35 | 接著、一車又一車的鈔票,不斷的從皇宮運向庫拉銀行總行,以及各個分行,當大家看到這種情況的時候,也就不在急躁不安了。 36 | 37 | 民眾們大部分都回到庫拉銀行的門口,一個個去排隊提領出自己的存款,當民眾們看到前面的民眾都領到錢了,就越來越覺得安心。 38 | 39 | 漸漸的,那些在隊伍裡大排長龍的民眾,開始想說,既然大家都可以領得到錢,那我幹麻還急著把錢領出來呢?於是有些人乾脆離開隊伍直接回家去了。 40 | 41 | 過了幾天,甚至有很多人又提著一袋一袋的鈔票,回銀行填寫存款單,再次將鈔票存回銀行裡,因為將這些鈔票放在家裡,感覺上比放在銀行更不安全。 42 | 43 | 海拉回到皇宮,向國王報告「撕庫拉」計畫的執行結果,國王很滿意的笑了。 44 | 45 | 當天晚上,國王睡得很安穩! 46 | 47 | ---- 48 | … 完 … 49 | -------------------------------------------------------------------------------- /data/book/ccc/HeavenMoney6.md: -------------------------------------------------------------------------------- 1 | ## 天國來的鈔票 (6) 2 | 3 | ... 4 | 5 | 但是、海拉沒死,新的國王既位之後, 由於沒有人知道鈔票是如何創造出來的,於是又找來海拉,要他說出鈔票的秘密,並且繼續讓他擔任財政部長。 6 | 7 | 海拉上任後,記取了先前惡性通貨膨脹的失敗教訓,採用了較為穩健的「印鈔票」政策,也經常提醒國王亂印鈔票的惡果,於是整個國家又邁向了穩定且逐漸繁榮的經濟發展階段。 8 | 9 | 有一年、海拉發現很多人都帶著錢到一個地方,海拉覺得很奇怪,於是海拉好奇的到「公司」裡看一看,才發現這個地方是「庫拉」這個人所創立的「公司」,庫拉的公司將大家的錢收下後,給他們開立一個證明,然後當人們有需要用錢的時候,就可以拿著那個證明到「公司」去領錢,這樣就不需要將一大堆的錢放在家裡,還要用保險箱收起來防止小偷了。 10 | 11 | 更棒的是,庫拉的公司還會給人「回饋」,存進去的錢還會生出小錢。於是很多人都把錢拿去庫拉的公司「存起來」。 12 | 13 | 慢慢的,民眾們都一傳十、十傳百,於是庫拉的公司生意越來越好,越來越多人將錢存到庫拉的公司裡。 14 | 15 | 那麼、庫拉的「小錢」到底從是從哪裡生出來的呢?原來庫拉收了存款之後,就拿去借給「需要錢買房子、或做生意的人」,並且收取更多的小錢,然後將一部分的小錢回饋給客戶,其他的小錢就變成庫拉的錢了。 16 | 17 | 庫拉的公司生意越來越好,於是在全國各地都可以看到「庫拉銀行」的標誌,公司的前面總是掛著一句標語,「來庫拉、讓你的錢越來越多」。 18 | 19 | 現在,連大臣、皇宮裡的僕人們,都將錢存到庫拉的銀行裡,海拉發現,庫拉的錢竟然比國王還要多很多了。 20 | 21 | 庫拉的錢越來越多,人民也越來越喜歡庫拉,甚至很多人都認為庫拉是天神派下來幫助大家賺錢的人,於是庫拉在人民心目中的地位,已經逐漸超過國王了,甚至有些作生意的人,在店裡會將庫拉的肖像高高掛起來,以保佑自己能夠生意興隆。 22 | 23 | 這個現象讓海拉有點擔心,他發現大家似乎不太需要「他與國王用印鈔機印出來的錢了」。因為有了庫拉的銀行,大家都把錢存進去,需要的時候才領出來用,這樣大家手上就不需要留很多錢,於是鈔票的需求量就變少了。 24 | 25 | 他想了很久之後,終於決定將這件事情報告國王。 26 | 27 | 國王似乎是全世界最後知道「銀行」這件事的人,知道這件事之後不免感到驚訝,但是卻又不知道「銀行」到底是個好東西還是壞東西,於是下令庫拉進行秘密調查,想辦法瞭解「庫拉」銀行的一舉一動。 28 | 29 | 於是海拉派出密探,開始進行調查庫拉與他的銀行,有些密探整天站在銀行前面,數著到底有幾個人進入庫拉的銀行,有些密探則是常常將錢拿去庫拉銀行存,或者常常從庫拉銀行領錢出來,並且伺機看看每個人都存多少錢進去。有些密探會跟蹤銀行職員與主管,看看他們到底去了哪裡。當然也有些密探會直接跟蹤庫拉,看看他都做些什麼事,和哪些人碰面等等。 30 | 31 | 這些密探每天都回報訊息給海拉,於是海拉逐漸的掌握的庫拉與銀行的秘密,他發現將錢存到庫拉銀行的人真的很多,但是大部分都借出去了,因為這些錢借出去之後,庫拉才能得到更多的小錢去付利息給客戶。 32 | 33 | 現在、海拉已經瞭解庫拉與銀行的秘密了,也大致掌握了庫拉到底有多少錢了,於是他跑去找國王,告訴他這個秘密。 34 | 35 | 自從知道庫拉與銀行這件事之後,國王經常都睡不好,因為他常常想起自己推翻了前朝皇后,當上國王的這件事,他很害怕庫拉會推翻他,然後自己當國王。 36 | 37 | 國王非常期待海拉的回報,於是當海拉來的時候,國王連衣服都還沒穿好就跑出來見海拉了,當海拉向國王報告庫拉銀行每天進出的人數、存進去與領出來的金額,還有借款出去的數量時,國王真的嚇了一跳。 38 | 39 | 因為他們核對印鈔紀錄發現,庫拉銀行的存款數量,竟然比他們印出來的鈔票數量還要多很多,這件事情讓他們百思不解。 40 | 41 | 為了思考這個問題,海拉與國王好幾天都睡不著覺,三天之後,海拉終於在睡夢中想出了答案,他從床上跳起來就直奔皇宮,國王也立刻跳起來在自己的寢宮中接見了海拉。 42 | 43 | 海拉說,庫拉銀行的存款數量,會比我們印出的總鈔票數量多是有可能的,因為當人們將錢存入銀行後,庫拉又拿去借給別人,而那些借的人很可能又會將錢存回銀行。 44 | 45 | 甚至、假設借錢的人沒有將錢存回銀行,而是拿去買材料,這些賣材料的人,也很可能會將錢再度存回庫拉的銀行, 如果拿去開公司請員工,那員工領到薪水也通常會存回庫拉的銀行。 46 | 47 | 最後,庫拉銀行的錢,有一大部份被借出來後又存回了庫拉的銀行,而這些錢又可以再度被借出來,這是為何庫拉銀行的存款比我們印出來的總鈔票數還要多的原因。 48 | 49 | 這個答案讓國王寢食難安,害怕不已,因為國王真的很擔心庫拉會成為新國王,讓他的下場與前朝皇后一樣悽慘,於是國王命令海拉成立一個特別的專案,專門想辦法解決這個問題。 50 | 51 | 一個月後,海拉終於完成了「撕庫拉」計畫,並且呈報給國王,國王看過計劃之後,非常的開心,當天晚上,國王終於睡了一個好覺。 52 | 53 | ----- 54 | … [繼續看下一集](HeavenMoney7.md) … 55 | 56 | -------------------------------------------------------------------------------- /data/book/ccc/HeavenMoney1.md: -------------------------------------------------------------------------------- 1 | ## 天國來的鈔票 (1) 2 | 3 | 這是一個信仰虔誠的國家,人們打從心裡相信國王是天神的代理人,也是人類與天神之間唯一的溝通管道。 4 | 5 | 當然、這也是一個政教合一個國家,所有的國民都信仰同一種宗教,祭拜同一位神明,至高無上的天神「法拉」。 6 | 7 | 在這個國家裏,大家與我們一樣,也都使用紙鈔,人們每天買東西都會隨身帶一些鈔票出去,需要的時候就拿出來用。 8 | 9 | 但是,沒有人知道這些鈔票是從哪裡來的,也很少人會去思考這樣的問題。但是,好奇的小孩總是會問到這個問題。 10 | 11 | 沒有人刻意去回答這樣的問題,但是許多人打從心理相信,鈔票來自天國,是天神給予人們的禮物之一,讓大家都可以用來買到想要的東西。 12 | 13 | 雖然不知道鈔票是從哪裡來的,但這並不妨礙他們使用鈔票,也不妨礙他們的商業行為,人們依舊每天使用鈔票買東西。 14 | 15 | 只有一個人例外,那就是國王。 16 | 17 | 國王是整個國家當中唯一知到鈔票從哪裏來的人,他每天早上起床,就會想想今天需要用多少錢,買哪些東西,發給誰薪水等等。 18 | 19 | 接著國王會打開密室中的一台機器,按下幾個按鈕之後,原本空白的紙張上面就喀拉喀拉的印出了一些美麗的花紋,正確金額的鈔票就從這台機器的另一頭被送出來。 20 | 21 | 然後,國王就將鈔票交給他的總管與僕人,由僕人們去負責採購今天所需要的東西,總管去分發大臣們的薪水。 22 | 23 | 在這樣的一個國家當中,人們過得幸福且快樂。 24 | 25 | 很少人會失業,也很少人沒有飯吃,即便有人真的失業賺不到錢,信仰虔誠的人們都會很樂意的幫助這些人,讓他們也能吃得飽,穿得暖,睡得安穩。 26 | 27 | 這個國家的國王都是世襲而來的,而且根據傳統,每位國王都只能生一位小孩,然後將王位傳給那位小孩,就這樣,那台印鈔機也就一代接著一代,供應皇室每日所需要的鈔票。 28 | 29 | 當皇位傳到了第 72 代國王「耶啦」的手上時,發生了一件困擾人的事情。「耶啦」沒有生下任何子女就去世了,於是皇后「米拉」只好暫時代理國王的職務。 30 | 31 | 這下問題來了,皇后並不知道密室的存在,當然更不知道密室中有一台印鈔機,可以印出他所需要的鈔票。 32 | 33 | 但是皇后每天仍然需要僕人幫他去採購各項日常所需的物品,這下皇后可傷透腦筋了,錢該從哪裡來呢? 34 | 35 | 於是皇后招來所有大臣們來皇宮昭開「國是會議」,詢問:「國王在世的時候、鈔票從何而來」這個問題? 36 | 37 | 可惜的是,沒有任何一位大臣知道「國王的鈔票從何而來」! 38 | 39 | 後來,終於有一位大臣說了話:「鈔票應該是來自萬能的天神 — 法拉!」。 40 | 41 | 但可惜的是,國王「耶啦」已經死了,他們與「法拉」的唯一溝通管道已經喪失,而皇后也不知道如何才能連繫上「法拉」。 42 | 43 | 這下皇后可發慌了,皇室每天的開銷不少,一但無法聯繫上「法拉」,那這些開銷要從哪裡來呢? 44 | 45 | … 46 | 47 | 「國是會議」從早上開到了晚上,還是沒有得到任何結果,大臣們吵成了一團,每個人都很著急,因為這樣下去,不只皇室的開銷沒有著落,大臣們的薪水也都會發不出來了。 48 | 49 | 最後,一位大臣「魯拉」建議說,不如這樣,我們向每位民眾抽稅,命令他們每人每年都要繳 100 元紙鈔給國家,這樣皇室也就有足夠的錢花用,而大臣們的薪水也就有著落了。 50 | 51 | 「魯拉」的提議一出,大臣們紛紛表示贊同,而皇后「米拉」在沒有其他辦法之下,也只好採用了「魯拉」的建議,下令實施抽稅政策! 52 | 53 | 這個政策一開始實施,許多老百姓的心理都不太高興,但是由於大家知道國王「耶啦」死了,所以皇后在連繫不上天神「法拉」的情況之下,不得已才實施此一政策,因此也就沒有太大的反彈,雖然心裡很不願意,但也都乖乖的繳了稅。 54 | 55 | 就這樣,日復一日,大家每天還是用「紙鈔」交易,買東西時也都帶著鈔票上街,國家又恢復了正常的運作。 56 | 57 | … 58 | 59 | 一年後! 60 | 61 | 大家開始感覺到不太對勁,有些人想要去買東西的時候,發現沒有鈔票可以用,鈔票的數量好像越來越不夠了。 62 | 63 | 於是大家在用錢的時候都考慮再三,想說非必要的東西就盡量不要買,將鈔票留在家裡,真正需要時才有鈔票可以用。 64 | 65 | 但是越多人這樣想,就越多人想把錢留在手上,於是原本熱絡的商業活動,逐漸變得越來越冷清。 66 | 67 | 做生意的人們都發現,生意越來越難做了! 68 | 69 | 許多商家由於缺乏現金,於是只好降價求售。 70 | 71 | 買東西的人也開始越來越精打細算,希望用最少的鈔票換到最多的物資,於是都會去找價錢最低的商家購買! 72 | 73 | 所以當商家一降價,生意就會好一些,而其他賣的較貴的商家,也就變得乏人問津。 74 | 75 | 於是商家們開始競相降價求售,物價也就不斷的下跌。 76 | 77 | 大家的心理都有一個疑問,「錢」到底都去了哪裡呢? 78 | 79 | ----- 80 | 81 | … [繼續看下一集](HeavenMoney2.md) … 82 | 83 | -------------------------------------------------------------------------------- /data/book/ccc/ai1.md: -------------------------------------------------------------------------------- 1 | # 人工智慧 2 | 3 | | 十分鐘系列的《輕知識》 (PDF) | 網路版 | | 影片 | 討論 | 4 | |--------|-----------|----|-----|-----| 5 | | [用十分鐘瞭解 《人工智慧的那些問題與方法》](../slide/10minAiMethod.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-59517452) | | [YouTube](https://www.youtube.com/watch?v=ckYGuSi0dXM) |[Facebook]() | 6 | | [用十分鐘快速瞭解 《人工智慧的過去、現在與未來》](../slide/10minAiHistory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-58599582) | | [YouTube](http://www.slideshare.net/ccckmit/ss-58599582) |[Facebook](https://www.facebook.com/ccckmit/posts/10153834427671893) | 7 | | [用十分鐘搞懂 《電腦如何解方程式》](../slide/10minScEquation.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-65570387) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154348840866893) | 8 | | [用十分鐘瞭解 機率、統計、還有 R 軟體](../slide/10minProbStatR.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/r-63630366) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154180933891893) | 9 | | [用十分鐘瞭解《電腦到底是怎麼下棋的》](../slide/10minAiChess.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-59361780) | | [影片](https://www.youtube.com/watch?v=l-b6HE9nVQo) | [Facebook](https://www.facebook.com/ccckmit/posts/10153870730806893) | 10 | | [用十分鐘快速理解 《深度學習技術》](../slide/10minAiDeepLearning.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-69541278) | | | [Facebook]() | 11 | | [用十分鐘理解 《神經網路發展史》](../slide/10minAiNeuralHistory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-69447809) | | | [Facebook]() | 12 | | [用十分鐘快速理解 《深度學習技術》](../slide/10minAiHowToDefeatAlphaGo.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-69541278) | | | [Facebook]() | 13 | | [用十分鐘瞭解 《AlphaGo的幾個可能弱點》](../slide/10minAiHowToDefeatAlphaGo.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/alphago-59482042) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10153883738266893) | 14 | | [AlphaGo in Depth (Mark Chang)](../slide/alphago-160315170814) | [SlideShare](http://www.slideshare.net/ckmarkohchang/alphago-in-depth) | | [影片](https://www.youtube.com/watch?v=63FDxJ5e_Ew) | | 15 | | [用30分鐘深入瞭解《AlphaGo圍棋程式的設計原理》](../slide/30minAlphaGo3in1.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/30alphago) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10153908393201893) | -------------------------------------------------------------------------------- /lib/io.js: -------------------------------------------------------------------------------- 1 | var fs = require('mz/fs'); 2 | 3 | var fileWalk = function(dir, path, done) { 4 | var results = []; 5 | var dir = (dir.endsWith("/"))?dir:dir+"/"; 6 | var path = (path.endsWith("/"))?path:path+"/"; 7 | fs.readdir(dir+path, function(err, list) { 8 | if (err) return done(err); 9 | var pending = list.length; 10 | if (!pending) return done(null, results); 11 | list.forEach(function(file) { 12 | fs.stat(dir+path+file, function(err, stat) { 13 | // console.log("path=%s file=%s", path, file); 14 | if (stat && stat.isDirectory()) { 15 | fileWalk(dir, path+file, function(err, res) { 16 | results = results.concat(res); 17 | if (!--pending) done(null, results); 18 | }); 19 | } else { 20 | results.push(path.substring(1)+file); 21 | if (!--pending) done(null, results); 22 | } 23 | }); 24 | }); 25 | }); 26 | }; 27 | 28 | io={ 29 | readJsonSync:function(file) { 30 | var json = fs.readFileSync(file, "utf8"); 31 | return JSON.parse(json); 32 | }, 33 | readFile:function *(file) { 34 | return yield fs.readFile(file, "utf8"); 35 | }, 36 | writeFile:function *(file, text) { 37 | return yield fs.writeFile(file, text); 38 | }, 39 | appendFile:function *(file, text) { 40 | return yield fs.appendFile(file, text); 41 | }, 42 | mkdir:function *(path) { 43 | return yield fs.mkdir(path); 44 | }, 45 | readJson:function *readJson(file) { 46 | var json = yield fs.readFile(file, "utf8"); 47 | return JSON.parse(json); 48 | }, 49 | fileExists:function *(file) { 50 | var fstat = yield fs.stat(file); 51 | return fstat.isFile(); 52 | }, 53 | recursiveList:function(dir) { 54 | return function(done) { 55 | fileWalk(dir, "", done); 56 | } 57 | }, 58 | }; 59 | 60 | module.exports = io; 61 | /* 62 | U.clone=function(o) { 63 | return JSON.parse(JSON.stringify(o)); 64 | } 65 | 66 | U.hash = function(o) { 67 | return hash(o); 68 | } 69 | */ 70 | /* 71 | U.parseJson = function(json) { 72 | json = json.replace(/(\W)(\w+):/gm, '$1"$2":') // id: => "id": 73 | .replace(/:(\w+)/gm, ':"$1"') // :v => :"v" 74 | .replace(/([\{\[])\s*,/gm, '$1') // {, => { 75 | .replace(/,\s*([\}\]])/gm, '$1'); // ,] => ] 76 | // console.log("json=%s", json); 77 | return JSON.parse(json); 78 | } 79 | */ -------------------------------------------------------------------------------- /web/katex/contrib/auto-render.min.js: -------------------------------------------------------------------------------- 1 | (function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.renderMathInElement=e()}})(function(){var e,t,r;return function n(e,t,r){function a(o,l){if(!t[o]){if(!e[o]){var f=typeof require=="function"&&require;if(!l&&f)return f(o,!0);if(i)return i(o,!0);var d=new Error("Cannot find module '"+o+"'");throw d.code="MODULE_NOT_FOUND",d}var s=t[o]={exports:{}};e[o][0].call(s.exports,function(t){var r=e[o][1][t];return a(r?r:t)},s,s.exports,n,e,t,r)}return t[o].exports}var i=typeof require=="function"&&require;for(var o=0;o](https://khan.github.io/KaTeX/) [![Build Status](https://travis-ci.org/Khan/KaTeX.svg?branch=master)](https://travis-ci.org/Khan/KaTeX) 2 | 3 | [![Join the chat at https://gitter.im/Khan/KaTeX](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/Khan/KaTeX?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | 5 | KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. 6 | 7 | * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](http://jsperf.com/katex-vs-mathjax/). 8 | * **Print quality:** KaTeX’s layout is based on Donald Knuth’s TeX, the gold standard for math typesetting. 9 | * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources. 10 | * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML. 11 | 12 | KaTeX supports all major browsers, including Chrome, Safari, Firefox, Opera, and IE 8 - IE 11. A list of supported commands can be on the [wiki](https://github.com/Khan/KaTeX/wiki/Function-Support-in-KaTeX). 13 | 14 | ## Usage 15 | 16 | You can [download KaTeX](https://github.com/khan/katex/releases) and host it on your server or include the `katex.min.js` and `katex.min.css` files on your page directly from a CDN: 17 | 18 | ```html 19 | 20 | 21 | ``` 22 | 23 | #### In-browser rendering 24 | 25 | Call `katex.render` with a TeX expression and a DOM element to render into: 26 | 27 | ```js 28 | katex.render("c = \\pm\\sqrt{a^2 + b^2}", element); 29 | ``` 30 | 31 | If KaTeX can't parse the expression, it throws a `katex.ParseError` error. 32 | 33 | #### Server side rendering or rendering to a string 34 | 35 | To generate HTML on the server or to generate an HTML string of the rendered math, you can use `katex.renderToString`: 36 | 37 | ```js 38 | var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}"); 39 | // '...' 40 | ``` 41 | 42 | Make sure to include the CSS and font files, but there is no need to include the JavaScript. Like `render`, `renderToString` throws if it can't parse the expression. 43 | 44 | #### Rendering options 45 | 46 | You can provide an object of options as the last argument to `katex.render` and `katex.renderToString`. Available options are: 47 | 48 | - `displayMode`: `boolean`. If `true` the math will be rendered in display mode, which will put the math in display style (so `\int` and `\sum` are large, for example), and will center the math on the page on its own line. If `false` the math will be rendered in inline mode. (default: `false`) 49 | - `throwOnError`: `boolean`. If `true`, KaTeX will throw a `ParseError` when it encounters an unsupported command. If `false`, KaTeX will render the unsupported command as text in the color given by `errorColor`. (default: `true`) 50 | - `errorColor`: `string`. A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option determines the color which unsupported commands are rendered in. (default: `#cc0000`) 51 | 52 | For example: 53 | 54 | ```js 55 | katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, { displayMode: true }); 56 | ``` 57 | 58 | #### Automatic rendering of math on a page 59 | 60 | Math on the page can be automatically rendered using the auto-render extension. See [the Auto-render README](contrib/auto-render/README.md) for more information. 61 | 62 | ## Contributing 63 | 64 | See [CONTRIBUTING.md](CONTRIBUTING.md) 65 | 66 | ## License 67 | 68 | KaTeX is licensed under the [MIT License](http://opensource.org/licenses/MIT). 69 | -------------------------------------------------------------------------------- /data/book/ccc/tako.md: -------------------------------------------------------------------------------- 1 | # 章魚圓圓烏賊尖尖 2 | 3 | 有一天,章魚圓圓碰到烏賊尖尖,他們互相凝視著對方,覺得對方長的好奇怪! 4 | 5 | 章魚圓圓:嗨!你好阿! 6 | 7 | 烏賊尖尖:嗨!你好阿! 8 | 9 | 章魚圓圓:我是章魚圓圓,請問你是誰! 10 | 11 | 烏賊尖尖:我是烏賊尖尖,很高興認識你,圓圓! 12 | 13 | 章魚圓圓:我覺得好奇怪,為甚麼你的頭是尖尖的呢? 14 | 15 | 烏賊尖尖:對阿,我也覺得好奇怪,為甚麼你的頭是圓圓的呢? 16 | 17 | 他們兩個一起搔搔頭,然後看著對方笑了! 18 | 19 | 尖尖說:「圓圓、你的頭借我摸摸看好嗎?」 20 | 21 | 圓圓說:「好阿、但是等一下你的頭也要借我摸摸看喔!」 22 | 23 | 尖尖一邊摸一邊說:「哇!好光滑的頭喔!我從來沒有摸過這麼光滑的頭ㄟ!」 24 | 25 | 接著換章魚圓圓了,他摸著尖尖的頭,心理想著,哇!為甚麼他的頭這麼的尖,這樣要怎麼戴帽子啊! 26 | 27 | 尖尖和圓圓互相凝視了一會,然後同時問說:「為甚麼你的頭那麼尖 (圓) 呢?」 28 | 29 | 他們兩個笑著看著對方,好久好久! 30 | 31 | 然後,章魚圓圓說,我們回去問問章魚哥哥好了。 32 | 33 | 他們來道章魚哥哥的洞穴。 34 | 35 | 圓圓說:「哥哥、哥哥、為甚麼我們的頭是圓圓的,他的頭是尖尖的呢?」 36 | 37 | 章魚哥哥說:「因為我們是章魚,他們是烏賊啊!」 38 | 39 | 接著尖尖問說:「那為甚麼章魚的頭會圓圓的,烏賊的頭會尖尖的呢?」 40 | 41 | 章魚哥哥又說:「因為我爸爸媽媽的頭是圓圓的啊!他爸爸媽媽的頭是尖尖的啊!」。 42 | 43 | 然後圓圓又問:「那為甚麼我爸爸媽媽的頭是圓圓的,他爸爸媽媽的頭是尖尖的呢?」。 44 | 45 | 章魚哥哥說:「因為我爺爺奶奶的頭是圓圓的啊!他爺爺奶奶的頭是尖尖的啊!」。 46 | 47 | 圓圓和尖尖還是不太滿意,想要繼續追問下去。 48 | 49 | 章魚哥哥心想,這兩個小鬼頭,要是在這樣問下去,我要怎麼去和女朋友約會啊! 50 | 51 | 於是他告訴尖尖和圓圓說:「你們可以去問人類啊!聽說人類是這個世界上最聰明的動物了!」。 52 | 53 | 於是圓圓和尖尖決定出發去問人類,他們來到一個人的家,那個家前面的門牌上寫著:「孔子」。 54 | 55 | 他們敲敲門,不久,有一位老先生出來開門了。 56 | 57 | 於是圓圓說:「老先生您好,我們有些事情想請問您!可以嗎?」 58 | 59 | 孔子回答說:「自行束脩以上,吾未嘗無誨焉」。 60 | 61 | 圓圓和尖尖都張大了嘴,互相看來看去!因為他們都聽不懂老先生在說甚麼! 62 | 63 | 尖尖說:「老先生,請問甚麼是束脩啊!」 64 | 65 | 孔子說:「束脩啊!就是肉乾的意思,剛剛那句話就是說,如果你有交肉乾或更好的東西給我,我一定會好好回答你們的問題的!」 66 | 67 | 圓圓說:「老先生,不好意思!可是我們沒有帯肉乾ㄟ!」 68 | 69 | 孔老先生說:「那你們有甚麼東西可以作為拜師的禮物阿!拜師一定要有禮物,這是一種禮貌喔!」 70 | 71 | 圓圓說:「我好像沒有帯甚麼禮物ㄟ!」 72 | 73 | 尖尖說:「我好像也沒有帯甚麼禮物ㄟ,那怎麼辦!」 74 | 75 | 孔老先生說:「沒有關係!尖尖,你是烏賊對吧!圓圓,你是章魚對吧!你們身上都有很棒的禮物喔!就用他們來當拜師禮好了。」 76 | 77 | 圓圓看看尖尖,尖尖看看圓圓,兩人都搔搔頭說:「我們身上怎麼會有禮物呢?」 78 | 79 | 孔老先生親切的說了:「你們身上都帶有墨汁吧!剛好我可以用來寫毛筆字,你們就一人噴一些墨汁在我的硯台裏就可以了。」 80 | 81 | 圓圓和尖尖開心的說:「原來如此!那沒有問題。」,圓圓和尖尖開心的噴了許多墨汁在孔子的硯台裏。 82 | 83 | 圓圓和尖尖接著向老先生鞠躬說:「老師好!那老師現在可以為我們解答問題了嗎?」 84 | 85 | 孔老先生說:「好啊!兩位同學有甚麼問題呢?」 86 | 87 | 圓圓說:「老師,請問您知道,為甚麼我們章魚的頭是圓圓的,他們烏賊的頭是尖尖的呢?」 88 | 89 | 尖尖說:「對阿對阿!為甚麼呢?」 90 | 91 | 孔老先生想了又想,想了又想,想到臉都發青了,然後說:「知之為知之,不知為不知,是知也!」 92 | 93 | 圓圓看了看尖尖,尖尖看了看圓圓,兩個人一臉茫然,然後尖尖說:「老師,我們聽不懂ㄟ!」 94 | 95 | 孔老先生又說:「這句話的意思就是說呢:我知道就會說知道,不知道就會說不知道,這樣才是真的知道」。 96 | 97 | 圓圓與尖尖又對望了一會兒,然後說:「那老師您倒底是知道還是不知道呢?」 98 | 99 | 孔老先生接著說:「不好意思!我真的不知道」。 100 | 101 | 圓圓和尖尖失望的說:「喔!真是可惜!」 102 | 103 | 孔老先生又說:「不過,雖然我不知道,但是我可以介紹你們去找另一位老師喔!」 104 | 105 | 圓圓和尖尖原本下垂的肩膀,突然又挺了起來,眼神也亮起來了! 106 | 107 | 「老先生,您說的那位老師在哪裡啊!」 108 | 109 | 孔老先生說:「你們到一條稱為小獵犬號的船上,去尋找達爾文先生,他應該可以告訴你們答案」。 110 | 111 | 於是圓圓和尖尖游阿游的,經過了好長好長的一段旅程,終於找到了小獵犬號。 112 | 113 | …. 114 | 115 | 圓圓和尖尖發現小獵犬號停在一個島嶼的旁邊,有一位年輕人正在海邊觀察著各種生物。 116 | 117 | 圓圓大叫:「先生,您好阿!請問您知道達爾文先生在哪裡嗎?」 118 | 119 | 那位年輕人轉過頭來,東找西找的:「是誰在叫我阿!」 120 | 121 | 圓圓說:「是我啦!我是章魚圓圓」。 122 | 123 | 尖尖說:「還有我還有我,烏賊尖尖」。 124 | 125 | 圓圓說:「難道你就是達爾文先生嗎?真是太好了,我們有問題想請教您!」 126 | 127 | 達爾文說:「好阿!兩位有甚麼問題呢?」 128 | 129 | 圓圓說:「達爾文先生,你看我的頭喔!請問為甚麼我的頭是圓圓的,而他的頭卻是尖尖的呢?」 130 | 131 | 達爾文:「這個嗎?我最近正好提出了一種理論,可以解釋你們兩個為甚麼長得不同,這個理論叫做物競天擇,適者生存!」 132 | 133 | 圓圓說:「物競天擇,適者生存?」 134 | 135 | 尖尖說:「那是甚麼意思呢?」。 136 | 137 | 達爾文:「意思就是說,生物與生物之先會互相競爭,想辦法活下來,但是只有能適應環境的生物才能持續存活,而那些無法適應環境的生物很可能隨著時間經過而被淘汰」 138 | 139 | 達爾文又說:「我在猜阿!你們兩個的祖先,有可能都是頭圓圓章魚喔!」 140 | 141 | 尖尖說:「那為甚麼我們會變成頭尖尖的烏賊呢?」 142 | 143 | 達爾文說:「這個嗎?叫做突變!」 144 | 145 | 圓圓與尖尖同時叫到:「突變?」 146 | 147 | 達爾文: 148 | 149 | 「突變的意思就是說:你們的某個圓圓頭的章魚祖先,竟然生下了一個長著尖尖頭的小孩,與他們不一樣」 150 | 151 | 「然後,這個尖尖頭的小孩,又生了一代又一代的小孩,後來,尖尖頭變得越來越長」。 152 | 153 | 「尖尖頭變得越來越長,如果沒有骨頭支撐,那很可能就會垂下來,這樣會很難行動,所以過了一代又一代,烏賊又突變後長出了像塑膠一樣的骨骼支撐身體,然後又長出了小翅膀幫助他可以遊得更快,在遇到敵人的時候可以快速的逃命」。 154 | 155 | 圓圓說:「那意思就是說,我們比較容易被敵人吃掉囉!那為甚麼我們沒有通通變成烏賊呢?或者我們因為比較容易被吃掉而消失呢?」 156 | 157 | 達爾文說:「那我們來比賽一下就知道了,這個比賽有兩個部分,第一個部分是比看誰逃的快,在空曠的地方不容易被吃掉」 158 | 159 | 於是達爾文叫出了他的好朋友,一隻海狗。 160 | 161 | 尖尖和圓圓都嚇得臉色發白:「救命阿!」 162 | 163 | 海狗立刻跳下水裏,開始朝著尖尖和圓圓游去,此時間間與圓圓同時噴出了墨汁。 164 | 165 | 尖尖在噴出墨汁的同時,就一溜煙的像火箭一樣噴射了出去,然後消失得無影無蹤了! 166 | 167 | 但是章魚圓圓逃得比較慢,眼看就要被海狗追上了! 168 | 169 | 就在千鈞一髮之際,章魚圓圓看到有個石頭小洞洞,馬上躲到洞洞裏面。 170 | 171 | 海狗用手不管怎麼挖,都沒辦法碰到章魚圓圓,但是圓圓在裏面還是嚇得全身都縮成了一團。 172 | 173 | 這時只看到達爾文吹的一聲口哨,海狗馬上游回達爾文身邊,達爾文拿出了一條魚出來餵海狗,然後海狗吃完魚就懶懶得躺在石頭上做日光浴了。 174 | 175 | 達爾文大聲說:「尖尖圓圓,你們可以出來了!」 176 | 177 | 圓圓縮在洞裏說:「我不敢,我怕海狗咬我!」 178 | 179 | 然後才聽到遠方尖尖傳來小小的聲音說:「我也不敢!」 180 | 181 | 達爾文說:「不用怕,海狗是我的好朋友,我已經告訴他不准吃你們了!難道,你們不想知道問題的答案了嗎?」 182 | 183 | 為了知道問題的答案,圓圓和尖尖終於鼓起勇氣,回到達爾文先生的身邊。 184 | 185 | 尖尖一邊緊張的看著躺在石頭上海狗,一邊問說:「達爾文先生,可以告訴我們答案了嗎?」 186 | 187 | 達爾文說:「根據我的推論,由於你們兩個族群都具有某種生存優勢,所以章魚和烏賊都活了下來」。 188 | 189 | 圓圓尖尖很專心的聽著! 190 | 191 | 達爾文接著說: 192 | 193 | 「烏賊由於身體非常流線型,可以很快的游動身體,而且頭上有兩個小翅膀可以幫忙控制方向,所以可以在噴完墨汁後很快的逃離敵人的視線,因此相當具有生存優勢!」 194 | 195 | 「章魚雖然逃得較慢,但是他們由於沒有骨骼,身體很柔軟,可以躲入很小的洞洞之內以避免被敵人攻擊,所以只要住在有很多石頭洞穴的地方,就不容易被吃掉了,而且可以躲起來出其不意的抓住一些小小的海底生物飽餐一頓,所以章魚也就可以在這些區域活得很好!」 196 | 197 | 尖尖和圓圓恍然大悟,原來是這樣,他們終於知道問題的答案了! 198 | 199 | 圓圓和尖尖都很高興的向達爾文先生道謝!感謝他的教導! 200 | 201 | 達爾文先生說:「其實,是我應該感謝你們兩個才對!因為你們兩個的出現,讓我能更清楚的思考,為何章魚和烏賊都可以順利的活下來呢?這種生物多樣性其實是我之前一直想不清楚的」。 202 | 203 | 圓圓和尖尖很高興的向達爾文先生說再見,然後快樂的一起游回家去! 204 | -------------------------------------------------------------------------------- /lib/model.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var io = require("./io"); 3 | var mongo = require('./mongo'); 4 | var MD = require('./markdown'); 5 | var M = module.exports = {} 6 | 7 | M.init = function*(root) { 8 | M.bookRoot = path.join(root, 'data/book'); 9 | M.userListFile = path.join(M.bookRoot, 'system/userlist.md'); 10 | M.bookListFile = path.join(M.bookRoot, 'system/booklist.md'); 11 | M.settingFile = path.join(root, 'setting/setting.mdo'); 12 | var settingMdo = yield io.readFile(M.settingFile); 13 | M.setting = MD.parseMdo(settingMdo); 14 | M.setting.users = MD.index(M.setting.users, 'user'); 15 | // console.log("M.setting=%j", M.setting); 16 | M.users = M.setting.users; 17 | try { 18 | M.db = yield mongo.open('bookdown', M.setting.db); 19 | M.docTable = M.db.collection('doc'); 20 | M.fileTable = M.db.collection('file'); 21 | } catch (e) { 22 | console.log("Mongodb connect fail : no database supported !"); 23 | } 24 | } 25 | 26 | M.close = function*() { 27 | yield mongo.close(M.db); 28 | } 29 | 30 | M.getBookPath = function(book) { 31 | // console.log("M.bookRoot=%s book=%s", M.bookRoot, book); 32 | return path.join(M.bookRoot, book); 33 | } 34 | 35 | M.getFilePath = function(book, file) { 36 | return path.join(M.getBookPath(book), file); 37 | } 38 | 39 | M.getBook = function*(book) { 40 | var bookFile = path.join(M.getBookPath(book), "book.mdo"); 41 | var bookMdo = yield io.readFile(bookFile); 42 | var bookObj = MD.parseMdo(bookMdo); 43 | bookObj.book = book; 44 | return bookObj; 45 | } 46 | 47 | M.getBookFile = function*(book, file) { 48 | var filePath = M.getFilePath(book, file); 49 | var hasFile = yield io.fileExists(filePath); 50 | if (hasFile) { 51 | fileObj = { book:book, file:file }; 52 | fileObj.text = yield io.readFile(filePath); 53 | return fileObj; 54 | } 55 | } 56 | 57 | M.saveBookFile = function*(book, file, text) { 58 | console.log("save:%s/%s", book, file); 59 | var path = book+"/"+file; 60 | var filePath = M.getFilePath(book, file); 61 | yield io.writeFile(filePath, text); 62 | if (typeof M.db === 'undefined') return; 63 | if (file.endsWith(".md")) 64 | yield mongo.saveMd(M.docTable, text, path); 65 | else if (file.endsWith(".json")) 66 | yield mongo.saveJson(M.docTable, io.parseJson(text), path); 67 | else 68 | yield mongo.saveText(M.docTable, text, path); 69 | } 70 | 71 | M.createBook = function*(book, user) { 72 | console.log("createBook:%s", book); 73 | var isMkdir = yield io.mkdir(M.getBookPath(book)); 74 | yield io.writeFile(M.getBookPath(book)+'/book.mdo', 75 | 'title:Book Title\neditor:'+user+'\nchapters:\ntitle | link\n-------------|---------\nREADME | README.md\nChapter1 | chapter1.md'); 76 | yield io.appendFile(M.bookListFile, '\n['+book+'](../'+book+'/) | ['+user+'](../'+user+'/)'); 77 | } 78 | 79 | M.createUser = function*(user) { 80 | console.log("createUser:%s", user); 81 | var isMkdir = yield io.mkdir(M.getBookPath(user)); 82 | yield io.appendFile(M.userListFile, '\n['+user+'](/view/'+user+'/) | '+user); 83 | yield io.writeFile(M.getBookPath(user)+'/book.mdo', + 84 | 'title:'+user+'\neditor:'+user+'\nchapters:\ntitle | link\n'+ 85 | '-------------|---------\n'+user+' | README.md'); 86 | yield io.writeFile(M.getBookPath(user)+'/README.md', 87 | '## About Me\n* name:'+user+'\n* email: ???\n\n## My Book\n\n* [MyBook1](../'+user+'/)\n'); 88 | } 89 | 90 | M.addUser = function*(user, password) { 91 | var userObj = M.setting.users[user]; 92 | if (typeof userObj === 'undefined') { 93 | var userObj = {user:user, password:password}; 94 | M.setting.users[user] = userObj; 95 | var msg = '\n'+user+' | '+password; 96 | console.log("appendFile:M.settingFile=%s text=%s", M.settingFile, msg); 97 | yield io.appendFile(M.settingFile, msg); 98 | yield M.createUser(user); 99 | return true; 100 | } else { 101 | return false; 102 | } 103 | } 104 | 105 | M.search = function*(keywords, q={}) { 106 | var results = yield mongo.search(M.docTable, keywords, q); 107 | // console.log("=========================================="); 108 | // console.log("search(%s,%j)=%j", keywords, q, results); 109 | return results; 110 | } 111 | 112 | M.query = function*(q) { 113 | var results = yield mongo.query(M.docTable, q); 114 | console.log("=========================================="); 115 | console.log("query(%j)=%j", q, results); 116 | return results; 117 | } 118 | 119 | M.uploadToDb = function*() { 120 | var fileList = yield io.recursiveList(M.bookRoot); 121 | yield mongo.importFiles(M.docTable, M.bookRoot, fileList); 122 | } 123 | -------------------------------------------------------------------------------- /data/book/ccc/sc1.md: -------------------------------------------------------------------------------- 1 | # 科學計算 2 | 3 | | 十分鐘系列的《輕知識》 (PDF) | 網路版 | | 影片 | 討論 | 4 | |--------|-----------|----|-----|-----| 5 | | [用十年也搞不懂《Cantor奇幻的集合論世界》](../slide/10minContorSetTheory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/cantor-69154183) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154587330761893) | 6 | | [用十分鐘快速掌握《數學的整體結構》](../slide/10minMathOverview.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-68579935) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154566034346893) | 7 | | [用十分鐘欣賞《物理學公理系統的演化史》](../slide/10minPhysicsAxiom.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-67170427) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154477490521893) | 8 | | [用十分鐘瞭解 《JavaScript的程式世界》](../slide/10minJavaScriptWorld.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/javascript-65883956) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154376627286893) | 9 | | [用十分鐘搞懂 《電腦如何解方程式》](../slide/10minScEquation.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-65570387) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154348840866893) | 10 | | [那些我們幾乎都沒學過 ,但是也不太會想去學的 《非歐幾何學》](../slide/10minGeometryNonEuclid.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-65353098) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154328342866893) | 11 | | [那些我們都曾經學過 ,但是卻幾乎沒有人知道自己學過的《歐氏幾何》](../slide/10minGeometryEuclid.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-65304839) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154325000116893) | 12 | | [用十分鐘瞭解 愛因斯坦的相對論](../slide/10minRelativityTheory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-65389497) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154331212361893) [2](https://www.facebook.com/ccckmit/posts/10154339910901893) | 13 | | [為何中學生應該學習科學史](../slide/10minWhyScienceHistory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-65198664) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154316137021893) | 14 | | [用十分鐘瞭解 機率、統計、還有 R 軟體](../slide/10minProbStatR.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/r-63630366) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154180933891893) | 15 | | [用十分鐘瞭解《日本史與明治維新》](../slide/10minJapanMeiji.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-63247848) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154138420806893) | 16 | | [用十分鐘瞭解《 新竹科學園區的發展史》](../slide/10minHsinchiuSciencePark.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-63170164) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154145586616893) [2](https://www.facebook.com/ccckmit/posts/10154143790021893) | 17 | | [古希臘哲學家的悲慘結局](../slide/10minSciHistoryAncient.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-62521794) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154097276201893) | 18 | | [用十分鐘瞭解早期的科學史 (從埃及到文藝復興)](../slide/10minSciHistoryAncient.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-62503377) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154094963261893) | 19 | | [一個程式人對物理學的疑惑 , 以及對新物理學的奇幻想法](../slide/10minPhysicsWondering.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-62048537) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10154063523536893) | 20 | | [用十分鐘瞭解JavaScript的模組 -- 《還有關於npm套件管理的那些事情》](../slide/10minJsNpm.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/javascript-npm) | | [YouTube](https://www.youtube.com/watch?v=7QNi-XJq4bU) | [Facebook](https://www.facebook.com/ccckmit/posts/10153942704166893) | 21 | | [用十分鐘瞭解 陳鍾誠的程式設計課 (採用JavaScript + C的原因)](../slide/10minCccCodeCourse.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/javascript-c) | | [YouTube](https://www.youtube.com/watch?v=tyeNGY2i0xE) |[Facebook](https://www.facebook.com/ccckmit/posts/10153831771736893) | 22 | | [用十分鐘 瞭解《圖靈獎得主》的學術貢獻](../slide/10minTuringAward.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-57452126) | | |[Facebook](https://www.facebook.com/ccckmit/posts/10153769866561893) | 23 | | [用十分鐘搞懂《離散數學》-- 外加《代數結構》與《作業研究》](../slide/10minDiscreteMath.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-57362287) | | | | 24 | | [用十分鐘瞭解 《電的歷史》](../slide/10minElectronicsHistory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-57170964) | | | [Facebook]() | 25 | | [用十分鐘瞭解《線性代數、向量微積分》以及電磁學理論](../slide/10minMatrixField.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-57144026) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10153753565976893) | 26 | | [[用十分鐘學會《微積分、工程數學》及其應用](../slide/10minWaveMath.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-57088188) | | | [Facebook](https://www.facebook.com/ccckmit/posts/10153748983326893) | 27 | | [用十分鐘看懂《近代科學發展史》](../slide/10minSciHistory.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-56937501) | | | | 28 | | [用十分鐘學會《資料結構、演算法和計算理論》](../slide/10minAlgDsCT.pdf) | [SlideShare](http://www.slideshare.net/ccckmit/ss-56891871) | | | | 29 | -------------------------------------------------------------------------------- /view/view.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Bookdown: {{{book.title}}} 8 | {{#if useLocal}} 9 | 10 | 11 | 12 | {{else}} 13 | 14 | 15 | 16 | {{/if}} 17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 58 |
59 | 60 |
61 | 62 | 72 | 73 |
74 |
{{{file.html}}}
75 |
76 |
77 | 78 |
79 | 81 |
82 |
83 | 84 | 85 | {{#if useLocal}} 86 | 87 | 88 | 93 | {{else}} 94 | 95 | 96 | 101 | {{/if}} 102 | 103 | 104 | -------------------------------------------------------------------------------- /lib/mongo.js: -------------------------------------------------------------------------------- 1 | var MD = require("./markdown"); 2 | var io = require("./io"); 3 | // var File = U.File; 4 | var mongodb = require('mongodb'); 5 | var path = require("path"); 6 | var M = module.exports = {} 7 | 8 | /* 9 | 注意: MongoDB 3.2 版之後可以支援中文全文檢索了,但目前我們還是使用下列方法。 10 | 11 | MongoDB 只支援《英文和數字的全文檢索》,但是不能正確進行《中文全文檢索》。 12 | 於是我將所有非英文 unicode 字元通通轉成其 unicode 16進位數字碼,放入 keywords 欄位中,這樣就可以先將查詢的中文轉成數字碼後,再進行檢索 ... 13 | 這種方法讓 mongoDB 也能支援《中文的全文檢索》了! 14 | 15 | 範例: 16 | 文章:.... 我是陳鍾誠 .... => ... 6211 662f 9673 937e 8aa0 ... 17 | 檢索:包含《誠》字的文章 => mdTable.find({"$text":{"$search":getKeywords("誠")}}).toArray(); 18 | 19 | 但這種方法可能會誤撞,說明如下: 20 | 21 | 對於多個中文字形成的詞彙,像是《皮卡丘》,如果沒有把完整的詞碼也儲存,可能會撞到《他的皮卡在山丘上》這句或,導致誤撞,還需要進一步過濾! 22 | */ 23 | // http://stackoverflow.com/questions/5827612/node-js-fs-readdir-recursive-directory-search 24 | 25 | M.open = function*(dbName, setting) { 26 | return yield mongodb.MongoClient.connect("mongodb://"+setting.user+":"+setting.password+"@127.0.0.1:"+setting.port+"/"+dbName); 27 | } 28 | 29 | M.close = function*(db) { 30 | yield db.close(); 31 | } 32 | 33 | M.saveText = function*(docTable, text, filePath) { 34 | var type = path.extname(filePath).substring(1); 35 | var file = { path:filePath, text:text, type:type }; 36 | file.keywords = M.getKeywords(text); 37 | // console.log("saveText:file=%j", file); 38 | var result = yield docTable.updateOne({ path:filePath, type:file.type }, file, {upsert:true}); 39 | } 40 | 41 | M.saveMd = function*(docTable, md, filePath) { 42 | console.log("saveMd:filePath=%s", filePath); 43 | yield docTable.remove({path:filePath}); 44 | yield M.saveText(docTable, md, filePath); 45 | /* 46 | var file = { path:filePath, md:md, type:"md" }; 47 | file.keywords = M.getKeywords(file.md); 48 | var result = yield docTable.updateOne({ path:filePath, type:file.type }, file, {upsert:true}); 49 | */ 50 | var parts = MD.parse(md).parts; 51 | for (var pi=0; pi=0 117 | }) 118 | }) 119 | } 120 | 121 | M.charToUnicode = function(c) { 122 | return c.toString(16); 123 | } 124 | 125 | M.unicodeToChar = function(code) { 126 | return String.fromCodePoint(parseInt(code, 16)); 127 | } 128 | 129 | M.getEnglishWords = function(text) { 130 | var m = text.match(/\w+/gi); 131 | return (m)?m.join(' '):''; 132 | } 133 | 134 | M.getKeywords = function(text) { 135 | var keywords = new Set(); 136 | for (var i=0; i=256) { // not ASCII (English) 139 | keywords.add(M.charToUnicode(c)); 140 | } 141 | } 142 | return Array.from(keywords).join(" "); 143 | } 144 | 145 | M.decodeKeywords=function(keywords) { 146 | var keys = keywords.split(" "); 147 | var decode=[]; 148 | for (var i=0; i 2 | ]> 3 | 4 | Creative Commons “Attribution-Share Alike” license icon 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /data/book/ccc/assistant.md: -------------------------------------------------------------------------------- 1 | # 助理 2 | 3 | 早晨,陽光從小小的窗戶中映照了進來,小小的套房當中,新婚的「以翔」和「曉婷」兩人,相互的依偎在一起。 4 | 5 | 今天,是曉婷上班的第一天,早上六點,鬧鐘準時的「ㄌㄧㄤ … ㄌㄧㄤ … 」的響了起來,曉婷很快的起來烤好了土司,沖好了牛奶。 6 | 7 | 以翔雖然已經醒了,卻還在床上懶洋洋的躺著,一雙大眼睛看著曉婷,然後聞了聞棉被,棉被上還遺留著曉婷身上的香味,這讓以翔更不想起床了。 8 | 9 | 以翔伸了伸懶腰,看著忙進忙出的曉婷,突然好想再抱著她,於是偷偷的走到他後面,伸出手摟著曉婷的腰。曉婷感覺到以翔剛溫暖的身體,不由得停了下來,依偎在以翔的懷裡,好久,好久! 10 | 11 | 直到牆上的掛鐘「咚」的一聲,曉婷忽然回神了過來。糟了,曉婷想起今天是第一天上班,即便百般的不願意,卻仍然勉強的從以翔的懷裡掙扎了出來:「今天是我第一天上班,不能遲到,早餐已經準備好了,都在桌上,我先去上班了,掰掰!」 12 | 13 | 即便如此,曉婷到達學校時,已經是 7:35 分了,比國小的到校時間 7:30 分晚了五分鐘。曉婷才一踏進校門,就很不巧的碰見了人事主任,人事主任白了她一眼,冷冷的說道:「就算是新婚,也不能第一天上班就遲到啊!」。 14 | 15 | 雖然人事主任的臉色不太好看,但曉婷卻不以為意,因為聽到「新婚」兩個字,腦海中想起了昨晚以翔抱著她,兩人翻雲覆雨時的情況。想到這裏,曉婷的臉上不由得一陣泛紅,低著頭往辦公室的方向走去。 16 | 17 | 到了辦公室,還沒來得及與同事們打招呼,組長就召集 3 位助理集合,然後說:「我性江,是各位的組長,也是本校的老師,雖然我的年紀比各位大很多,但是很好溝通,各位也不用把我當成上司,不仿就把我當成大姐姐,有甚麼事情盡管來找我,我會盡力的幫助大家,為大家服務」。 18 | 19 | 曉婷聽了江組長的話,心裡踏實了許多,在組長離開之後,轉頭對身旁的林小姐說:「組長的人好像還不錯喔!」,沒想到卻被白了一眼:「以後你就知道了」。 20 | 21 | 由於是新進員工,曉婷事事都向同事們請教,同事們也都很樂意的回答她。很快的,曉婷對工作逐漸熟悉了起來,對各項事務也開始上手了。即使是那位白了她一眼的林小姐,其實也是個直腸子的人,只要瞭解了個性,就非常好相處的。 22 | 23 | 隔週,林小姐告訴曉婷:「江組長說有事找你,我想多半沒好事,請自己小心點!」。 24 | 25 | 果不其然,曉婷才踏進林組長的辦公室,就覺得她臉色不對。 26 | 27 | 「上週的週報表呢?」林組長說。 28 | 29 | 曉婷壓根聽不懂林組長說的意思,一時愣住了。接著林組長沒好氣的說:「菜鳥就是菜鳥,果然搞不清楚狀況,以後請你自己找時間打好週報表,每週五交給我過目,知道了嗎?」 30 | 31 | 曉婷腦中想起了當初林小姐白了她一眼的畫面,心裡想著:「難不成這就是林小姐白了我一眼的原因」。 32 | 33 | 「請問組長,週報表應該怎麼打呢?」,話才一出口,曉婷心裡就開始後悔了。 34 | 35 | 「這種事還要我教嗎?自己去問問不就知道了嗎?」,江組長一臉輕蔑的說。 36 | 37 | 「哦!我知道了,謝謝組長」,曉婷不敢再問,快步的走回了辦公室。 38 | 39 | 林小姐看見曉婷悶悶不樂的走了回來,料想組長一定是給曉婷臉色看了,於是輕聲的問他說:「組長給你臉色看了,是嗎?」。 40 | 41 | 曉婷點了點頭,難過的說:「組長說我沒交週報表,臉色不太好看」。 42 | 43 | 「沒關係,我把我的版本給你參考,你改一改,以後準時交就是了」,林小姐用安慰的語氣說著。 44 | 45 | 下午 4:55 分,曉婷好不容易才做完了工作,也協助老師們送走了學生,好不容易才坐下來喘口氣,卻看見江組長走了進來。 46 | 47 | 「曉婷!看來你沒甚麼事,我們組上的書桌啊,櫃子啊,抽屜啊,上面都有一些灰塵,東西也沒整理好,明天校長可能會來,請你在明天之前把他整理乾淨,免得校長說我們的環境很髒亂」,江組長說。 48 | 49 | 曉婷一臉為難,因為她的週報表都還沒有時間打,眼看就快下班了,江組長才又交代了這一大堆工作。曉婷突然好想回家和以翔在一起,但是想到臨時交辦的這麼一大堆工作,心裏不免沮喪的起來。 50 | 51 | 這時,江組長反到開心的跟大家說:「下班了,大家再見囉!」。 52 | 53 | 看見組長轉身離開,曉婷心理更難過了,曉婷好想趕快回到家,卻又想起今天江組長的輕蔑的眼神,心理正在掙扎的時候,電話突然響了。 54 | 55 | 是以翔打電話來了,以翔說:「老婆,我現在開車去接你下班喔!大約 5:30 會到你們學校,你等我一下喔!」。 56 | 57 | 曉婷不知怎麼回答,難過得發呆了半响。 58 | 59 | 以翔覺得不太對勁,於是問:「老婆,怎麼了,需要我幫忙嗎?」。 60 | 61 | 「老公,我今天還有很多工作,可能要忙到很晚」,說到這裡,曉婷心裡想起自己打字很慢,於是不好意思的說:「你可不可以來幫我打週報表?你知道我打字打得慢,如果我今天要自己打週報表,恐怕到明天早上都打不完。而且我還有一大間辦公室與一堆教具要整理」,曉婷語帶撒嬌的說著。 62 | 63 | 「好吧!我先到學校去,看看是甚麼情況再說,對了,我乾脆先買了晚餐一起帶去好了,免得你又餓過頭了」,以翔又無奈,又心疼的說。 64 | 65 | 半小時後,以翔帶著還微溫的燒肉飯與味增湯到了學校,看到正努力打掃著辦公室的曉婷,心理覺得有點不捨,以翔說:「老婆,如果不開心,那就別做了,我的薪水養活我們兩個人還沒有甚麼問題,我不想看到妳這樣悶悶不樂的」。 66 | 67 | 「沒有甚麼啦!我還是個新人,剛開始總是會不適應,過一陣子應該就好了」,曉婷反過來安慰以翔。 68 | 69 | 他們兩人互相看著對方,以翔不捨的眼神,讓曉婷感覺到一陣溫暖,當以翔轉過身要拿餐盒的時候,曉婷忍不注抱住了以翔說:「老公,謝謝你!」。 70 | 71 | 吃完飯後,曉婷又忙著打掃了起來,以翔則打開曉婷的電腦,開始準備打週報表,於是曉婷一邊打掃一邊告訴以翔如何找到林小姐給的週報表,以及要打些甚麼。 72 | 73 | 雖然以翔打字並不慢,但卻不免心疼老婆,嘴上嘟噥著:「這個學校真是虐待人,不給人家時間打報表就算了,快下班了才交待一大堆工作,擺明了就是要員工晚上留下來工作,難不成是故意刁難新人」。 74 | 75 | 「快別這麼說了,要是被人家聽到傳到江組長的耳朵,我難免又要挨一頓罵了」,曉婷擔心的說。 76 | 77 | 不管日子過得如何,時間也不會停下來等一等,很快的,又過了三個月。 78 | 79 | 雖然江組長仍然常常再下班前交辦一堆「急事」,而且這些事情早就可以事先交代好的,但是沒有人敢去告訴江組長這件事。因為大家還記得上次林小姐勸告江組長的那件事,結果江組長竟然大發脾氣,反過來訓了林小姐一頓:「翅膀長硬了嗎?你這是在教訓我囉!我做的事情你也敢管起來了,如果你不想做的話,後面還有一大堆人排隊等著要做這個工作,也不差你一個」。 80 | 81 | 於是曉婷仍然經常得為這些「急事」留下來加班,而以翔也只好留下來幫忙打「週報表」了。 82 | 83 | 兩個小夫妻雖然上班辛苦,但是卻也仍然感受著新婚的的喜悅,兩人甜蜜幸福的感覺,讓住在隔壁的阿嫂都說:「真是幸福啊!一個在學校工作,一個在公司上班,一個月賺好多萬喔!真是幸福啊!」 84 | 85 | 然而,由於受到美國房地產崩潰的影響,以翔突然被無預警的裁員了。這個突如起來的事件讓以翔不知所措,還好,以翔並沒有被打倒,只是默默努力的找著工作。 86 | 87 | 有天,曉婷下班前又被交辦了一堆差事,於是以翔又來幫忙。 88 | 89 | 「老婆啊!還好有你這個工作,否則我就真的成為失業人士了,感謝曉婷老闆的聘僱,讓我有工作可以做」,以翔自嘲的說。 90 | 91 | 突然,曉婷感到一陣不適,開始冒冷汗,而且天旋地轉了起來,以翔趕緊扶著她休息一下。 92 | 93 | 「怎麼會這樣,是不是太累了,我想你應該休息一下」,以翔溫柔的說。 94 | 95 | 「不行,我的工作還沒做完,這樣我明天會被罵的」,曉婷虛弱又緊張的說。 96 | 97 | 「別管工作的事了,我帶你去看一下醫生,這樣下去,鐵打的人也會生病的」,以翔生氣了,他氣老婆太過盡職,也氣這個學校太過虐待人。 98 | 99 | 當曉婷從診所出來時,心理既擔心又高興,不知該如何對以翔說。 100 | 101 | 「老婆,怎麼樣,醫生怎麼說?」以翔問道。 102 | 103 | 「醫生說我可能懷孕了,剛剛已經幫我驗了一下,待會就會知道結果了」,曉婷回答。 104 | 105 | 十五分鐘後,護士小姐再度叫了曉婷的名字,這回以翔陪著曉婷進去診間。 106 | 107 | 「恭喜你了,小伙子!你要做爸爸了,回去記得好好照顧妳太太,她現在可是位孕婦喔!」,醫生對著以翔說。 108 | 109 | 對於兩個二十四歲的年輕人而言,似乎很難與爸爸媽媽這兩個名詞關聯起來,曉婷和以翔都才剛從大學畢業沒多久,兩個人都第一次工作,突然之間要為人父母,兩人都感到既高興,卻又相當的徬徨而無助。 110 | 111 | 為了慶祝兩人升格為爸爸媽媽,以翔提議今天上館子用餐,讓孕婦休息一下。 112 | 113 | 回到家,兩人躺在床上,卻都睡不著,於是蓋著棉被聊了起來。 114 | 115 | 「老公,你想要男生還是女生呢?我們該為小孩取甚麼名字呢?小寶貝會像誰呢?」,曉婷一雙大眼睛水汪汪的看著以翔說。 116 | 117 | 然而,以翔心理所想的卻是另一件事:「才剛失業,沒有了收入,小孩卻又要出生了。曉婷的學校卻又那麼虐待人,她們會同意讓一個孕婦繼續工作嗎?即使讓她繼續工作,我又怎麼能讓她挺著大肚子工作,而我自己卻無所事事的呆在家裡呢?」 118 | 119 | 「老公,你有心事,是嗎?」,曉婷察覺了以翔的心裡有事。 120 | 121 | 「老婆,我在想,我現在失業中,小孩又要出生了,這樣子你會很辛苦,挺著個大肚子工作,也挺不方便的」,以翔說出了她的疑慮。 122 | 123 | 「沒關係,我明天就去學校問問看,我們是否能請產假,產假總共有幾天,既然是在小學工作,應該不會連產假都沒有才對」,曉婷試圖緩和以翔的疑慮。 124 | 125 | 隔天,曉婷到了學校,就趁著工作的空檔去問了人事主任,人事主任說:「照理講,你們是可以請產假的,按照公務人員的規定,產假總共有 42 天」。然後,人事主任遲疑了一下,緩緩的說:「但是由於你們的身分是助理,而這個職缺的經費早就已經定案了,一但要請產假,我不知道會計主任那邊會不會有甚麼問題,你最好再去問一下會計主任」。 126 | 127 | 雖然曉婷心裡很急,但是學校的鐘聲又響起來了,她只好趕快回去工作,直到快下班之前,才好不容易又找到一個空檔,趕緊去會計室找到了會計主任,會計主任想了一想,說道:「妳們這群助理的經費是由社會局補助的經費中支付的,社會局的補助金額是固定的,不可能再增加了,如果要請產假,除非社會局的補助有所增加,否則你就必須自行聘請代理人,並負擔代理人的薪資」。 128 | 129 | 這下,曉婷有一些失望了,想不到國小的助理感覺上好像是公務員,但是所有的福利通通不能比照,工作多得不得了,在上班時被使喚來使換去的,最後卻還要自掏腰包請代理人,這點讓他不得不感到有些委屈。 130 | 131 | 曉婷失望的回到了辦公室,心裡還是不斷的想著剛剛的事情,這時江組長進來了,曉婷想:「遲早都得讓組長知道這件事情,雖然不知道她會有甚麼反應,但是將事情說清楚總是比較好的,免得一顆心總是懸在哪裡」。 132 | 133 | 「曉婷!星期一督學要來視察,待會記得將要給督學看的資料整理好放到我的辦公桌上」,江組長交代完之後,正轉身準備下班。 134 | 135 | 曉婷遲疑了一下:「組長,等一下!我有事情要與您討論!」。 136 | 137 | 「喔!有甚麼事嗎?」江組長問道。 138 | 139 | 「組長,我懷孕了,所以我去問了人事主任與會計主任,看看產假的事情該如何處理,會計主任說我請產假時可以找代理人,但是必須自行支付代理人費用」,曉婷將懷孕的事情清楚的向組長報告。 140 | 141 | 「我想,我可以自行支付代理人的費用,也會盡量縮短產假的時間,這樣不曉得可不可以?」,曉婷忐忑不安的問著。 142 | 143 | 「這樣啊!我想對於孕婦而言,產假是非常重要的,如果縮短產假的時間,對你的身體將會有不好的影響,所以我想你明年還是在家好好的待產,不要為了工作而弄壞了身體,產婦的身體保養可以非常重要的,千萬別輕忽啊!」,突然間,江組長的語調變得相當柔和。 144 | 145 | 江組長轉身就要離開,卻又轉了回來說:「對了,我們明年會找人接替你的職務,你就放心的好好去生產吧!」。 146 | 147 | 「喔!對了,記得將資料整理好放到我的辦公桌上,星期一督學要來!」,江組長又補上一句。 148 | 149 | 曉婷失望的癱坐在椅子上,半响說不出話來。 150 | 151 | 曉婷好不容易整理好資料,回到家已經是晚上十點鐘,還好隔天是星期六,不需要上班。 152 | 153 | 曉婷失落的走進家裡,還沒說話,以翔就已經猜到答案了。 154 | 155 | 以翔伸出手將曉婷摟在懷裡,輕聲的說:「沒關係,沒有產假的話,我們再想想辦法就好了」。 156 | 157 | 「以翔,我想 ….,我們還是以後再生吧!反正我們都還年輕,也不用這麼急著生小孩,好嗎!」,曉婷刻意避免講出「墮胎」兩個字,因為這兩個字太殘忍,她怕以翔會受不了。 158 | 159 | 「其實,我也很害怕生小孩,聽說那會很痛。所以我想,你明天陪我去看一下婦產科,好嗎?」,曉婷勉強的擠出了一點笑容說道。 160 | 161 | 以翔沒有回答,但是雙手卻緊緊的抱住了曉婷,好像在回答說:「我好愛你!」 162 | 163 | 這一晚,她們兩人其實都沒有睡著,但是為了讓對方安心,卻又都假裝睡著了,曉婷躺在以翔的懷裡,靜靜的,靜靜的想著。 164 | 165 | 就這樣,天色漸漸的從滿天星斗的黑夜、慢慢的轉變、轉變,直到遠處地平線上開始浮現一點點的白色光暈。 166 | 167 | 曉婷轉身抱住了以翔,說到:「親愛的,不用擔心,我們都還很年經,不是嗎?」。 168 | 169 | 以翔不知道該說些甚麼,只好用雙手緊緊抱著曉婷。 170 | 171 | 好不容易終於等到 8:00,曉婷說:「走吧,我們該去醫院了」。 172 | 173 | 兩人走到停車場,曉婷看著以翔的神情,總覺得以翔整個人有點恍神的感覺,於是給了以翔一個吻,然後幫他戴好了安全帽,載著他往婦產科的方向前進。 174 | 175 | 一路上,以翔彷彿像個遊魂似的,曉婷好幾次都無法確定以翔是否坐在她的後面,因此不時的將以翔的手拉過來攬住自己的腰,深怕以翔會從機車上掉下去。 176 | 177 | 到了婦產科,曉婷主動拉起以翔的手,牽著他進入婦產科,然後讓以翔坐到等候區中,自己則悄悄的走到掛號室,輕聲的對著護士說:「我想…把孩子拿掉!」。 178 | 179 | 由於曉婷的聲音實在太小了,護士實在聽不清楚,於是護士反問說:「你要做墮胎手術是嗎?」。 180 | 181 | 「墮胎」這兩個字一出,讓診所裡的病人全都望向曉婷,但是曉婷並沒有注意到,因為他原本就很擔心以翔會聽到這種字眼,於是緊張的轉頭看看以翔。 182 | 183 | 一聽到這兩個字,以翔全身的神經都開始高度緊張起來,他開始意識到自己正在謀殺一個嬰兒,而且就是他與曉婷的寶寶。 184 | 185 | 在那瞬間,以翔彷彿聽到孩子的哭喊聲,而且聲音越來越近,越來越淒厲:「爸爸!媽媽!你們為甚麼要殺死我,我想要好好活著,讓我活著,我要活著,我不想死」。 186 | 187 | 以翔再也無法控制自己的情緒了,他不想讓大家看到他流淚的樣子,更無法面對曉婷肚子裡的寶寶,於是頭也不回的跑出了診所。 188 | 189 | 曉婷眼看著以翔跑出去,很擔心以翔會發生甚麼事情,也跟著追了出去,留下一臉錯愕的護士小姐,她還以為自己說錯了甚麼話呢? 190 | 191 | 曉婷出了診所,看見以翔一個人蹲坐在馬路對面的公園內。曉婷緩緩的走了過去,走到了以翔的身邊,靜靜的在以翔身邊站著,就這麼站著,她真的不知道該怎麼安慰以翔,所以只好從後面緊緊抱住他,就這樣緊緊的抱住。 192 | 193 | 不知道經過了多久,以翔終於轉過身來,淚流滿面的望著自己,曉婷也忍不住哭了起來。在那一瞬間,兩人緊緊的、緊緊的抱在一起。 194 | 195 | 過了許久,兩人似乎心意已經相通了,曉婷抬起頭來望著以翔,以翔的臉上終於出現了一絲絲的笑容,雖然是苦笑,但曉婷在以翔的眼中看到了一種難以阻擋的自信,似乎在告訴著她:「你不用擔心,我會好好照顧妳和孩子的」。 196 | 197 | … 198 | … 199 | … 200 | 201 | 八個月後 202 | 203 | … 204 | … 205 | … 206 | 207 | 陽光再度從小小的窗戶中溫暖的照了進來,小小的套房當中,曉婷抱著剛出生不久的小 Baby,一旁的以翔正手忙腳亂的煮著一鍋腰子湯,曉婷看著以翔的樣子,不禁笑了起來。看到曉婷笑了,以翔也開心的笑了起來。 208 | 209 | 曉婷輕聲的對以翔說:「老公,你先來幫我解開一下哺乳衣的釦子,我要餵 Baby 吃 ㄋㄟ ㄋㄟ 了」。奇怪的是,那個小傢伙似乎自己用手,解開了曉婷身上的釦子,自顧自的吸了起來,當以翔忙完趕過來時,小傢伙早已經吃飽了,正趴在媽媽的ㄋㄟ ㄋㄟ上,心滿意足的一邊睡覺,一邊享受日光浴呢? -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | var http = require("http"); 2 | var https = require("https"); 3 | var fs = require("mz/fs"); 4 | var co = require("co"); 5 | var koa = require("koa"); 6 | var serve = require("koa-static"); 7 | var route = require("koa-route"); 8 | var cobody = require("co-body"); 9 | var path = require("path"); 10 | var session = require("koa-session"); 11 | var app = koa(); 12 | var io = require("./lib/io"); 13 | var M = require("./lib/model"); 14 | var V = require("./lib/view"); 15 | // var MT = require("./lib/mt"); 16 | 17 | /* 18 | var mt = function(self, msg) { 19 | console.log("this.session=%j", self.session); 20 | return MT.mt(msg, self.session.locale); 21 | } 22 | */ 23 | 24 | var response=function(self, code, msg) { 25 | // console.log("this.session=%j", self.session); 26 | // var msgMt = mt(self, msg); 27 | var msgMt = msg; 28 | var res = self.response; 29 | res.status = code; 30 | res.set({"Content-Length":""+msgMt.length,"Content-Type":"text/plain"}); 31 | res.body = msgMt; 32 | // console.log("response:msg=%s", msgMt.substring(0, 100)); 33 | // console.log("response:msg=%s", msgMt); 34 | // if (code !== 200) console.log("response error : ", code, msgMt); 35 | } 36 | 37 | var isPass = function(self) { 38 | return typeof(self.session.user)!=="undefined"; 39 | } 40 | 41 | var parse = function *(self) { 42 | var json = yield cobody(self); 43 | return JSON.parse(json); 44 | } 45 | /* 46 | var setLocale = function*(locale) { 47 | this.session.locale = locale; 48 | console.log("this.session.locale=%j", this.session.locale); 49 | } 50 | */ 51 | var view = function *(book, file="README.md") { // view(mdFile):convert *.md to html 52 | console.log("view:book=%s file=%s", book, file); 53 | var type = path.extname(file); 54 | if ([".md", ".json", ".mdo", ".html"].indexOf(type)>=0) { 55 | var bookObj, fileObj, isError=false; 56 | try { 57 | bookObj = yield M.getBook(book); 58 | } catch (error) { 59 | isError = true; 60 | bookObj = { book:book }; 61 | fileObj = { book:book, file:file, text:"# Error\nBook not found.\nYou may [Create New Book](/view/system/createBook.html) ?" }; 62 | } 63 | if (!isError) { 64 | try { 65 | fileObj = yield M.getBookFile(book, file); 66 | } catch (error) { 67 | fileObj = { book:book, file:file, text:"# Error\nFile not found.\nYou may edit and save to create a new file !" }; 68 | } 69 | } 70 | var page = V.viewRender(bookObj, fileObj, M.setting.useLocal, this.session.user); 71 | this.body = page; 72 | } else { 73 | this.type = path.extname(this.path); 74 | this.body = fs.createReadStream(M.getFilePath(book, file)); 75 | } 76 | } 77 | 78 | var save = function *(book, file) { // save markdown file. 79 | if (!isPass(this)) { 80 | response(this, 401, "Please login to save!"); 81 | return; 82 | } 83 | var bookObj = yield M.getBook(book); 84 | if (bookObj.editor !== this.session.user) { 85 | response(this, 403, "Save fail: You are not editor of the book !"); 86 | return; 87 | } 88 | try { 89 | var post = yield parse(this); 90 | // console.log("save:%s/%s\npost=%j", book, file, post.text); 91 | yield M.saveBookFile(book, file, post.text); 92 | response(this, 200, "Save Success!"); 93 | } catch (e) { 94 | response(this, 403, "Save Fail!"); // 403: Forbidden 95 | } 96 | } 97 | 98 | var signup = function *() { 99 | if (!M.setting.signup) { 100 | response(this, 403, "Error: Signup=false in Setting.mdo !"); 101 | return; 102 | } 103 | var post = yield parse(this); 104 | var user = post.user, password = post.password; 105 | console.log("post=%j", post); 106 | var isSuccess = yield M.addUser(user, password); 107 | if (isSuccess) { 108 | response(this, 200, "Signup success!"); 109 | } else { 110 | response(this, 403, "Signup Fail: User name already taken by some others!"); 111 | } 112 | } 113 | 114 | var search = function *() { 115 | try { 116 | console.log("this.query = %j", this.query); 117 | var key = this.query.key||"", q = JSON.parse(this.query.q || "{\"type\":\"md\"}"); 118 | console.log("key=%j q=%j", key, q); 119 | var results = yield M.search(key, q); 120 | response(this, 200, JSON.stringify(results)); 121 | } catch (e) { 122 | response(this, 403, e.stack); 123 | } 124 | } 125 | 126 | var userList = function *() { 127 | var lines = ["
    "]; 128 | for (var user in M.users) { 129 | lines.push("
  1. "+user+"
  2. "); 130 | } 131 | lines.push("
"); 132 | response(this, 200, lines.join("\n")); 133 | } 134 | 135 | var login = function *() { 136 | var post = yield parse(this); 137 | console.log("login:user=%s", post.user); 138 | var user = M.users[post.user]; 139 | console.log("this.session=%j", this.session); 140 | if (user.password === post.password) { 141 | response(this, 200, "Login Success!"); 142 | this.session.user = post.user; 143 | } 144 | else 145 | response(this, 403, "Login Fail!"); // 403: Forbidden 146 | console.log("this.session=%j", this.session); 147 | } 148 | 149 | var logout =function *() { 150 | delete this.session.user; 151 | response(this, 200, "Logout Success!"); 152 | } 153 | 154 | var createBook = function*(book) { 155 | if (!isPass(this)) { 156 | response(this, 401, "Please login at first !"); 157 | } else { 158 | try { 159 | yield M.createBook(book, this.session.user); 160 | response(this, 200, "Create Book Success!"); 161 | } catch (err) { 162 | response(this, 403, "Fail: Book already exist!"); 163 | } 164 | } 165 | } 166 | 167 | app.keys = ["#*$*#$)_)*&&^^"]; 168 | 169 | var CONFIG = { 170 | key: "koa:sess", // (string) cookie key (default is koa:sess) 171 | maxAge: 86400000, // (number) maxAge in ms (default is 1 days) 172 | overwrite: true, // (boolean) can overwrite or not (default true) 173 | httpOnly: true, // (boolean) httpOnly or not (default true) 174 | signed: true, // (boolean) signed or not (default true) 175 | }; 176 | 177 | app.use(session(CONFIG, app));; 178 | app.use(serve("web")); 179 | app.use(serve("user")); 180 | 181 | app.use(route.get("/", function*() { this.redirect(M.setting.home) })); 182 | app.use(route.get("/view/:book/:file?", view)); 183 | // app.use(route.get("/locale/:locale", setLocale)); 184 | app.use(route.post("/save/:book/:file", save)); 185 | app.use(route.post("/signup", signup)); 186 | app.use(route.get("/createbook/:book", createBook)); 187 | app.use(route.post("/createbook/:book", createBook)); 188 | app.use(route.post("/login", login)); 189 | app.use(route.post("/logout", logout)); 190 | app.use(route.get("/search", search)); 191 | app.use(route.get("/profile", function*() { 192 | if (typeof this.session.user !== 'undefined') 193 | this.redirect("/view/"+this.session.user+"/"); 194 | else 195 | this.redirect("/view/system/error.html"); 196 | })); 197 | app.use(route.get("/userlist", userList)); 198 | 199 | co(function*() { 200 | yield M.init(__dirname); 201 | V.init(__dirname); 202 | // MT.init(); 203 | var port = M.setting.port || 80; 204 | http.createServer(app.callback()).listen(port); 205 | // https version : in self signed certification 206 | // You can save & modify in SSL mode, no edit allowed in HTTP mode. 207 | var sslPort = M.setting.portSsl || 443; 208 | var keyPem = yield io.readFile("setting/key.pem"); 209 | var certPem = yield io.readFile("setting/cert.pem"); 210 | var csrPem = yield io.readFile("setting/csr.pem"); 211 | https.createServer({ 212 | key: keyPem, 213 | cert: certPem, 214 | // The folowing is for self signed certification. 215 | requestCert: true, 216 | ca: [ csrPem ] 217 | }, app.callback()).listen(sslPort); 218 | console.log("http server started: http://localhost:"+port); 219 | console.log("https server started: http://localhost:"+sslPort); 220 | }); 221 | -------------------------------------------------------------------------------- /web/main.css: -------------------------------------------------------------------------------- 1 | .header .pure-menu-item { 2 | // font-family:標楷體; 3 | font-weight:bold; 4 | } 5 | 6 | .header .pure-menu-item a { 7 | color:#bbbbbb; 8 | background-color:#191818; 9 | } 10 | 11 | .header .pure-menu-link { 12 | color:#bbbbbb; 13 | background-color:#191818; 14 | } 15 | 16 | .header .pure-menu-item a:hover { 17 | background-color:#333; 18 | } 19 | 20 | body { 21 | color: #777; 22 | overflow-y:scroll; 23 | } 24 | 25 | code { 26 | font-family:MingLiU, monospace; 27 | } 28 | 29 | pre { 30 | border: 1px dotted #686868; 31 | padding: 0px; 32 | } 33 | 34 | blockquote { 35 | padding: 10px; 36 | border: 3px double #373737; 37 | color:#333333; 38 | } 39 | 40 | a { 41 | color:#336699; 42 | text-decoration:none; 43 | } 44 | 45 | textarea { 46 | width:100%; 47 | height:80vh; // 80vh : 80% view port hieght 48 | margin:10px; 49 | font-family:MingLiU, monospace; // MingLiU 細明體; Monospace; http://eeepage.info/css-font-family/ 50 | // font-weight:bold; 51 | padding:10px; 52 | -webkit-box-sizing: border-box; 53 | -moz-box-sizing: border-box; 54 | box-sizing: border-box; 55 | } 56 | 57 | 58 | h1, h1 a { font-size: xx-large; color:#050505; text-align:center; margin:30px; font-weight: bold; font-family: 'DFKai-sb', 'Tahoma'; } 59 | 60 | h2, h2 a { font-size: x-large; color:#8B008B; margin-top:30px; margin-bottom:30px; font-weight: bold; font-family: 'DFKai-sb', 'Tahoma'; } 61 | 62 | h3, h3 a { font-size: large; color:#000080; font-weight: bold; font-family: 'DFKai-sb', 'Tahoma'; } 63 | 64 | h4, h4 a { font-size: medium; color:#4B0082; font-weight: bold; font-family: 'DFKai-sb', 'Tahoma'; } 65 | 66 | h5, h5 a { font-size: small ; color:#708090; font-weight: bold; font-family: 'DFKai-sb', 'Tahoma'; } 67 | 68 | h6, h6 a { font-size: x-small; color:#000080; } 69 | 70 | p { 71 | font-family: 'Pmingliu', 'Tahoma'; 72 | margin: 15px 0px 15px 0px; 73 | font-size:100%; 74 | color:#555555; 75 | line-height:180%; 76 | } 77 | 78 | table, th, td, p { 79 | line-height:180% 80 | } 81 | 82 | table { 83 | border-collapse: collapse; 84 | border-spacing: 0; 85 | border: 1px solid #686868; 86 | margin-bottom: 20px; 87 | text-align: left; 88 | margin-left:auto; 89 | margin-right:auto; 90 | // min-width: 50%; 91 | } 92 | 93 | th { 94 | padding: 10px; 95 | background-color:black; 96 | color:white; 97 | } 98 | 99 | td { 100 | padding: 10px 15px 10px 15px; 101 | vertical-align: middle; 102 | border: 1px solid #a0a0a0; 103 | } 104 | 105 | /* from : http://purecss.io/layouts/side-menu/ */ 106 | 107 | body { 108 | color: #777; 109 | } 110 | 111 | .pure-img-responsive { 112 | max-width: 100%; 113 | height: auto; 114 | } 115 | 116 | /* 117 | Add transition to containers so they can push in and out. 118 | */ 119 | #layout, 120 | #menu, 121 | .menu-link { 122 | -webkit-transition: all 0.2s ease-out; 123 | -moz-transition: all 0.2s ease-out; 124 | -ms-transition: all 0.2s ease-out; 125 | -o-transition: all 0.2s ease-out; 126 | transition: all 0.2s ease-out; 127 | } 128 | 129 | /* 130 | This is the parent `
` that contains the menu and the content area. 131 | */ 132 | #layout { 133 | position: relative; 134 | padding-left: 0; 135 | } 136 | #layout.active #menu { 137 | left: 150px; 138 | width: 150px; 139 | } 140 | 141 | #layout.active .menu-link { 142 | left: 150px; 143 | } 144 | /* 145 | The content `
` is where all your content goes. 146 | */ 147 | .content { 148 | margin: 0 auto; 149 | padding: 0 2em; 150 | max-width: 800px; 151 | margin-top: 30px; 152 | margin-bottom: 50px; 153 | line-height: 1.6em; 154 | } 155 | 156 | .header { 157 | margin: 0; 158 | color: #333; 159 | text-align: right; 160 | // padding: 1em 1em 0; 161 | border-bottom: 1px solid #eee; 162 | // font-size:1.2em; 163 | // vertical-align:top; 164 | background-color:#191818; 165 | height:2.7em; 166 | } 167 | /* 168 | .header a { 169 | color:#8888ff; 170 | text-decoration:none; 171 | padding: 0.2em; 172 | border: 1px solid #a0a0a0; 173 | background-color:#eeeeee; 174 | } 175 | */ 176 | .header h1 { 177 | margin: 0.2em 0; 178 | font-size: 3em; 179 | font-weight: 300; 180 | } 181 | .header h2 { 182 | font-weight: 300; 183 | color: #ccc; 184 | padding: 0; 185 | margin-top: 0; 186 | } 187 | 188 | .content-subhead { 189 | margin: 50px 0 20px 0; 190 | font-weight: 300; 191 | color: #888; 192 | } 193 | 194 | 195 | 196 | /* 197 | The `#menu` `
` is the parent `
` that contains the `.pure-menu` that 198 | appears on the left side of the page. 199 | */ 200 | 201 | #menu { 202 | margin-left: -150px; /* "#menu" width */ 203 | width: 150px; 204 | position: fixed; 205 | top: 0; 206 | left: 0; 207 | bottom: 0; 208 | z-index: 1000; /* so the menu or its navicon stays above all content */ 209 | background: #191818; 210 | overflow-y: auto; 211 | -webkit-overflow-scrolling: touch; 212 | } 213 | /* 214 | All anchors inside the menu should be styled like this. 215 | */ 216 | #menu a { 217 | color: #999; 218 | border: none; 219 | padding: 0.6em 0 0.6em 0.6em; 220 | } 221 | 222 | /* 223 | Remove all background/borders, since we are applying them to #menu. 224 | */ 225 | #menu .pure-menu, 226 | #menu .pure-menu ul { 227 | border: none; 228 | background: transparent; 229 | } 230 | 231 | /* 232 | Add that light border to separate items into groups. 233 | */ 234 | #menu .pure-menu ul, 235 | #menu .pure-menu .menu-item-divided { 236 | border-top: 1px solid #333; 237 | } 238 | /* 239 | Change color of the anchor links on hover/focus. 240 | */ 241 | #menu .pure-menu li a:hover, 242 | #menu .pure-menu li a:focus { 243 | background: #333; 244 | } 245 | 246 | /* 247 | This styles the selected menu item `
  • `. 248 | */ 249 | #menu .pure-menu-selected, 250 | #menu .pure-menu-heading { 251 | background: #336699; // #191818 252 | } 253 | /* 254 | This styles a link within a selected menu item `
  • `. 255 | */ 256 | #menu .pure-menu-selected a { 257 | color: #fff; 258 | } 259 | 260 | /* 261 | This styles the menu heading. 262 | */ 263 | #menu .pure-menu-heading { 264 | font-size: 110%; 265 | color: #fff; 266 | margin: 0; 267 | } 268 | 269 | /* -- Dynamic Button For Responsive Menu -------------------------------------*/ 270 | 271 | /* 272 | The button to open/close the Menu is custom-made and not part of Pure. Here's 273 | how it works: 274 | */ 275 | 276 | /* 277 | `.menu-link` represents the responsive menu toggle that shows/hides on 278 | small screens. 279 | */ 280 | .menu-link { 281 | position: fixed; 282 | display: block; /* show this only on small screens */ 283 | top: 0; 284 | left: 0; /* "#menu width" */ 285 | background: #000; 286 | background: rgba(0,0,0,0.7); 287 | font-size: 10px; /* change this value to increase/decrease button size */ 288 | z-index: 10; 289 | width: 2em; 290 | height: auto; 291 | padding: 2.1em 1.6em; 292 | } 293 | 294 | .menu-link:hover, 295 | .menu-link:focus { 296 | background: #000; 297 | } 298 | 299 | .menu-link span { 300 | position: relative; 301 | display: block; 302 | } 303 | 304 | .menu-link span, 305 | .menu-link span:before, 306 | .menu-link span:after { 307 | background-color: #fff; 308 | width: 100%; 309 | height: 0.2em; 310 | } 311 | 312 | .menu-link span:before, 313 | .menu-link span:after { 314 | position: absolute; 315 | margin-top: -0.6em; 316 | content: " "; 317 | } 318 | 319 | .menu-link span:after { 320 | margin-top: 0.6em; 321 | } 322 | 323 | 324 | /* -- Responsive Styles (Media Queries) ------------------------------------- */ 325 | 326 | /* 327 | Hides the menu at `48em`, but modify this based on your app's needs. 328 | */ 329 | @media (min-width: 48em) { 330 | 331 | .header, 332 | .content { 333 | padding-left: 2em; 334 | padding-right: 2em; 335 | } 336 | 337 | #layout { 338 | padding-left: 150px; /* left col width "#menu" */ 339 | left: 0; 340 | } 341 | #menu { 342 | left: 150px; 343 | } 344 | 345 | .menu-link { 346 | position: fixed; 347 | left: 150px; 348 | display: none; 349 | } 350 | 351 | #layout.active .menu-link { 352 | left: 150px; 353 | } 354 | } 355 | 356 | @media (max-width: 48em) { 357 | /* Only apply this when the window is small. Otherwise, the following 358 | case results in extra padding on the left: 359 | * Make the window small. 360 | * Tap the menu to trigger the active state. 361 | * Make the window large again. 362 | */ 363 | #layout.active { 364 | position: relative; 365 | left: 150px; 366 | } 367 | } 368 | 369 | -------------------------------------------------------------------------------- /web/bookdown.js: -------------------------------------------------------------------------------- 1 | var searchQuery, viewBox, editBox, textBox, searchBox, localeNode; 2 | var formEdit, converter, book, file, searchTemplate; 3 | var katexLoaded = false; 4 | var dictionary = {} 5 | 6 | function load(pBook, pFile) { 7 | book = pBook; 8 | file = pFile; 9 | viewBox = document.getElementById("viewBox"); 10 | editBox = document.getElementById("editBox"); 11 | textBox = document.getElementById("editText"); 12 | formEdit= document.getElementById("formEdit"); 13 | searchBox = document.getElementById("searchBox"); 14 | searchQuery = document.getElementById("searchQuery"); 15 | localeNode = document.getElementById("locale"); 16 | if (defaultLocale === '') 17 | defaultLocale = "Global"; 18 | window.onhashchange(); 19 | // converter = new showdown.Converter(); 20 | // converter.setOption('tables', true); 21 | converter = window.markdownit(); // markdown-it 22 | searchQuery.addEventListener("keyup", function(event) { 23 | event.preventDefault(); 24 | if (event.keyCode == 13) { 25 | var key = searchQuery.value; 26 | window.location.hash = '#'+key; 27 | showBox(searchBox); 28 | } 29 | }); 30 | addToDictionary('tw', tw); 31 | loadScript('/chinese.js', function() { 32 | pageToLocale(); 33 | }); 34 | } 35 | 36 | window.onhashchange = function() { 37 | if (window.location.hash.trim() === '') 38 | showBox(viewBox); 39 | else 40 | search(window.location.hash.substring(1)); 41 | } 42 | 43 | window.onpopstate = function(event) {} 44 | 45 | function showBox(box) { 46 | searchBox.style.display = 'none'; 47 | viewBox.style.display = 'none'; 48 | editBox.style.display = 'none'; 49 | box.style.display = 'block'; 50 | } 51 | 52 | function ajaxGet(path, getResponse) { 53 | var r = new XMLHttpRequest(); 54 | r.open("GET", path, true); 55 | r.onreadystatechange = function () { 56 | if (r.readyState != 4) return; 57 | getResponse(r.status, r.responseText); 58 | }; 59 | r.send(null); 60 | } 61 | 62 | function ajaxPost(path, obj, callback) { 63 | var r = new XMLHttpRequest(); 64 | r.open("POST", path, true); 65 | r.onreadystatechange = function () { 66 | if (r.readyState != 4) return; 67 | alert(mt(r.responseText)); 68 | if (typeof callback !== 'undefined') callback(r); 69 | }; 70 | r.send(JSON.stringify(obj)); 71 | } 72 | 73 | var scriptLoaded = {} 74 | 75 | function loadScript(url, onload) { 76 | var urlLoaded = scriptLoaded[url]; 77 | if (typeof urlLoaded !== 'undefined') { 78 | if (typeof onload !== 'undefined') onload(); 79 | return; 80 | } 81 | var script = document.createElement('script'); 82 | script.onload = onload; 83 | script.src = url; 84 | document.getElementsByTagName('head')[0].appendChild(script); 85 | scriptLoaded[url] = true; 86 | } 87 | 88 | function texApply(text) { 89 | return text.replace(/(```\w*\n([\s\S]*?)\n```)|(`[^`\n]*`)|(\$\$\s*\n\s*([^$]+)\s*\n\s*\$\$)|(\$\$([^$\n]+)\$\$)/gmi, function(match, p1, p2, p3, p4, p5, p6, p7, offset, str) { 90 | try { 91 | if (typeof p1 !== 'undefined') { 92 | return match; 93 | } else if (typeof p3 !== 'undefined') { 94 | return match; 95 | } else if (typeof p4 !== 'undefined') { 96 | return katex.renderToString(p5, { displayMode: true }); 97 | } else if (typeof p6 !== 'undefined') { 98 | return katex.renderToString(p7); 99 | } 100 | } catch (err) {} 101 | }); 102 | } 103 | 104 | function texRender(text, callback) { 105 | if (text.indexOf("$$")>=0) { 106 | loadScript(katexJsUrl, function() { 107 | text = texApply(text); 108 | callback(text); 109 | }); 110 | } else { 111 | callback(text); 112 | } 113 | } 114 | 115 | function map(s, s2t) { 116 | var t = s2t[s]; 117 | return (typeof t === 'undefined')?s:t; 118 | } 119 | 120 | function locale() { 121 | return (localStorage.locale || defaultLocale); 122 | } 123 | 124 | function localeChinese() { 125 | return ["tw", "cn"].indexOf(locale())>=0; 126 | } 127 | 128 | function chineseMt(text) { 129 | var toText = []; 130 | var s2t = (locale() === 'tw')?cn2tw 131 | :(locale() === 'cn')?tw2cn:{}; 132 | for (var i=0; i= 2) { 150 | if (localeChinese()) { 151 | md = mdParts[1]; 152 | } else 153 | md = mdParts[0]; 154 | } 155 | if (localeChinese()) 156 | md = chineseMt(md); 157 | } 158 | // return converter.makeHtml(md); // showdown.js 159 | return converter.render(md); // markdown-it 160 | } 161 | } 162 | 163 | function codeHighlight() { 164 | var codes = document.querySelectorAll('pre code'); 165 | if (codes.length > 0) { 166 | loadScript(highlightJsUrl, function() { 167 | for (var i=0; i'+results[i].path+''); 232 | var robj = results[i].text || results[i].json; 233 | var text = JSON.stringify(robj); 234 | lines.push("

    "+text.replace(/\n/gi, '')+"

    "); 235 | } 236 | searchBox.innerHTML = searchHtml = lines.join("\n"); 237 | showBox(searchBox); 238 | }); 239 | } 240 | 241 | function logout() { 242 | ajaxPost("/logout", {}, function(r) { 243 | location.reload(); 244 | }); 245 | } 246 | 247 | // ====================== MT ==================================== 248 | var tw = { 249 | "menu":"選單", 250 | "edit":"編輯", 251 | "view":"檢視", 252 | "save":"存檔", 253 | "signup":"註冊", 254 | "login":"登入", 255 | "logout":"登出", 256 | "home":"首頁", 257 | "book":"書籍", 258 | "search":"搜尋", 259 | "user":"使用者", 260 | "locale":"語言", 261 | "NewBook":"寫書", 262 | "users":"使用者", 263 | "books":"書籍", 264 | "Contents":"內容", 265 | "GoBack":"回前頁", 266 | "User":"使用者", 267 | "Author":"作者", 268 | "Password":"密碼", 269 | "Profile":"私人", 270 | "System":"系統", 271 | "Global":"全球", 272 | "Error: Signup=false in Setting.mdo !":"錯誤:設定檔的 signup=false !", 273 | "Please login to save!":"請先登入後才能存檔!", 274 | "Save fail: You are not editor of the book !":"存檔失敗:你不是本書的編輯!", 275 | "Save Success!":"存檔成功", 276 | "Save Fail!":"存檔失敗", 277 | "Signup success!":"註冊成功", 278 | "Signup Fail: User name already taken by some others!":"註冊失敗:該名稱已被佔用!", 279 | "Login Success!":"登入成功!", 280 | "Login Fail!":"登入失敗!", 281 | "Logout Success!":"登出成功!", 282 | "Please login at first !":"請先登入!", 283 | "Create Book Success!":"創建書籍成功!", 284 | "Fail: Book already exist!":"登入失敗!", 285 | } 286 | 287 | function addToDictionary(locale, dic) { 288 | var d = dictionary[locale] || {} 289 | for (var e in dic) { 290 | d[e.toLowerCase()] = dic[e]; 291 | } 292 | dictionary[locale] = d; 293 | } 294 | 295 | function pageToLocale(locale) { 296 | if (typeof locale !== 'undefined') 297 | localStorage.locale = locale; 298 | render(); 299 | } 300 | 301 | function menuToLocale() { 302 | var nodes = document.getElementsByClassName("mt"); 303 | for (var i = 0; i < nodes.length; i++) { 304 | var node = nodes[i]; 305 | var e = node.getAttribute('data-mt'); 306 | var eMt = mt(e); 307 | node.innerHTML = eMt; 308 | } 309 | } 310 | 311 | function mt(msg) { 312 | var d = (localeChinese())?dictionary["tw"]:{}; 313 | var toMsg = d[msg.toLowerCase()]; 314 | msg = (typeof toMsg === 'undefined')?msg:toMsg; 315 | if (msg.indexOf("=")>=0) { 316 | var tokens = msg.split("="); 317 | msg = (localeChinese())?tokens[1]:tokens[0]; 318 | } 319 | return (localeChinese())?chineseMt(msg):msg; 320 | } 321 | 322 | /* 323 | 324 | function mt(msg) { 325 | var d = (localeChinese())?dictionary["tw"]:undefined; 326 | if (typeof d !== 'undefined') { 327 | var toMsg = d[msg.toLowerCase()]; 328 | msg = (typeof toMsg === 'undefined')?msg:toMsg; 329 | } 330 | if (msg.indexOf("=")>=0) { 331 | var tokens = msg.split("="); 332 | msg = (localeChinese())?tokens[1]:tokens[0]; 333 | } 334 | return (localeChinese())?chineseMt(msg):msg; 335 | } 336 | 337 | */ -------------------------------------------------------------------------------- /install: -------------------------------------------------------------------------------- 1 | #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby 2 | # This script installs to /usr/local only. To install elsewhere you can just 3 | # untar https://github.com/Homebrew/brew/tarball/master anywhere you like or 4 | # change the value of HOMEBREW_PREFIX. 5 | HOMEBREW_PREFIX = "/usr/local".freeze 6 | HOMEBREW_REPOSITORY = "/usr/local/Homebrew".freeze 7 | HOMEBREW_CACHE = "#{ENV["HOME"]}/Library/Caches/Homebrew".freeze 8 | HOMEBREW_OLD_CACHE = "/Library/Caches/Homebrew".freeze 9 | BREW_REPO = "https://github.com/Homebrew/brew".freeze 10 | CORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze 11 | 12 | # no analytics during installation 13 | ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" 14 | ENV["HOMEBREW_NO_ANALYTICS_MESSAGE_OUTPUT"] = "1" 15 | 16 | module Tty 17 | module_function 18 | 19 | def blue 20 | bold 34 21 | end 22 | 23 | def red 24 | bold 31 25 | end 26 | 27 | def reset 28 | escape 0 29 | end 30 | 31 | def bold(n = 39) 32 | escape "1;#{n}" 33 | end 34 | 35 | def underline 36 | escape "4;39" 37 | end 38 | 39 | def escape(n) 40 | "\033[#{n}m" if STDOUT.tty? 41 | end 42 | end 43 | 44 | class Array 45 | def shell_s 46 | cp = dup 47 | first = cp.shift 48 | cp.map { |arg| arg.gsub " ", "\\ " }.unshift(first).join(" ") 49 | end 50 | end 51 | 52 | def ohai(*args) 53 | puts "#{Tty.blue}==>#{Tty.bold} #{args.shell_s}#{Tty.reset}" 54 | end 55 | 56 | def warn(warning) 57 | puts "#{Tty.red}Warning#{Tty.reset}: #{warning.chomp}" 58 | end 59 | 60 | def system(*args) 61 | abort "Failed during: #{args.shell_s}" unless Kernel.system(*args) 62 | end 63 | 64 | def sudo(*args) 65 | args.unshift("-A") unless ENV["SUDO_ASKPASS"].nil? 66 | ohai "/usr/bin/sudo", *args 67 | system "/usr/bin/sudo", *args 68 | end 69 | 70 | def getc # NOTE only tested on OS X 71 | system "/bin/stty raw -echo" 72 | if STDIN.respond_to?(:getbyte) 73 | STDIN.getbyte 74 | else 75 | STDIN.getc 76 | end 77 | ensure 78 | system "/bin/stty -raw echo" 79 | end 80 | 81 | def wait_for_user 82 | puts 83 | puts "Press RETURN to continue or any other key to abort" 84 | c = getc 85 | # we test for \r and \n because some stuff does \r instead 86 | abort unless (c == 13) || (c == 10) 87 | end 88 | 89 | class Version 90 | include Comparable 91 | attr_reader :parts 92 | 93 | def initialize(str) 94 | @parts = str.split(".").map(&:to_i) 95 | end 96 | 97 | def <=>(other) 98 | parts <=> self.class.new(other).parts 99 | end 100 | end 101 | 102 | def force_curl? 103 | ARGV.include?("--force-curl") 104 | end 105 | 106 | def macos_version 107 | @macos_version ||= Version.new(`/usr/bin/sw_vers -productVersion`.chomp[/10\.\d+/]) 108 | end 109 | 110 | def should_install_command_line_tools? 111 | return false if force_curl? 112 | return false if macos_version < "10.9" 113 | developer_dir = `/usr/bin/xcode-select -print-path 2>/dev/null`.chomp 114 | developer_dir.empty? || !File.exist?("#{developer_dir}/usr/bin/git") 115 | end 116 | 117 | def git 118 | return false if force_curl? 119 | 120 | @git ||= if ENV["GIT"] && File.executable?(ENV["GIT"]) 121 | ENV["GIT"] 122 | elsif Kernel.system "/usr/bin/which -s git" 123 | "git" 124 | else 125 | exe = `xcrun -find git 2>/dev/null`.chomp 126 | exe if $? && $?.success? && !exe.empty? && File.executable?(exe) 127 | end 128 | 129 | return unless @git 130 | # Github only supports HTTPS fetches on 1.7.10 or later: 131 | # https://help.github.com/articles/https-cloning-errors 132 | `#{@git} --version` =~ /git version (\d\.\d+\.\d+)/ 133 | return if $1.nil? 134 | return if Version.new($1) < "1.7.10" 135 | 136 | @git 137 | end 138 | 139 | def user_only_chmod?(d) 140 | return false unless File.directory?(d) 141 | mode = File.stat(d).mode & 0777 142 | # u = (mode >> 6) & 07 143 | # g = (mode >> 3) & 07 144 | # o = (mode >> 0) & 07 145 | mode != 0755 146 | end 147 | 148 | def chmod?(d) 149 | File.exist?(d) && !(File.readable?(d) && File.writable?(d) && File.executable?(d)) 150 | end 151 | 152 | def chown?(d) 153 | !File.owned?(d) 154 | end 155 | 156 | def chgrp?(d) 157 | !File.grpowned?(d) 158 | end 159 | 160 | # Invalidate sudo timestamp before exiting (if it wasn't active before). 161 | Kernel.system "/usr/bin/sudo -n -v 2>/dev/null" 162 | at_exit { Kernel.system "/usr/bin/sudo", "-k" } unless $?.success? 163 | 164 | # The block form of Dir.chdir fails later if Dir.CWD doesn't exist which I 165 | # guess is fair enough. Also sudo prints a warning message for no good reason 166 | Dir.chdir "/usr" 167 | 168 | ####################################################################### script 169 | abort "See Linuxbrew: http://linuxbrew.sh/" if RUBY_PLATFORM.to_s.downcase.include?("linux") 170 | abort "MacOS too old, see: https://github.com/mistydemeo/tigerbrew" if macos_version < "10.6" 171 | abort "Don't run this as root!" if Process.uid.zero? 172 | abort <<-EOABORT unless `dsmemberutil checkmembership -U "#{ENV["USER"]}" -G admin`.include? "user is a member" 173 | This script requires the user #{ENV["USER"]} to be an Administrator. 174 | EOABORT 175 | # Tests will fail if the prefix exists, but we don't have execution 176 | # permissions. Abort in this case. 177 | abort <<-EOABORT if File.directory?(HOMEBREW_PREFIX) && (!File.executable? HOMEBREW_PREFIX) 178 | The Homebrew prefix, #{HOMEBREW_PREFIX}, exists but is not searchable. If this is 179 | not intentional, please restore the default permissions and try running the 180 | installer again: 181 | sudo chmod 775 #{HOMEBREW_PREFIX} 182 | EOABORT 183 | 184 | ohai "This script will install:" 185 | puts "#{HOMEBREW_PREFIX}/bin/brew" 186 | puts "#{HOMEBREW_PREFIX}/share/doc/homebrew" 187 | puts "#{HOMEBREW_PREFIX}/share/man/man1/brew.1" 188 | puts "#{HOMEBREW_PREFIX}/share/zsh/site-functions/_brew" 189 | puts "#{HOMEBREW_PREFIX}/etc/bash_completion.d/brew" 190 | puts HOMEBREW_REPOSITORY.to_s 191 | 192 | group_chmods = %w[ bin bin/brew etc Frameworks include lib sbin share var 193 | etc/bash_completion.d lib/pkgconfig var/log 194 | share/aclocal share/doc share/info share/locale share/man 195 | share/man/man1 share/man/man2 share/man/man3 share/man/man4 196 | share/man/man5 share/man/man6 share/man/man7 share/man/man8]. 197 | map { |d| File.join(HOMEBREW_PREFIX, d) }. 198 | select { |d| chmod?(d) } 199 | # zsh refuses to read from these directories if group writable 200 | zsh_dirs = %w[share/zsh share/zsh/site-functions]. 201 | map { |d| File.join(HOMEBREW_PREFIX, d) } 202 | user_chmods = zsh_dirs.select { |d| user_only_chmod?(d) } 203 | chmods = group_chmods + user_chmods 204 | chowns = chmods.select { |d| chown?(d) } 205 | chgrps = chmods.select { |d| chgrp?(d) } 206 | mkdirs = %w[Cellar Homebrew Frameworks bin etc include lib opt sbin share share/zsh share/zsh/site-functions var]. 207 | map { |d| File.join(HOMEBREW_PREFIX, d) }. 208 | reject { |d| File.directory?(d) } 209 | 210 | unless group_chmods.empty? 211 | ohai "The following existing directories will be made group writable:" 212 | puts(*group_chmods) 213 | end 214 | unless user_chmods.empty? 215 | ohai "The following existing directories will be made writable by user only:" 216 | puts(*user_chmods) 217 | end 218 | unless chowns.empty? 219 | ohai "The following existing directories will have their owner set to #{Tty.underline}#{ENV["USER"]}#{Tty.reset}:" 220 | puts(*chowns) 221 | end 222 | unless chgrps.empty? 223 | ohai "The following existing directories will have their group set to #{Tty.underline}admin#{Tty.reset}:" 224 | puts(*chgrps) 225 | end 226 | unless mkdirs.empty? 227 | ohai "The following new directories will be created:" 228 | puts(*mkdirs) 229 | end 230 | 231 | wait_for_user if STDIN.tty? && !ENV["TRAVIS"] 232 | 233 | if File.directory? HOMEBREW_PREFIX 234 | sudo "/bin/chmod", "u+rwx", *chmods unless chmods.empty? 235 | sudo "/bin/chmod", "g+rwx", *group_chmods unless group_chmods.empty? 236 | sudo "/bin/chmod", "755", *user_chmods unless user_chmods.empty? 237 | sudo "/usr/sbin/chown", ENV["USER"], *chowns unless chowns.empty? 238 | sudo "/usr/bin/chgrp", "admin", *chgrps unless chgrps.empty? 239 | else 240 | sudo "/bin/mkdir", "-p", HOMEBREW_PREFIX 241 | sudo "/usr/sbin/chown", "root:wheel", HOMEBREW_PREFIX 242 | end 243 | 244 | unless mkdirs.empty? 245 | sudo "/bin/mkdir", "-p", *mkdirs 246 | sudo "/bin/chmod", "g+rwx", *mkdirs 247 | sudo "/bin/chmod", "755", *zsh_dirs 248 | sudo "/usr/sbin/chown", ENV["USER"], *mkdirs 249 | sudo "/usr/bin/chgrp", "admin", *mkdirs 250 | end 251 | 252 | [HOMEBREW_CACHE, HOMEBREW_OLD_CACHE].each do |cache| 253 | sudo "/bin/mkdir", "-p", cache unless File.directory? cache 254 | sudo "/bin/chmod", "g+rwx", cache if chmod? cache 255 | sudo "/usr/sbin/chown", ENV["USER"], cache if chown? cache 256 | sudo "/usr/bin/chgrp", "admin", cache if chgrp? cache 257 | end 258 | 259 | if should_install_command_line_tools? 260 | ohai "Searching online for the Command Line Tools" 261 | # This temporary file prompts the 'softwareupdate' utility to list the Command Line Tools 262 | clt_placeholder = "/tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress" 263 | sudo "/usr/bin/touch", clt_placeholder 264 | clt_label = `softwareupdate -l | grep -B 1 -E "Command Line (Developer|Tools)" | awk -F"*" '/^ +\\*/ {print $2}' | sed 's/^ *//' | tail -n1`.chomp 265 | ohai "Installing #{clt_label}" 266 | sudo "/usr/sbin/softwareupdate", "-i", clt_label 267 | sudo "/bin/rm", "-f", clt_placeholder 268 | sudo "/usr/bin/xcode-select", "--switch", "/Library/Developer/CommandLineTools" 269 | end 270 | 271 | # Headless install may have failed, so fallback to original 'xcode-select' method 272 | if should_install_command_line_tools? && STDIN.tty? 273 | ohai "Installing the Command Line Tools (expect a GUI popup):" 274 | sudo "/usr/bin/xcode-select", "--install" 275 | puts "Press any key when the installation has completed." 276 | getc 277 | sudo "/usr/bin/xcode-select", "--switch", "/Library/Developer/CommandLineTools" 278 | end 279 | 280 | abort <<-EOABORT if `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$?.success? 281 | You have not agreed to the Xcode license. 282 | Before running the installer again please agree to the license by opening 283 | Xcode.app or running: 284 | sudo xcodebuild -license 285 | EOABORT 286 | 287 | ohai "Downloading and installing Homebrew..." 288 | Dir.chdir HOMEBREW_REPOSITORY do 289 | if git 290 | # we do it in four steps to avoid merge errors when reinstalling 291 | system git, "init", "-q" 292 | 293 | # "git remote add" will fail if the remote is defined in the global config 294 | system git, "config", "remote.origin.url", BREW_REPO 295 | system git, "config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*" 296 | 297 | # ensure we don't munge line endings on checkout 298 | system git, "config", "core.autocrlf", "false" 299 | 300 | args = git, "fetch", "origin", "master:refs/remotes/origin/master", 301 | "--tags", "--force" 302 | args << "--depth=1" unless ARGV.include?("--full") || !ENV["HOMEBREW_DEVELOPER"].nil? 303 | system(*args) 304 | 305 | system git, "reset", "--hard", "origin/master" 306 | 307 | system "ln", "-sf", "#{HOMEBREW_REPOSITORY}/bin/brew", "#{HOMEBREW_PREFIX}/bin/brew" 308 | 309 | system "#{HOMEBREW_PREFIX}/bin/brew", "update", "--force" 310 | else 311 | # -m to stop tar erroring out if it can't modify the mtime for root owned directories 312 | # pipefail to cause the exit status from curl to propagate if it fails 313 | curl_flags = "fsSL" 314 | core_tap = "#{HOMEBREW_PREFIX}/Homebrew/Library/Taps/homebrew/homebrew-core" 315 | system "/bin/bash -o pipefail -c '/usr/bin/curl -#{curl_flags} #{BREW_REPO}/tarball/master | /usr/bin/tar xz -m --strip 1'" 316 | 317 | system "ln", "-sf", "#{HOMEBREW_REPOSITORY}/bin/brew", "#{HOMEBREW_PREFIX}/bin/brew" 318 | 319 | system "/bin/mkdir", "-p", core_tap 320 | Dir.chdir core_tap do 321 | system "/bin/bash -o pipefail -c '/usr/bin/curl -#{curl_flags} #{CORE_TAP_REPO}/tarball/master | /usr/bin/tar xz -m --strip 1'" 322 | end 323 | end 324 | end 325 | 326 | warn "#{HOMEBREW_PREFIX}/bin is not in your PATH." unless ENV["PATH"].split(":").include? "#{HOMEBREW_PREFIX}/bin" 327 | 328 | ohai "Installation successful!" 329 | puts 330 | 331 | # Use the shell's audible bell. 332 | print "\a" 333 | 334 | # Use an extra newline and bold to avoid this being missed. 335 | ohai "Homebrew has enabled anonymous aggregate user behaviour analytics." 336 | puts <<-EOS 337 | #{Tty.bold}Read the analytics documentation (and how to opt-out) here: 338 | #{Tty.underline}https://git.io/brew-analytics#{Tty.reset} 339 | 340 | EOS 341 | 342 | if git 343 | Dir.chdir HOMEBREW_REPOSITORY do 344 | system git, "config", "--local", "--replace-all", "homebrew.analyticsmessage", "true" 345 | end 346 | end 347 | 348 | ohai "Next steps:" 349 | 350 | if macos_version < "10.9" && macos_version > "10.6" 351 | `/usr/bin/cc --version 2> /dev/null` =~ /clang-(\d{2,})/ 352 | version = $1.to_i 353 | if version < 425 354 | puts "- Install the #{Tty.bold}Command Line Tools for Xcode:" 355 | puts " #{Tty.underline}https://developer.apple.com/downloads#{Tty.reset}" 356 | end 357 | elsif !File.exist? "/usr/bin/cc" 358 | puts "- Install #{Tty.bold}Xcode:" 359 | puts " #{Tty.underline}https://developer.apple.com/xcode#{Tty.reset}" 360 | end 361 | 362 | unless git 363 | puts "- Run `brew update --force` to complete installation by installing:" 364 | puts " #{HOMEBREW_PREFIX}/share/doc/homebrew" 365 | puts " #{HOMEBREW_PREFIX}/share/man/man1/brew.1" 366 | puts " #{HOMEBREW_PREFIX}/share/zsh/site-functions/_brew" 367 | puts " #{HOMEBREW_PREFIX}/etc/bash_completion.d/brew" 368 | puts " #{HOMEBREW_REPOSITORY}/.git" 369 | end 370 | 371 | puts "- Run `brew help` to get started" 372 | puts "- Further documentation: " 373 | puts " #{Tty.underline}https://git.io/brew-docs#{Tty.reset}" 374 | -------------------------------------------------------------------------------- /data/book/ccc/blender.md: -------------------------------------------------------------------------------- 1 | # 如何透過 Blender 學習 3D 動畫設計 2 | 3 | ## 前言 4 | 5 | 我寫這篇文章的目的,是為了讓初學者可以快速的進入 Blender 動畫領域。 6 | 7 | 我是個程式設計者,在 2008 年開始透過 Blender 2.47 版學習動畫設計,我學習得很慢,因為一路上並沒有人教我,或者與我一起學習。 8 | 9 | 一開始學習 Blender 的時候,我仍然希望找到好的書籍幫助我學習,但是後來我發現自己錯了。 10 | 11 | 因為,學習動畫最好的資源,並不是書籍,而是教學影片。如果您嘗試透過書籍來學習 Blender ,您應該會與我當初一樣,落入「學習緩慢、格格不入」的窘境。因此,本文只是一堆教學影片的導引,重點在教學影片,而非文章本身。 12 | 13 | ## 安裝 14 | 15 | Blender 很小,很容易安裝,您可以從下列網址找到您想安裝的版本。 16 | 17 | * 18 | 19 | 以下是筆者對 Blender 所進行的基本介紹,您可以從中了解到 Blender 的歷史與其安裝的步驟。 20 | 21 | | 主題 | 投影片 | 教學影片 | 模型下載 | 22 | |-----|------|-------|--------| 23 | | 下載與安裝 | [ppt](1_BlenderInstall.ppt) | | | 24 | | Blender 的歷史 | | | | 25 | 26 | 註記:由於 Blender 在 2.5 版開始有了非常重大的改變,因此建議大家不要在使用 2.5 之前的版本來學習 Blender,最好使用最新版本。 27 | 28 | ## 開始使用 29 | 30 | 當您安裝好 Blender 之後,請啟動它試試看,您會看到一個很棒的介面,但是這個介面對於陌生的使用者而言卻是個很大的瓶頸。 31 | 32 | 在 Blender 的世界中,您必須善用滑鼠與快捷鍵,您最好使用 3 鍵式的滑鼠 (兩鍵式的將會很難用,建議不要用),這種滑鼠的中鍵通常是滾輪。 33 | 34 | 您可以用滾輪縮放畫面,或者壓住滾輪拖拉以便轉動角度,或者按住 Shift 同時移動滾輪進行平移動作。 35 | 36 | 接著建議您可以按照下列順序,觀看「簡報與影片」,以便學習基本的 Blender 操作。 37 | 38 | | 主題 | 投影片 | 教學影片 | 模型下載 | 39 | |-----|------|-------|--------| 40 | | 世界的操作 | [ppt](1_BlenderWorldOp.ppt) | | | 41 | | 物件的新增 | [ppt](1_BlenderObjAdd.ppt) | | | 42 | | 視角切換 | [ppt](1_BlenderView.ppt) | | | 43 | | 平移、旋轉、縮放 | [ppt](1_BlenderGSR.ppt) | | | 44 | | 視窗的切割 | [ppt](1_BlenderWinCut.ppt) | | | 45 | | 做一個雪人 | [ppt](1_BlenderShowMan.ppt) |
    | | 46 | | 做一個木偶人 | [ppt](1_BlenderWoodMan.ppt) | | | 47 | 48 | ## 編輯模式 49 | 50 | 一但您會了 Blender 的基本操作之後,就可以開始建立自己想要的形狀,而非使用拼積木的方式去建構模型。 51 | 52 | 要建立自己想要的形狀,必須進入編輯模式 (Edit Mode),對某些物鍵進行改造的動作。 53 | 54 | 筆者最喜歡的編輯方法是「擠出法」,用快速鍵 E 去擠出所想要物體的形狀,您可以從以下影片當中學習到有關編輯模式的基本操作。 55 | 56 | | 主題 | 投影片 | 教學影片 | 模型下載 | 57 | |-----|------|-------|--------| 58 | | 編輯模式 | [ppt](2_BlenderEdit.ppt) | | | 59 | | 編輯一間房子 | | | [模型](house.blend) | 60 | | 擠出法 | [ppt](2_BlenderExtrude.ppt) | | [模型](extrude.blend) | 61 | | 製作杯子 | | | | 62 | | 曲面編輯 | [ppt](2_BlenderProportional.ppt) | | | 63 | | 曲面:地形編輯 | | | [模型](Landscape.blend) | 64 | | 布林建模 | [ppt](2_BlenderBoolean.ppt) | | [模型](boolean.blend) | 65 | | 布林:有窗戶的房子 | | | [模型](CutMerge.blend) | 67 | | 重新多邊形化 (Remesh) | | | | 68 | 69 | ## 材質與花紋 70 | 71 | 然而,一個好的 3D 模型不能只是形狀很像,還要有逼真的顏色、材質與花紋,才能讓模型呈現出適當的美感,以下關於 Blender 材質花紋設定的教學影片。 72 | 73 | | 主題 | 投影片 | 教學影片 | 模型下載 | 74 | |-----|------|-------|--------| 75 | | 材質貼圖 (磚牆) | [ppt](3_BlenderBrickCube.ppt) | | [模型](BrickCube.zip)
    [模型](BrickWall.zip) | 76 | | 材質索引 (彩色方塊) | [ppt](3_BlenderMaterialIndices.ppt) | | [模型](ColorCube.blend)
    [模型](StarColorCube.blend) | 77 | | 玻璃材質 (杯子) | [ppt](3_BlenderGlassCup.ppt) | | [模型](GlassCup.zip) | 78 | | 凹凸花紋 | [ppt](3_BlenderNormalTexture.ppt) | | [模型](NormalTexture.blend) | 79 | | 凹凸表面 (殞石) | [ppt](2_BlenderStone.ppt) | | [模型](Stone.zip)
    [模型](MyAsteroid.zip)
    [模型](rock.zip) | 80 | | UV 貼圖 | [ppt](3_BlenderUVMap.ppt) | | [模型](UVMap.zip) | 81 | | UV 貼圖 - 骰子 | | | [模型](UVDice.blend) | 82 | | UV 貼圖 - 對稱球 | | | | 83 | | UV 貼圖 - 人臉 | | | | 84 | | 直接在模型上畫圖 | | | [模型](MonkeyVertexPaint.blend) | 85 | | 透明貼圖 | [ppt](TransparentTexture.ppt) |
    | [模型](TransparentTexture.zip) | 86 | 87 | 補充:隕石加上 Geometry/Displace 之後看來會更好,如 [此圖所示](rock.jpg) 。 88 | 89 | 推薦:[Andrew Price 的隕石教學](http://www.blenderguru.com/videos/how-to-make-a-realistic-asteroid/) 90 | 91 | ## 引入外部資源 92 | 93 | | 主題 | 投影片 | 教學影片 | 模型下載 | 94 | |-----|------|-------|--------| 95 | | 引入材質 (五彩玻璃) | [ppt](3_BlenderImportMaterial.ppt) | | [模型](ImportMaterial.zip) | 96 | | 下載模型 (剪刀) | | | | 97 | | 匯入模型 (剪刀) | | | | 98 | 99 | 註:使用 Append 或 Link 可以將另一 .blend 檔內的物件、場景或材質匯入。 100 | 101 | 102 | 註:感謝網友告知:關於BLENDER的模型轉移,在BLENDER2.66 版本推出了,ctrl+c ctrl+v 就可以完成兩個檔案間的模型移動了。 103 | 104 | ## 燈光、相機、圖層與呈像 105 | 106 | 即便模型已經很棒了,要是燈光打的不好,或者是相機鏡頭捉的不好,都無法呈現出好的作品,因此您還必須透過下列影片學習燈光與相機的相關使用方法。 107 | 108 | | 主題 | 投影片 | 教學影片 | 模型下載 | 109 | |-----|------|-------|--------| 110 | | 燈光與相機 | | | [模型](LightCamera.blend) | 111 | | 鎖定相機到此視角 | | | | 112 | | 圖層 | | | | 113 | | 互動式呈像 (Cycle Render) | | | | 114 | 115 | 116 | * Cycle Render 和原本的 Render 看來並不能直接套用,進一步的 Cycle Render 請參考: 117 | * 118 | * 虛擬巡覽 (Shift-F) : Andrew Price : Blender Fly Cam Upgrade -- 119 | * 相機對準目前場景 (Ctrl-Alt-0) : 屬性視窗 (N) 選 Lock Camera to View (可動態調整相機對焦場景) 120 | * 迷失的時候: 按 Home 鍵可以將相機拉回物體場景內 121 | * 針對物體的視角: 選物體後按 . NumPad 可以針對物體切換視角,例如 . 1 可切換到物體正視角。 122 | * 選擇 Render/Postprocessing/Edge 可產生有邊線的卡通風格,若 Threshold 設很大則所有邊線都會出現。 123 | 124 | * 推薦:從場景還原相機位置(相機追蹤) 125 | * 126 | * 127 | 128 | ## 基本動畫 129 | 130 | 到目前為止,我們已經學習了有關 3D 靜態模型的相關建構技術,但是卻還沒辦法讓模型動起來。在 Blender 當中,有關動畫 (Animation) 的部分可以很簡單,也可能很困難。 131 | 132 | 要讓一個模型動一動,包含平移、縮放、旋轉,甚至是變化顏色、屬性或材質,都非常的簡單。但是要製作出逼真可操控的好模型,像是人物、動物等等,特別是需要關節骨架動作的模型,就沒有那麼容易了。 133 | 134 | 讓我們先從容易的下手,介紹 Blender 當中最基本的動畫製作方式,請看下列教學影片。 135 | 136 | | 主題 | 投影片 | 教學影片 | 模型下載 | 137 | |-----|------|-------|--------| 138 | | 第一個動畫(立方體平移縮放旋轉) | | [模型](animation1.blend) | 139 | | 跟隨曲線 | | | [模型](follow_path.blend) | 140 | | 跟隨圓圈 | | | [模型](follow_circle.blend) | 141 | | 竹蜻蜓飛行 | | | [成品](http://youtu.be/IEHzUME64jQ) | 142 | | 直升機飛行 | | | [成品](http://youtu.be/71oyskcb1wM) | 143 | | 影片貼圖 (電視) | | | [成品](http://youtu.be/jRQU6Iqy1CI) | 144 | | 熱氣球飛行 | | | [成品](http://youtu.be/M-FQn61q3L0)
    [模型](balloon_fly.zip) | 145 | 146 | ## 變形動畫 ShapeKey 147 | 148 | | 主題 | 投影片 | 教學影片 | 模型下載 | 149 | |-----|------|-------|--------| 150 | | 變形 ShapeKey 1 (基礎) | | | | 151 | | 變形 ShapeKey 2 (方塊動畫) | | | [模型](ShapeKey2.blend) | 152 | | 變形 ShapeKey 3 (猴鼻子) | | | [模型](ShapeKey3.blend)
    [成品](http://youtu.be/5PIU1MV7KZA) | 153 | 154 | ## 關節骨架 155 | 156 | | 主題 | 投影片 | 教學影片 | 模型下載 | 157 | |-----|------|-------|--------| 158 | | 關節骨架基礎 | [ppt](4_BlenderArmatureBasic.ppt) | mac: | [模型](ArmatureBasic.blend) | 159 | | Blender動畫:木偶人 (主控骨架) | | | [模型](armatureController.blend) | 160 | | Blender動畫:木偶人 (完整骨架動畫) | | | [成品](http://youtu.be/3kmT-I-16rs)
    [模型](woodman_armature.zip) | 161 | | Blender動畫:木偶人 (1:建模) | | | | 162 | | Blender動畫:木偶人 (2:綁定) | | | | 163 | | Blender動畫:木偶人 (3:動畫) | | | | 164 | | Blender動畫:橡皮人踢腿擺手 (動畫) | | | [模型](peopleArmature.zip) | 165 | | Blender 的關節與骨架 (王銘璟示範) | | | | 166 | 167 | 168 | 筆者對關節骨架還不太熟練,沒辦法示範好進一步的操作,因此建議各位讀者看下列 cgboorman 在 YouTube 上的影片,以便練習進一步的關節骨架設計。 169 | 170 | * Blender 2.6 Tutorial 13 - Bones & Rigging 101 -- 171 | * Blender 2.6 Tutorial 30 - IK Rigging Pt. 1 / 3 -- 172 | * Blender 2.6 Tutorial 31 - IK Rigging Pt. 2 / 3 -- 173 | * 20:35 左手骨架鏡射為右手 (按 S X -1),然後再用 Armature/flipname 將名稱也改變。 174 | * Blender 2.6 Tutorial 32 - IK Rigging Pt. 3 / 3 -- 175 | * 11:40 腳踝的 IK bone 控制。 24:00 主控全身的控制點 25:00 綁定,選 皮膚模型再選 Armature 按 Ctrl -P,選 Set Parent to Armature with Automatic Weight. 176 | * 骨架 X 軸鏡射操控打勾時,雙手 (雙腳) 會作相同動作。 177 | 178 | ## 人物建模 179 | 180 | 由於筆者對人物建模還不熟悉,建議讀者看以下許家瑜同學示範的影片。 181 | 182 | * 許家瑜 (女娃 1) -- 183 | * 許家瑜 (女娃 2) -- 184 | * 許家瑜 (女娃 3) -- 185 | 186 | ## 驅動控制 187 | 188 | | 主題 | 投影片 | 教學影片 | 模型下載 | 189 | |-----|------|-------|--------| 190 | | Blender 動畫:驅動 (1) 用自身的位置控制Y軸大小 | | | | 191 | | Blender 動畫:驅動 (2) 用empty物件控制z軸大小 | | | | 192 | | Blender 動畫:驅動 (3a) 使用新屬性控制 | | | | 193 | | Blender 動畫:驅動 (3b) 球穿越閘門 | | | [模型](DriverBallGate.blend) | 194 | | Blender 動畫:驅動 (4) 直升機動螺旋槳就旋轉| | | [成品](http://youtu.be/yF2qgHWdie8)
    [模型](DriverHelicopter.blend) | 195 | 196 | ## 粒子物理系統 197 | 198 | 有時候我們會想做出像火焰、水流、布料等等很難用建模做出來的動畫,此時就必須要使用粒子系統 (Particle System) 與物理系統 (Physics System)。 199 | 200 | Blender 中的粒子系統可以模擬出成千上萬的粒子噴射效果,這種效果在製作「火焰、煙霧、隕石」等效果時是非常必要的技術。而物理系統則是用來製作像是「布料、液體、煙霧、碰撞」等效果。以下是我們關於粒子物理系統的教學影片。 201 | 202 | | 主題 | 投影片 | 教學影片 | 模型下載 | 203 | |-----|------|-------|--------| 204 | | 粒子系統基礎 | [ppt](5_BlenderParticles.ppt) | | [模型](ParticleBasics.blend) | 205 | | 布料 | [ppt](5_BlenderCloth.ppt) | | [模型](Cloth.blend) | 206 | 207 | ## 合法素材取得 208 | 209 | 為了製作動畫,您通常需要取得一些外部的素材,像是「材質、圖片、模型、影片、音樂、音效」等等。 210 | 211 | 如果您隨便從網路上取得這些素材,很容易就會不小心侵犯智慧財產權,因此最好能夠小心辨識素材的合法性。 212 | 213 | 目前大部分的合法素材都是以創作共用的方式在網路上分享的,以下影片會告訴您如何去下載合法的動畫用素材,特別是「創作共用」類的素材。 214 | 215 | | 主題 | 投影片 | 教學影片 | 模型下載 | 216 | |-----|------|-------|--------| 217 | | 動畫使用的創作共用素材 | [ppt](BlenderLegalResource.ppt) | | | 218 | 219 | 220 | * 模型: , 221 | * 森林場景: 222 | * 音樂: , , 223 | * 音效: , 224 | 225 | 226 | ## 使用 Blender 加入後製特效 227 | 228 | | 主題 | 文章/投影片 | 教學影片 | 模型下載 | 229 | |-----|------|-------|--------| 230 | | 以 Node Editor 製作模糊效果 | | | [ppt](BlurBall.blend) | 231 | | 以 Node Editor 製作前景模糊、背景清楚的效果 | | | [模型](BlurBallOverGround2.blend) | 232 | | 演算圖層:做出移動中有模糊效果的球 | | | [模型](BallBump.blend)
    [成品](http://youtu.be/YqVf2Sd53wo) | 234 | | [去除綠背景](removebackground) | | | [影片成品](http://youtu.be/EfW1uw-TEBQ) | 235 | 236 | ## 使用 MovieMaker 編輯字幕、配音、與製作影片 237 | 238 | 最後,您需要將所有用 Blender 製作出來的影片都剪接放在一起,然後配上字幕、音樂與聲音。 239 | 240 | 雖然 Blender 當中有一個 Video Sequence Editor 可以進行較複雜的影片後製動作,但是卻不太適合用來做字幕與配音,在此我們採用 Windows 當中內建的 MovieMaker,來示範影片製作剪輯的方法,以便能夠完整的介紹動畫製作的流程。 241 | 242 | | 主題 | 投影片 | 教學影片 | 模型下載 | 243 | |-----|------|-------|--------| 244 | | 使用 MovieMaker 製作影片 | | | | 245 | 246 | 247 | * -- Aegisub is a free, cross-platform open source tool for creating and modifying subtitles 248 | * 製作字幕軟體程式:快速幫影片配字幕(.srt) -- 249 | 250 | ## 其他相關工具 251 | 252 | * 開源影像處理軟體:建議採用 Krita -- 253 | * 開源影片後製軟體:建議採用 Natron -- 254 | 255 | 256 | ## 用 blender 做 3D 遊戲 257 | 258 | * Blender Game Tutorial (2.6): Building a 3D Game - Part 1 -- 259 | * Blender Game Tutorial (2.6): Building a 3D Game - Part 2 -- 260 | 261 | ## 更多教材 262 | 263 | 對於進階的動畫,特別是關於骨架綁定等部分,有許多部分超出筆者目前的能力範圍,目前筆者還沒有製作相關影片,但是還好網路上有許多的同好,他們的動畫能力都遠超過我,像是德魯依、Andrew Price、Artspacemedia 等等,您可以參考下列網址,以便學習進一步的 Blender 動畫技巧。 264 | 265 | * BornCG -- 266 | * Blender 2.7 -- 267 | * Andrew Price (英文:澳洲): 268 | * 德魯依 (中文:台灣): 269 | * Artspacemedia (中文:台灣): 270 | * Blender 基礎教程 - Shape Keys的基本使用 271 | * 272 | * Blender 基礎教程 - 載入中文字型 273 | * 274 | * Blender 基礎教程 - 常用文字屬性的設定和應用 275 | * 276 | * Blender 基礎教程 - 演算圖層(Render Layers)基礎 1 (讚!) 277 | * 278 | * Blender 基礎教程 - 演算圖層(Render Layers)基礎 2 (遮罩 MaskLayer 的使用) 279 | * 280 | * Blender 基礎教程 - Driver(驅動)基礎 1 281 | * 282 | * Blender 基礎教程 - Driver(驅動)基礎 2 283 | * 284 | * Blender 基礎教程 - Driver(驅動)基礎 3 285 | * 286 | * Blender 基礎教程 - Driver(驅動)基礎 4 287 | * 288 | * 2D 轉 3D 289 | * 290 | * 3D 印表 -- 291 | * 快捷鍵: 292 | 293 | * 插件 294 | * 匯出成網頁: 295 | 296 | 297 | -------------------------------------------------------------------------------- /web/css/pure-min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | Pure v0.6.0 3 | Copyright 2014 Yahoo! Inc. All rights reserved. 4 | Licensed under the BSD License. 5 | https://github.com/yahoo/pure/blob/master/LICENSE.md 6 | */ 7 | /*! 8 | normalize.css v^3.0 | MIT License | git.io/normalize 9 | Copyright (c) Nicolas Gallagher and Jonathan Neal 10 | */ 11 | /*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.hidden,[hidden]{display:none!important}.pure-img{max-width:100%;height:auto;display:block}.pure-g{letter-spacing:-.31em;*letter-spacing:normal;*word-spacing:-.43em;text-rendering:optimizespeed;font-family:FreeSans,Arimo,"Droid Sans",Helvetica,Arial,sans-serif;display:-webkit-flex;-webkit-flex-flow:row wrap;display:-ms-flexbox;-ms-flex-flow:row wrap;-ms-align-content:flex-start;-webkit-align-content:flex-start;align-content:flex-start}.opera-only :-o-prefocus,.pure-g{word-spacing:-.43em}.pure-u{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-g [class *="pure-u"]{font-family:sans-serif}.pure-u-1,.pure-u-1-1,.pure-u-1-2,.pure-u-1-3,.pure-u-2-3,.pure-u-1-4,.pure-u-3-4,.pure-u-1-5,.pure-u-2-5,.pure-u-3-5,.pure-u-4-5,.pure-u-5-5,.pure-u-1-6,.pure-u-5-6,.pure-u-1-8,.pure-u-3-8,.pure-u-5-8,.pure-u-7-8,.pure-u-1-12,.pure-u-5-12,.pure-u-7-12,.pure-u-11-12,.pure-u-1-24,.pure-u-2-24,.pure-u-3-24,.pure-u-4-24,.pure-u-5-24,.pure-u-6-24,.pure-u-7-24,.pure-u-8-24,.pure-u-9-24,.pure-u-10-24,.pure-u-11-24,.pure-u-12-24,.pure-u-13-24,.pure-u-14-24,.pure-u-15-24,.pure-u-16-24,.pure-u-17-24,.pure-u-18-24,.pure-u-19-24,.pure-u-20-24,.pure-u-21-24,.pure-u-22-24,.pure-u-23-24,.pure-u-24-24{display:inline-block;*display:inline;zoom:1;letter-spacing:normal;word-spacing:normal;vertical-align:top;text-rendering:auto}.pure-u-1-24{width:4.1667%;*width:4.1357%}.pure-u-1-12,.pure-u-2-24{width:8.3333%;*width:8.3023%}.pure-u-1-8,.pure-u-3-24{width:12.5%;*width:12.469%}.pure-u-1-6,.pure-u-4-24{width:16.6667%;*width:16.6357%}.pure-u-1-5{width:20%;*width:19.969%}.pure-u-5-24{width:20.8333%;*width:20.8023%}.pure-u-1-4,.pure-u-6-24{width:25%;*width:24.969%}.pure-u-7-24{width:29.1667%;*width:29.1357%}.pure-u-1-3,.pure-u-8-24{width:33.3333%;*width:33.3023%}.pure-u-3-8,.pure-u-9-24{width:37.5%;*width:37.469%}.pure-u-2-5{width:40%;*width:39.969%}.pure-u-5-12,.pure-u-10-24{width:41.6667%;*width:41.6357%}.pure-u-11-24{width:45.8333%;*width:45.8023%}.pure-u-1-2,.pure-u-12-24{width:50%;*width:49.969%}.pure-u-13-24{width:54.1667%;*width:54.1357%}.pure-u-7-12,.pure-u-14-24{width:58.3333%;*width:58.3023%}.pure-u-3-5{width:60%;*width:59.969%}.pure-u-5-8,.pure-u-15-24{width:62.5%;*width:62.469%}.pure-u-2-3,.pure-u-16-24{width:66.6667%;*width:66.6357%}.pure-u-17-24{width:70.8333%;*width:70.8023%}.pure-u-3-4,.pure-u-18-24{width:75%;*width:74.969%}.pure-u-19-24{width:79.1667%;*width:79.1357%}.pure-u-4-5{width:80%;*width:79.969%}.pure-u-5-6,.pure-u-20-24{width:83.3333%;*width:83.3023%}.pure-u-7-8,.pure-u-21-24{width:87.5%;*width:87.469%}.pure-u-11-12,.pure-u-22-24{width:91.6667%;*width:91.6357%}.pure-u-23-24{width:95.8333%;*width:95.8023%}.pure-u-1,.pure-u-1-1,.pure-u-5-5,.pure-u-24-24{width:100%}.pure-button{display:inline-block;zoom:1;line-height:normal;white-space:nowrap;vertical-align:middle;text-align:center;cursor:pointer;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button{font-family:inherit;font-size:100%;padding:.5em 1em;color:#444;color:rgba(0,0,0,.8);border:1px solid #999;border:0 rgba(0,0,0,0);background-color:#E6E6E6;text-decoration:none;border-radius:2px}.pure-button-hover,.pure-button:hover,.pure-button:focus{filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#1a000000', GradientType=0);background-image:-webkit-gradient(linear,0 0,0 100%,from(transparent),color-stop(40%,rgba(0,0,0,.05)),to(rgba(0,0,0,.1)));background-image:-webkit-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:-moz-linear-gradient(top,rgba(0,0,0,.05) 0,rgba(0,0,0,.1));background-image:-o-linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1));background-image:linear-gradient(transparent,rgba(0,0,0,.05) 40%,rgba(0,0,0,.1))}.pure-button:focus{outline:0}.pure-button-active,.pure-button:active{box-shadow:0 0 0 1px rgba(0,0,0,.15) inset,0 0 6px rgba(0,0,0,.2) inset;border-color:#000\9}.pure-button[disabled],.pure-button-disabled,.pure-button-disabled:hover,.pure-button-disabled:focus,.pure-button-disabled:active{border:0;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);filter:alpha(opacity=40);-khtml-opacity:.4;-moz-opacity:.4;opacity:.4;cursor:not-allowed;box-shadow:none}.pure-button-hidden{display:none}.pure-button::-moz-focus-inner{padding:0;border:0}.pure-button-primary,.pure-button-selected,a.pure-button-primary,a.pure-button-selected{background-color:#0078e7;color:#fff}.pure-form input[type=text],.pure-form input[type=password],.pure-form input[type=email],.pure-form input[type=url],.pure-form input[type=date],.pure-form input[type=month],.pure-form input[type=time],.pure-form input[type=datetime],.pure-form input[type=datetime-local],.pure-form input[type=week],.pure-form input[type=number],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=color],.pure-form select,.pure-form textarea{padding:.5em .6em;display:inline-block;border:1px solid #ccc;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;vertical-align:middle;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pure-form input:not([type]){padding:.5em .6em;display:inline-block;border:1px solid #ccc;box-shadow:inset 0 1px 3px #ddd;border-radius:4px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pure-form input[type=color]{padding:.2em .5em}.pure-form input[type=text]:focus,.pure-form input[type=password]:focus,.pure-form input[type=email]:focus,.pure-form input[type=url]:focus,.pure-form input[type=date]:focus,.pure-form input[type=month]:focus,.pure-form input[type=time]:focus,.pure-form input[type=datetime]:focus,.pure-form input[type=datetime-local]:focus,.pure-form input[type=week]:focus,.pure-form input[type=number]:focus,.pure-form input[type=search]:focus,.pure-form input[type=tel]:focus,.pure-form input[type=color]:focus,.pure-form select:focus,.pure-form textarea:focus{outline:0;border-color:#129FEA}.pure-form input:not([type]):focus{outline:0;border-color:#129FEA}.pure-form input[type=file]:focus,.pure-form input[type=radio]:focus,.pure-form input[type=checkbox]:focus{outline:thin solid #129FEA;outline:1px auto #129FEA}.pure-form .pure-checkbox,.pure-form .pure-radio{margin:.5em 0;display:block}.pure-form input[type=text][disabled],.pure-form input[type=password][disabled],.pure-form input[type=email][disabled],.pure-form input[type=url][disabled],.pure-form input[type=date][disabled],.pure-form input[type=month][disabled],.pure-form input[type=time][disabled],.pure-form input[type=datetime][disabled],.pure-form input[type=datetime-local][disabled],.pure-form input[type=week][disabled],.pure-form input[type=number][disabled],.pure-form input[type=search][disabled],.pure-form input[type=tel][disabled],.pure-form input[type=color][disabled],.pure-form select[disabled],.pure-form textarea[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input:not([type])[disabled]{cursor:not-allowed;background-color:#eaeded;color:#cad2d3}.pure-form input[readonly],.pure-form select[readonly],.pure-form textarea[readonly]{background-color:#eee;color:#777;border-color:#ccc}.pure-form input:focus:invalid,.pure-form textarea:focus:invalid,.pure-form select:focus:invalid{color:#b94a48;border-color:#e9322d}.pure-form input[type=file]:focus:invalid:focus,.pure-form input[type=radio]:focus:invalid:focus,.pure-form input[type=checkbox]:focus:invalid:focus{outline-color:#e9322d}.pure-form select{height:2.25em;border:1px solid #ccc;background-color:#fff}.pure-form select[multiple]{height:auto}.pure-form label{margin:.5em 0 .2em}.pure-form fieldset{margin:0;padding:.35em 0 .75em;border:0}.pure-form legend{display:block;width:100%;padding:.3em 0;margin-bottom:.3em;color:#333;border-bottom:1px solid #e5e5e5}.pure-form-stacked input[type=text],.pure-form-stacked input[type=password],.pure-form-stacked input[type=email],.pure-form-stacked input[type=url],.pure-form-stacked input[type=date],.pure-form-stacked input[type=month],.pure-form-stacked input[type=time],.pure-form-stacked input[type=datetime],.pure-form-stacked input[type=datetime-local],.pure-form-stacked input[type=week],.pure-form-stacked input[type=number],.pure-form-stacked input[type=search],.pure-form-stacked input[type=tel],.pure-form-stacked input[type=color],.pure-form-stacked input[type=file],.pure-form-stacked select,.pure-form-stacked label,.pure-form-stacked textarea{display:block;margin:.25em 0}.pure-form-stacked input:not([type]){display:block;margin:.25em 0}.pure-form-aligned input,.pure-form-aligned textarea,.pure-form-aligned select,.pure-form-aligned .pure-help-inline,.pure-form-message-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle}.pure-form-aligned textarea{vertical-align:top}.pure-form-aligned .pure-control-group{margin-bottom:.5em}.pure-form-aligned .pure-control-group label{text-align:right;display:inline-block;vertical-align:middle;width:10em;margin:0 1em 0 0}.pure-form-aligned .pure-controls{margin:1.5em 0 0 11em}.pure-form input.pure-input-rounded,.pure-form .pure-input-rounded{border-radius:2em;padding:.5em 1em}.pure-form .pure-group fieldset{margin-bottom:10px}.pure-form .pure-group input,.pure-form .pure-group textarea{display:block;padding:10px;margin:0 0 -1px;border-radius:0;position:relative;top:-1px}.pure-form .pure-group input:focus,.pure-form .pure-group textarea:focus{z-index:3}.pure-form .pure-group input:first-child,.pure-form .pure-group textarea:first-child{top:1px;border-radius:4px 4px 0 0;margin:0}.pure-form .pure-group input:first-child:last-child,.pure-form .pure-group textarea:first-child:last-child{top:1px;border-radius:4px;margin:0}.pure-form .pure-group input:last-child,.pure-form .pure-group textarea:last-child{top:-2px;border-radius:0 0 4px 4px;margin:0}.pure-form .pure-group button{margin:.35em 0}.pure-form .pure-input-1{width:100%}.pure-form .pure-input-2-3{width:66%}.pure-form .pure-input-1-2{width:50%}.pure-form .pure-input-1-3{width:33%}.pure-form .pure-input-1-4{width:25%}.pure-form .pure-help-inline,.pure-form-message-inline{display:inline-block;padding-left:.3em;color:#666;vertical-align:middle;font-size:.875em}.pure-form-message{display:block;color:#666;font-size:.875em}@media only screen and (max-width :480px){.pure-form button[type=submit]{margin:.7em 0 0}.pure-form input:not([type]),.pure-form input[type=text],.pure-form input[type=password],.pure-form input[type=email],.pure-form input[type=url],.pure-form input[type=date],.pure-form input[type=month],.pure-form input[type=time],.pure-form input[type=datetime],.pure-form input[type=datetime-local],.pure-form input[type=week],.pure-form input[type=number],.pure-form input[type=search],.pure-form input[type=tel],.pure-form input[type=color],.pure-form label{margin-bottom:.3em;display:block}.pure-group input:not([type]),.pure-group input[type=text],.pure-group input[type=password],.pure-group input[type=email],.pure-group input[type=url],.pure-group input[type=date],.pure-group input[type=month],.pure-group input[type=time],.pure-group input[type=datetime],.pure-group input[type=datetime-local],.pure-group input[type=week],.pure-group input[type=number],.pure-group input[type=search],.pure-group input[type=tel],.pure-group input[type=color]{margin-bottom:0}.pure-form-aligned .pure-control-group label{margin-bottom:.3em;text-align:left;display:block;width:100%}.pure-form-aligned .pure-controls{margin:1.5em 0 0}.pure-form .pure-help-inline,.pure-form-message-inline,.pure-form-message{display:block;font-size:.75em;padding:.2em 0 .8em}}.pure-menu{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.pure-menu-fixed{position:fixed;left:0;top:0;z-index:3}.pure-menu-list,.pure-menu-item{position:relative}.pure-menu-list{list-style:none;margin:0;padding:0}.pure-menu-item{padding:0;margin:0;height:100%}.pure-menu-link,.pure-menu-heading{display:block;text-decoration:none;white-space:nowrap}.pure-menu-horizontal{width:100%;white-space:nowrap}.pure-menu-horizontal .pure-menu-list{display:inline-block}.pure-menu-horizontal .pure-menu-item,.pure-menu-horizontal .pure-menu-heading,.pure-menu-horizontal .pure-menu-separator{display:inline-block;*display:inline;zoom:1;vertical-align:middle}.pure-menu-item .pure-menu-item{display:block}.pure-menu-children{display:none;position:absolute;left:100%;top:0;margin:0;padding:0;z-index:3}.pure-menu-horizontal .pure-menu-children{left:0;top:auto;width:inherit}.pure-menu-allow-hover:hover>.pure-menu-children,.pure-menu-active>.pure-menu-children{display:block;position:absolute}.pure-menu-has-children>.pure-menu-link:after{padding-left:.5em;content:"\25B8";font-size:small}.pure-menu-horizontal .pure-menu-has-children>.pure-menu-link:after{content:"\25BE"}.pure-menu-scrollable{overflow-y:scroll;overflow-x:hidden}.pure-menu-scrollable .pure-menu-list{display:block}.pure-menu-horizontal.pure-menu-scrollable .pure-menu-list{display:inline-block}.pure-menu-horizontal.pure-menu-scrollable{white-space:nowrap;overflow-y:hidden;overflow-x:auto;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;padding:.5em 0}.pure-menu-horizontal.pure-menu-scrollable::-webkit-scrollbar{display:none}.pure-menu-separator{background-color:#ccc;height:1px;margin:.3em 0}.pure-menu-horizontal .pure-menu-separator{width:1px;height:1.3em;margin:0 .3em}.pure-menu-heading{text-transform:uppercase;color:#565d64}.pure-menu-link{color:#777}.pure-menu-children{background-color:#fff}.pure-menu-link,.pure-menu-disabled,.pure-menu-heading{padding:.5em 1em}.pure-menu-disabled{opacity:.5}.pure-menu-disabled .pure-menu-link:hover{background-color:transparent}.pure-menu-active>.pure-menu-link,.pure-menu-link:hover,.pure-menu-link:focus{background-color:#eee}.pure-menu-selected .pure-menu-link,.pure-menu-selected .pure-menu-link:visited{color:#000}.pure-table{border-collapse:collapse;border-spacing:0;empty-cells:show;border:1px solid #cbcbcb}.pure-table caption{color:#000;font:italic 85%/1 arial,sans-serif;padding:1em 0;text-align:center}.pure-table td,.pure-table th{border-left:1px solid #cbcbcb;border-width:0 0 0 1px;font-size:inherit;margin:0;overflow:visible;padding:.5em 1em}.pure-table td:first-child,.pure-table th:first-child{border-left-width:0}.pure-table thead{background-color:#e0e0e0;color:#000;text-align:left;vertical-align:bottom}.pure-table td{background-color:transparent}.pure-table-odd td{background-color:#f2f2f2}.pure-table-striped tr:nth-child(2n-1) td{background-color:#f2f2f2}.pure-table-bordered td{border-bottom:1px solid #cbcbcb}.pure-table-bordered tbody>tr:last-child>td{border-bottom-width:0}.pure-table-horizontal td,.pure-table-horizontal th{border-width:0 0 1px;border-bottom:1px solid #cbcbcb}.pure-table-horizontal tbody>tr:last-child>td{border-bottom-width:0} --------------------------------------------------------------------------------