Basic Syntax
This page describe the basic syntax of KARAS.
About Level
KARAS has a concept called Level. For example, in KARAS, you can output the heading elements <h1>
with write a =
mark at the beginning of a line. And when you write two marks like ==
, it outputs <h2>
. In KARAS, units of output result change is defined as Level.
Heading and Hr
When write a =
at the beginning of the line, it outputs heading. The maximum level is 6. Output level of heading is decreased when the syntax level is up. Text written after the ::
becomes ID.
When write seven or more =
at the beginning of the line, it outputs horizontal line. Levels above 7, it always outputs a horizontal line. Then, text written after =
is not output.
List
Unordered List
When write a -
at the beginning of the line, it outputs unordered list. The maximum level is undefined. Output list is nested when the syntax level is up.
Ordered List
When write a +
at the beginning of the line, it outputs ordered list. The maximum level is undefined. Output list is nested when the syntax level is up.
To change the starting number of the list, write a ::
. List which included in the same group as the list that you specify the starting number gets continuous number until it is changed again.
Definition List
When write a ;
at the beginning of the line, it outputs definition list. The maximum level is 2. In level 1, outputs definition term. And in level 2, outputs definition description. You can add any number of definition term and the description.
Decoration and Meaning
Bold and Strong
Text closed with **
becomes bold text. The maximum level is 2. In level 1, text becomes bold text. In level 2, text gets a strong importance.
Italic and Emphasize
**Text closed with //
becomes italic text. The maximum level is 2. In level 1, text becomes italic text. In level 2, text gets a stress emphasis.
However, text which included in protocol like http:// or ftp:// is ignored.
Underline and Insert
Text closed with __
is outputted with underline. The maximum level is 2. In level 1, text is decorated with underline. In level 2, text becomes inserted text.
Strikeout and Delete
Text closed with %%
becomes strikeout text. The maximum level is 2. In level 1, text is decorated with strikeout-line. In level 2, text becomes deleted text.
Defitnition Term
Text closed with ??
becomes definition term. The maximum level is 2. In level 1, text becomes definition term. In level 2, text becomes abbreviated definition term.
Input(kbd) and Output(samp)
Text closed with $$
indicate user input or output. The maximum level is 2. In level 1, text indicate user input. In level 2, text indicate output. < and > marks included in marked up text whith this syntax are converted to character reference.
Variable and Code
Text closed with ``
indicate variable or code. The maximum level is 2. In level 1, text indicate variable. In level 2, text indicate code. < and > marks included in marked up text whith this syntax are converted to character reference.
Variable elements (level 1) can use for indicate formula or the other. Code elements (level 2) can use for indicate XML or file path.
Superscript and Ruby
Text closed with ''
becomes superscript text. The maximum level is 2. In level 1, text becomes superscript text. In level 2, text becomes ruby.
To write a ruby-text by using level 2 syntax, split each word and each ruby by option syntax ::
.
Subscript
Text closed with ,,
becomes subscript text. The maximum level is 1.
Quote and Cite
Cite
Text closed with @@
indicate title or cite. The maximum level is 2. In level 1, text indicate title or cite. In level 2, text indicate bylaws (like disclaimer or copyright).
Small(inline) Quote
Text closed with ""
indicate quoted text. The maximum level is 1.
Large(block) Quote
When write a >
at the beginning of the line, it outputs blockquote text. The maximum level is undefined. Output list is nested when the syntax level is up. When your quoted text include line-break, use this syntax.
Link
Text closed with ((
and ))
becomes link (anchor) text. The maximum level is 2. In level 1, text becomes default link text. In level 2, text becomes embedded media link.
To make a text link(called alias), write the text after the option syntax.
Text after option syntax ::
becomes link alias.
Output of the level 2 syntax depends on specified URL. When the file extension at bottom of the url shows image file, the output result becomes optimized format to show the image. It is same as audio, or video. When adding the parameter to these media, write the option text after option syntax ::
.
In default converter, text after option syntax ::
is added to the result as option with no changes. And, to the nested element such as obj, these text are added after converted to the optimized parameter. Option text is splitted and analyzed whether it is reserved or not.
When the URL shows image file.
When the URL shows video file.
When the URL shows audio file.
When the URL shows other type file. For example, FLASH (.swf) is one of sample.
Output format is depends on the system which introduce KARAS. This page shows the result of when using default onverter. If you need the exact information, please refer to the example of the conversion result provided by the system. Developers have to develop the system which is able to output the optimized result for the media, when using syntax level 2.
Table
When write a ||
at the beginning of the line, it outputs table. To output the next cell, write a ||
in the same line. Table row is controlled with line-break.
There is no need to align the ||
or space. However, When there are much cells, or number of the characters in each cells have much difference, you should align them to save the readability.
To output header, change the left mark of the cell syntax like this !|
.
To output left-aligned cell, change the right mark of the cell syntax like this |<
. To output right-aligned cell, like this |>
. To output center-aligned cell, like this |=
. And to output right-aligned header cell, like this !>
.
Default align of cell might be changed in your system or layout function like CSS.
To merge cells in a row, write only ::
in the cell. Cell which has ::
is merged to the left side cell. To merge cells in a column, write only :::
in the cell. Cell which has :::
is merged to the upper cell.
Others
< and > marks
In order to write < or > mark as non-syntax, you have to write the character reference like <
or >
.
Paragraph
When the text has no special mark at the beginning of the line, it becomes a paragraph. Special marks are = + - ; < >
and some combination (( || |> |< |= !| !> !< !=
.
Text becomes a one paragraph even if it has line-break. If there is some blank-line between texts, it becomes each paragraph.
When need a line-break in a paragraph, write a ~
before line-break. In order to write a blank-line in a paragraph, write only ~
in the line.
Commentout
Text closed with ##
is not outputted. The maximum level is 1.
Escape
Syntax of KARAS is able to invalidate by using escape mark \
. For example, when you want to write a paragraph which start with =
, write \=
.
Escape syntax ignores only one mark. And to write a escape mark \
, write two escape marks.