A site generator based on a collection of racket/scribble programs.
下面著手描述這個專案的核心想法
地址唯一性 [tr-0003]
地址唯一性 [tr-0003]
每張卡片應有唯一的地址
生成 embed 與 index HTML [tr-0001]
生成 embed 與 index HTML [tr-0001]
embed 之間需要按引用關係構造,所以用 topological sort 排序(從 metadata.json 中復原依賴關係)後按順序編譯
通過分成兩階段生成,可以讓 index 引入 embed 的內容
raco tr next 與使用方式 [tr-0002]
raco tr next 與使用方式 [tr-0002]
讓 raco tr next xxx 生成新的地址,就可以用 code $(raco tr next xxx).scrbl 這樣的方式開啟新檔案
數學支援 [tr-0004]
數學支援 [tr-0004]
用 Katex 支援公式,用 LaTeX 支援複雜的圖
LaTeX 工作的獨立標籤 [tr-0006]
LaTeX 工作的獨立標籤 [tr-0006]
每個 address yyy 對 LaTeX 會創造新的相關的 _tmp/yyy/tex3212.tex 之類的檔案,tex3212 是用 gensym 產生。
如此一來 *.tex 檔案可知道自己是哪個 address 產出,如果 source 沒有更新便不編譯。
RSS 與 searching [tr-0005]
RSS 與 searching [tr-0005]
利用預先生成的 addr.metadata.json 進一步生成 RSS 與索引資料
tr/card [tr-0008]
tr/card [tr-0008]
Code changes: https://github.com/dannypsnl/tr/commit/c1000033203c4216cdccff53bac7f2288a76b867
在 metadata 裡面加入 locals 這個概念,在這個陣列裡面儲存 title 跟 taxon 資訊。遞迴時先標好地址,把資訊存到相應的地址中,就得到平坦的結構。於是就不一定需要開新的檔案來寫新的 card 了。