]> git.kianting.info Git - clo/blob - README.md
update documentation link
[clo] / README.md
1 # clo
2 - another personal draught of a typesetting language and engine.
3 - website: https://kianting.info/wiki/w/Project:Clo
4 - license: MIT
5 - docs : https://kianting.info/wiki/w/Project:Clo
6 - issue tracking mailing list: `clo@kianting.info`
7
8 ## How to use
9 ```
10 cd /path/to/clo
11 node . [.clo FILE] --output-js=[.js FILE]
12 node [.js FILE]
13 ```
14
15 ## changing journal
16 - 20230904 建立 thenDo、matchRange的函數、refactor harfbuzzjs 以及libpdf 等測試界面
17 - 20230905-06: 建立 : `toSome`, initial of basic tokenizer (`tokenize`),
18 `matchAny`, `notDo`, `orDo`, `zeroOrMoreDo`, `zeroOrOnceDo`
19 - 20230905-07:強化`tokenize`, 加強功能,加`Token`界面。
20 - 20230907-08:強化`tokenize`
21 - 20230910 : add basic parser `CONST` rule, and add the grammar rule.
22 - 20230914-15: 追加一寡 tokenizer ê 功能。
23 - 20230918: 重新tuì下kàu頂起做parser. add rule
24 - 20230921-22:add rule, report issue
25 - 20230925-26: 試驗án-tsuánn解決[issue1](https://kianting.info/pipermail/clo_kianting.info/2023-September/000004.html), iáu-buē成功。
26 - 凡勢用?
27 ```
28 FuncApp ::= Single FuncAppAux | Single
29 FuncAppAUx ::= FunCallee FuncAppAUx
30 FuncCallee ::= "(" ")" | "(" ARGS ")"
31 ARGS = SINGLE "," ARGS | SINGLE
32 ```
33 - 20230928:basically fix `issue1`。其他ê物件猶著做。
34 - 20230929:add multi args parsing for `callee`.
35 - 20230930:tîng khí parser, using `js-token`.
36 - 20231006: tîng siá parser, using `ts-parsec`.
37 - 20231010: 初步完成tsit ê階段ê Parser`。
38 - 20231012: clo->js converter successfully (maybe.)
39 - 20231016:basic font guessing and `putText` function
40 - 20231023-24:fix .ttc bug.
41 - 20231026-27 : clo basic interface, preprocessor of stream of text,
42 add cjk-english splitter, etc.
43 - 20231029-30: hyphenating for english.
44 - 20231105-06: 利用fontkit算文字的對應px寬度 initially pushed.
45 - 20231109-10: Keng-kái oa̍h-chōa ián-sǹg-hoat.
46 - 20231113: the algorithm is basically fixed, and make a `bigFrame` to prepare for convert to boxes and positions.
47 - 20231115-16: grid and basic types laying.
48 - 20231120: fix the line-breaking algorithm
49 - 20231125: multiple paragraph basic
50
51 ## 之後的做法
52 - 先做一個前處理註冊器,註冊下列的前處理
53 - 中英文間距
54 - 換行點
55 - 空白轉為 [glue]
56 - 前處理完成字串後,必須要:
57 - 算出字元的Box
58 - 利用 frame/box 資訊分行、分頁
59 - 然後算出每個Box的x, y, page
60 - 最後納入排版
61
62 ## 排版語法
63
64 使用lisp表示,但其實是陣列
65 ```lisp
66 (hglue 寬度 伸展值)
67 (vglue 高度 伸展值)
68 (bp 原始模式 斷行模式) ; breakpoint
69 (br) ; force newline
70 (em 數字)
71 (ex 數字)
72 (span {"font-family" : "Noto Sans" , "font-size" : 16 })
73 (vbox 高度 內容)
74 ```
75
76 ## How to generate documents
77 - `typedoc /path/to/src1 [/path/to/another/src/or/.js ...]`
78 the generated page will be stored in `/docs`.
79
80 - set the referee source to my repo:
81 - `typedoc --sourceLinkTemplate "https://git.kianting.info/?p=clo;a=blob;f={path};hb=HEAD#l{line}" /path/to/src1 ...`
82
83 store the documents
84 - `rsync /path/to/docs host@/var/www/docs`