Guidelines
Dir Managing
assets
stores images or other data (determined by keysrc_assets
)docs
stores textscript
stores scripts (determined by keysrc_script
)
Naming
The name part should be unique, and
should be made up of
a-z
,0-9
and_
must not be
index
, since it will be automatically generatedsetting.toml
is 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
#subtitle
after a link to markdown file to specify the place, uniqueness must be ensured, it will be turned to#header-subtitle
in HTMLuse
#Lx-Ly
after a link specify the lines of the first codeblock
Code Block Format
Language name should not be empty. Use
plain
instead.Use
insert-html
to insert HTML.Use
hide
to let something show only after clicking a button.Use
encoded
to tag that something has been encode, and parsing is still done assuming the format is Markdown.Use
is-xxx
to insert markdown which will be shown ifflocalStorage.getItem("is-xxx") == "true"
. A setting page shall be given for readers usinginsert-html
block.
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 Markdownchoices
defines avalue
=>display text
dictdefault
defines the default valuestore
defines avalue
=>localStorage key
dict, 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_char
andindex_suffix
, the first should be one ofAa1
(defaults toA
), the second defaults to.
choices
defines choices, Markdown isn't supportedans
defines answer (useAC
instead ofCA
orab
)score
defines the scoreans_dict
is a dict (choice => score
), overwritesans
andscore
Filling Question
type = "fill"
means inserting a filling question
content is in key
content
, supports Markdownans
defines answerans_regex
defines regex for judging, overwritesans
score
defines 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-end
block after every groupch_type
provides default type for parts in the group withouttype
key
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.