2021-06-19 17:33:24 +08:00
[def-syntax q [[_] [str "\""]]]
[script "packages/font-fallback"]
[script "packages/grid"]
2021-06-20 23:12:03 +08:00
[define section-var 1]
[define sub-section-var 1]
[define section-title ""]
% custom macro
[def-syntax section
[[_ x][begin
[set! section-title [str-append [str-append [str section-var] [str ". " ]] [str x]]]
[font [[size "20pt"][weight "800"]] section-title]
[set! section-var [+ section-var 1]]
[set! sub-section-var 1]
]]]
% custom macro
[def-syntax subsection
[[_ x][begin
[set! section-title [str-append [str-append [str sub-section-var] [str ". " ]] [str x]]]
[font [[size "16pt"][weight "600"]] section-title]
[set! sub-section-var [+ sub-section-var 1]]
]]]
2021-06-19 17:33:24 +08:00
[docu-para [[class "book"][papersize "b5"]]]
[docu
[call grid [[spacing "15pt"]]]
[call font:add-fallback [[family "Noto Serif CJK TC"]]]
[font-size "30pt" "Huan-gîng 使用 Clochur!"]
[font-size "20pt" "Welcome to use"] [font [[family "sligeach_orig"][size "20pt"]] "Clóċur"][font-size "20pt" ", a toy editor, toy intepreter and a toy typesetting-engine frontend."]
2021-06-20 23:12:03 +08:00
[section "What is Clochur?"]
2021-06-19 17:33:24 +08:00
2021-06-20 23:12:03 +08:00
Clochur, or printed as "\""[font-family "sligeach_orig" "Clóċur"]"\"" in Irish language ([italic "\"CLOW-kur\""] Clóċur as Roman type, which means [q]typesetting[q]), is a toy-lisp typesetting language with a intepreter written in Python 3, and with a simple Editor written in PyQt5 and QScintilla.
2021-06-19 17:33:24 +08:00
It generate a XML that is readable for SILE, which is a typesetting engine written in Lua,
and it generate PDF with SILE.
The functions that it has (although may be buggy or needed to be tested) is:
- Macro expansion.
- call SILE command.
- count basic arithmetic expression.
[str "- lambda function"], function definition.
2021-06-20 23:12:03 +08:00
[section "Simple manual"]
[subsection "Macro"]
Using 'def-syntax', you can add your macro to sile. the example is a "custom-section" macro:
[font-family "Noto Sans Mono CJK TC"
% custom macro
"[def-syntax \"section\"
[[_ x][begin] ]
[set! section-title [str-append [str-append [str [str \"section-var\"]] [str \". \" ]] [str x]]]
[font [[size \"20pt\"][weight \"800\"]] [str \"section-title\"]]
[set! [str \"section-var\"] [+ [str \"section-var\"] 1]]
]]]"