[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."]
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.
The author has (unofficially) learned Irish language (for a while and uncontinuously), so use the name.
[subsection "How is the language? It seems that it uses brackets insteads of parathesis."]
The langauge is inspired by SILE and Scheme, even though it has some different characteristics. To make the code neat and consider that parathesis is used more often than bracket, so it's more suitable to use bracket for syntatical usage.
It's a toy language, so many of the function of Scheme, is not used here (for example call/cc), and there is no "\"let\"" to support local variables. However, you can call SILE function and using the packages of it with "\"call\"" and "\"script\"" respectively.
[subsection "Does it support Taiwanese (Hokkien)/Hakka/Mandarin/Japanese/Korean or any other language that I want?"]
SILE supports utf-8, and Clochur will generate a XML that is readable to SILE, as long as any language that SILE can support, Clochur will support. If you find any bug, please tell me.
Clochur is not a WYSIWYG editor, you have to type the lisp language by your self. Nevertheless, it's not a pure text-editor, it contains a PDF viewer powered by PDF.js, If you have edited you code, you can click the green right arrow botton on the first toolbar to convert it to XML file, then generate and show PDF file from it.
[call img [[src "toolbars.png"] [height "60pt"]]]
[image-desc "The toolbars of Clochur"]
The description of the botton of the 1st toolbar is shown below (from left to right):
- Create a file (create a new window)
- Open a file
- Save a file
- Save as...
- Convert to PDF
- Redo
- Undo
- Cut
- Copy
- Paste
The description of the botton of the 2nd toolbar is shown below (from left to right):
- apply "bold" macro to the selected text
- apply "italic" macro to the selected text
- apply "underline" macro to the selected text
- "font" list
- apply the "font" shown in the "font" list to the selected text
[subsection "Basic input, [docu], and special character"]
Basically, you can type the sentence that you want to type directly in sile. However, the document should be inside a macro call "\"docu\"". For example:
To type brackets \[ & \], you should type \\\[ & \\\] respectively; and to type blackslash \\, you should type \\\\. To type quotation mark \", you should type \\\". A word or a sentence between 2 quotation marks (\") will be shown without the quotation marks. eg: [font-family "Noto Sans Mono CJK TC" "\"It will be there.\""]
will be shown as:
"It will be there."
To make the quotation mark shown, you should enclose it between quotation mark \" and using \\\". [font-family "Noto Sans Mono CJK TC" "\"\\\"It will be there.\\\"\""] will be shown as:
% set font style to italic and and insert expression as it's argument
[font [[style "italic"]] [str [+ 9 9]]]
% set font size
[font [[size "30pt"]] "text size test"]
You can use the macros [mono "[bold {text}]"], [mono "[italic {text}]"], [mono "[font-family {font-family} {text}]"] and [mono "[font-size {font-size} {text}]"] to get these effects.
Using [mono "underline"] macro, can [str "underline"] a word. eg:
You can use [mono "[str-append str1 str2]"] to append a string to another, and you can use [mono "[str-append-many str1 str2 {str3 ...}]"] to append 2 or more strings. eg.
[str-append [str 1] [str 2]]
[str-append-many [str 1] [str 2] [str 3]]
it can use to combine many commands, because the output is the combination of commands.
[font [[family "FreeSerif"][weight "900"]] "Print and begin"]
[mono "[print str]"] print the str to the terminal, and [mono "[begin exp1 {exp2 ...}]"] executes the commands and return the return value of the last command.
[mono "[ls item1 {item2 ...}]"] create a list. eg:
[mono "[ls 1 2 3 4]"] returns
[ls 1 2 3 4]
[mono "car"] get the 1st element, and [mono "cdr"] get the rest of the list. [mono "[list-ref list index]"] get the ith-index (start from 0) of list, and [mono "[cons item list]"] combine a item to a list. eg.