Skip to content

Specification

Clite Tailor edited this page Jan 5, 2019 · 1 revision

Syntax Rules

To make editing simple, PostText design consists of two syntax styles:

  • Block style
  • Inline style

Block style

=== blockName ( _param1, param2 ) [ option1; option2 ]

blockContent goes here!

For example:

== paragraph

Lorem ipsum dolor sit amet, consectetur adipiscing elit.
= columns(2)
== column
First column

== column
Second column
== verbatim[lang=javascript]

var x = 1

function add(a, b) {
  return a + b
}

Inline style

\blockName ( param1, param2 ) [ option1; option2 ] { blockContent1 } { blockContent2 }

For example:

Make this text \bold{bold}!
\math{
  E = \hat{mc}{2}
  
  x = \matrix(2, 3) {
    1  2  3
    3  5  6
  }
}
The following word is colored red: \text[color=red] { tomato }

Examples

Text Format

=== paragraph

\bold{bold text} \italic{italic text} \highlight{highlight text}

\bold{ \italic{bold-italic text} }
\bold-italic{bold-italic text}

Table

=== table[format=csv]

Country, Population
Pakistan, 204.596.442
Nigeria, 200.962.417
Bangladesh, 168.065.920
Russia, 143.895.551
=== table[align=c|l]

\head{Country}{Population}
\row{Pakistan}{204.596.442}
\row{Nigeria}{200.962.417}
\row{Bangladesh}{168.065.920}
\row{Russia}{143.895.551}

Image

\image[link=http://example.com/image.png; alt=Wallpaper]
=== image[link=http://example.com/image.png]
=== image[format=base16]
data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
    9TXL0Y4OHwAAAABJRU5ErkJggg==

Chart

=== pie-chart

label    percentage  color
--------------------------
tomato   30%         red
potato   20%         yellow
orange   \rest       orange

Layout

== grid(2, 2)
=== section
\title{Top Left}

=== section
\title{Top Right}

=== section
\title{Botom Left}

=== section
\title{Bottom Right}

Example Article

\package{preset-env}
\theme{monokai}

== paragraph

\center{title{PostText Specification}}

\substitle{Introduction}

\keyword{PostText} is a markup language and text preprocessor based on Latex. Its aim is to overcome the limitation in Markdown syntax but still keep the readability. The final target is to provide the user with a powerful content editing format without the need of any advanced \keyword{WYSIWYG editor}.

\subtitle{Features}

\subsubtitle{Math Equation}

== math

E = \hat{mc}{2}

\bold{Golden ratio} = \frac{a + b}{a} = \frac{a}{b}

A = \matrix(2, 3) {
  1  2  3
  5  6  9
}
Clone this wiki locally