Test of Markdown input syntax in DocOnce

DocOnce can recognize basic Markdown as input in the .do.txt file and transform such text to native DocOnce.

(hpl 1: This is a special comment on text that is rendered by extended Markdown versions.)

(comment 2: This is another version of the special comment on text; this one without any author name and colon in the beginning.)

Table of contents

Test of Markdown input syntax in DocOnce
      Test of inline formatting
Typesetting of computer code
Test of quoted sections
Test of lists
Test of tables
Test of mathematics

Test of inline formatting

Markdown has boldface and emphasize typesetting, as well as inline verbatim computer code.

Paragraph headings. These are written using standard Markdown boldface syntax.

Subsubsection heading

The Markdown headings can only be of three types: section, subsection, and subsubsection.

Typesetting of computer code

Here is a plain code snippet without language specification:

file=$1
if [ -f $file ]; then
  cp $file $file.cop
fi
# This is Bash - what happens to this comment?

The same snippet typeset explicitly as Bash, but with a common indentation to be removed:

file=$1
if [ -f $file ]; then
  cp $file $file.cop
fi
# This is Bash - what happens to this comment?

And here is Python:

from math import sin

def f(x):
    return x*sin(x)

x = 1.4
print(f(x))

And HTML:

<h1>Some heading</h1>
# And a comment

Test of quoted sections

Markdown also features quoted paragraphs that start with a greater than sign, either just in the beginning or at every line.

If a quoted paragraph with blank lines is desired, you must use > on the beginning of every line.

NOTE:

This quoted paragragraph is a simulation of a primitive admon in Markdown.

Test of lists

Markdown applies the dash in itemized lists:

Let us test this in a quoted environment too:

List:

Enumerated lists go as follows.

  1. Item 1
  2. Item 2
  3. Item 3

Test of tables

Markdown Extra has a special syntax for tables:

Item Value Qty
Computer 1600 USD 5
Phone 12 USD 12
Pipe 1 USD 234


Test of mathematics

You can render LaTeX mathematical expressions using MathJax, as on math.stackexchange.com:

The Gamma function satisfying \( \Gamma(n) = (n-1)!\quad\forall n\in\mathbb N \) is via the Euler integral

$$ \Gamma(z) = \int_0^\infty t^{z-1}e^{-t}dt\,. $$