clo/README.md

84 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

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