Guidelines
Dir Managing
assetsstores images or other data (determined by keysrc_assets)docsstores textscriptstores scripts (determined by keysrc_script)
Naming
The name part should be unique, and
should be made up of
a-z,0-9and_must not be
index, since it will be automatically generatedsetting.tomlis for special use (if it exists), view setting
Markdown Format
Files should start with
# title, and no#should be used afterwards.For links to the same docs field:
use relative paths
use
#subtitleafter a link to markdown file to specify the place, uniqueness must be ensured, it will be turned to#header-subtitlein HTMLuse
#Lx-Lyafter a link specify the lines of the first codeblock
Code Block Format
Language name should not be empty. Use
plaininstead.Use
insert-htmlto insert HTML.Use
hideto let something show only after clicking a button.Use
encodedto tag that something has been encode, and parsing is still done assuming the format is Markdown.Use
is-xxxto insert markdown which will be shown ifflocalStorage.getItem("is-xxx") == "true". A setting page shall be given for readers usinginsert-htmlblock.
insert-fill inserts a gap-filling answer board. Use TOML:
content = "description, uses **Markdown**"
ans = "standard answer"
ans_regex = "answer judger, if this key doesn't exist, judgement is \"being the same as the standard answer\""
instruction = "instruction (you can choose not to set this key; does not support Markdown)"
Insert Setting
Code-blocks with insert-setting insert tests. It uses TOML and the type key decides the type.
select-is
Currently, type = "select-is" is the only supported mode.
content is in key
content, does not support Markdownchoicesdefines avalue=>display textdictdefaultdefines the default valuestoredefines avalue=>localStorage keydict, if key-name starts with!, the referred key will be set to"false"
Insert Test
Code-blocks with insert-test insert tests. It also uses TOML.
Structure
There are two main keys: global for global setting and pages, a table-list.
In global setting, name represents the name of the test, time_limit is the time limit (seconds) and full_score is the full score (does not decide how scores are arranged).
The q_pre key decides the question-prefix method, currently only none and number(default) are supported.
For each part, the type key decides the type.
Text
type = "text" means inserting text, content is in key content, supports Markdown
Choice Question
type = "choose" means inserting choice question
content is in key
content, supports Markdownchoices indexing is based on
index_charandindex_suffix, the first should be one ofAa1(defaults toA), the second defaults to.choicesdefines choices, Markdown isn't supportedansdefines answer (useACinstead ofCAorab)scoredefines the scoreans_dictis a dict (choice => score), overwritesansandscore
Filling Question
type = "fill" means inserting a filling question
content is in key
content, supports Markdownansdefines answerans_regexdefines regex for judging, overwritesansscoredefines the score
Grouping
type = "group" defines a group, content is in key content, supports Markdown; type = "group-end" marks the end of a group
groups can't nest, so it's not necessary to add
group-endblock after every groupch_typeprovides default type for parts in the group withouttypekey
Scope
index_char, index_suffix and score have scopes. This means they can be defined in global or groups, while local definitions can still overwrite definitions in wider fields.
Insert Random Word
Code-blocks with random-word insert random words. It uses TOML and the id key decides the identifier. pool is an array of dictionaries. For each dictionary, the text key is the text content, and will not be html-unescape.