Skip to content

Civilizer Custom Markup Commands

Suewon Bahng edited this page Oct 10, 2017 · 19 revisions

Civilizer Custom Markup Commands provide some extended functionalities that Markdown doesn't support.

βœ”οΈ Basic Syntax

The syntax is either of the following.

  • {{[ command name ] target text ... }}
  • {{{[ command name ] target text ... }}}

Text inside [ ] denotes name of the command and the command will apply to any content inside double (or triple) curly braces.


βœ”οΈ Colorizing Commands

Colorizing menu
Figure 1. Text Colorizing Menu

  • These commands can be used to colorize any text inside it.
  • In Fragment Editor, when you hover on the toolbar menu located on the far right, a colorful drop down menu will appear.
    • Just clicking one of them is equivalent to manually typing a corresponding command (illustrated below).
  • Currently, each command is:
    • {{[clr-c] ... }} Cyan color
    • {{[clr-b] ... }} Blue color
    • {{[clr-r] ... }} Red color
    • {{[clr-g] ... }} Green color
    • {{[clr-y] ... }} Yellow color
    • {{[clr-m] ... }} Magenta color
    • {{[clr-v] ... }} Violet color
    • {{[clr-br] ... }} Brown color

βœ”οΈ Line Styling Commands

  • Strike-through
    • {{[st] ... }}
  • Underline and Bold
    • {{[usb] ... }}

βœ”οΈ Linking Commands

  • Link to a Fragment
    • {{[frgm] Fragment-ID ... }}
    • This command also can be inserted via the toolbar menu in the Fragment Editor.
  • Link to a Tag
    • {{[tag] Tag-ID ... }}
    • Manually typing this command doesn't make sense.
    • You should use a dedicated Drag & Drop functionality to insert the command.
  • Link to a File
    • {{[file] File-ID ... }}
    • Manually typing this command doesn't make sense.
    • You should use a dedicated Drag & Drop functionality to insert the command.

βœ”οΈ Embedding Commands

  • {{[frgm-embed]Fragment-ID}}
    • This command embeds the content of the Fragment denoted by the ID.
    • Currently, no UI is provided for the command.
      • You need to manually type this command if you want to use it. e.g) {{[frgm-embed]1234}}
    • Don't embed a Fragment into the same Fragment (recursively)!!!
      • The resulting behavior is undefined but possibly will crash your browser or make it not responding.

βœ”οΈ Inline HTML Commands

  • Markdown basically accepts any HTML tags, however, Civilizer is blocking this feature for security reasons.
  • Civilizer provides Inline HTML Commands as follows and they will let the browser interpret HTML code inside them.
    • For inserting inline element (such as <span>) HTMLs (double curly braces) : {{[html] ... HTML ... }}
    • For inserting block element (such as <div>) HTMLs (triple curly braces) : {{{[html] ... HTML ... }}}
  • Alternatively, select your target HTML code and click the corresponding toolbar menu in the Fragment Editor.

NOTE
Sometimes ill-formed HTML code (such as with inconsistent opening and closing tags) might get your browser render very ugly page layout (or nothing at all) so please, be careful.
When you copy and paste some external source's HTML code inside Inline HTML Commands, review the HTML very carefully and remove any Javascript code from the HTML.
Also note that Civilizer will silently ignore any of the following HTML tags even they are placed inside Inline HTML Commands.

  • <html>, <head>, <body>, <link>, <script>

βœ”οΈ How to input LITERAL CURLY BRACES (since 0.9.0.RC5)

  • As you see, double or triple curly braces have a significant role for Custom Markup Commands. This will be a problem when you want to insert literal double or triple curly braces.
  • Say, you want to insert {{ hello }} literally.
    • One option is, just be patient with single braces like { hello }. :-)
    • If you insist on using double braces, then just type &#125;&#125; for double closing curly braces. ( &#125;&#125;&#125; for triple closing curly braces. )
    • Type open curly braces as they are.
    • So, to insert {{ hello }}, you need to type {{ hello &#125;&#125;
Clone this wiki locally