sections
in most cases, a section is just a few lines of text. you've probably already noticed that linebreaks are usually ignored or, more accurately, replaced with spaces.
sections beginning with a hashtag (
#
) are special. the first line specifies the type of section you want, and the other lines are the section's content. you've already seen this with
#!mharkup
in the first example.
the types of sections you can create like this are:
#@
quotes#!
code blocks#:
resource links#\
various extensions
in a section, you can use the backtick (`) to apply text formatting, or you can start a section with a backtick followed by a space to create a list. here's a list of things the backtick can do:
- create a list
- represent itself `:
``
- add a note:
`-[note]
- mark something that's
wrong: `~[wrong]
- include some
code.f()
: `![code.f()]
- mark a non-word or name, like mharkup: `@[mharkup]
- highlight a special element:
`_[special]
- add emphasis to something:
`+[something]
- highlight something important:
`*[important]
- insert raw `text`:
`{`text`}: `<`{`text`}>: `2{`<`{`text`}>}}: ... - link somewhere[here]
backticks
in a section, you can use the backtick (`) to apply text formatting, or you can start a section with a backtick followed by a space to create a list. here's a list of things the backtick can do:
- create a list
- represent itself `:
``
- add a note:
`-[note]
- mark something that's
wrong: `~[wrong]
- include some
code.f()
: `![code.f()]
- mark a non-word or name, like mharkup: `@[mharkup]
- highlight a special element:
`_[special]
- add emphasis to something:
`+[something]
- highlight something important:
`*[important]
- insert raw `text`:
`{`text`}: `<`{`text`}>: `2{`<`{`text`}>}}: ... - link somewhere[here]: `/here[somewhere]
- use an extension: `\spec{...} or `\spec<...>
- combine any of these: whoa
h: `*_+[whoa`~(h)]
: `/here[somewhere] - use an extension: `\spec{...} or `\spec<...>
- combine any of these: whoa
h: `*_+[whoa`~(h)]
you can also insert a subdocument by inserting a new title section. for example, the backticks subdocument starts with the following section:
mharkup
### backticks /here
and these sections are back in the outer document, at depth 2 instead of 3, because of an empty title section:
since sections are separated by an empty line, they don't usually contain empty lines themselves. however, they absolutely can, and for code blocks, you will definitely need it quite quickly.
in normal text, where newlines are usually removed, an empty line can be used to force a linebreak.
to add an empty line to a section, enclose it in at least one set of square brackets. for the following example, to be able to include the double brackets, the #!mharkup section is enclosed in 3 more sets of square brackets.
mharkup
[[
#@mark
and that's all,
i think...
]]
mark
and that's all,
i think...
the following subdocuments just show how to use the different section types in more detail.
quotes
mark
i've solved many problems that noone's ever had.
21st century
[ref]
resource links
A document you should read.
The first lines of these sections were
#:other_doc
and
#https://example.com/hello
. If the section starts with
#:
, the link is relative.
in this case, the first line of the section was
#@mark @21st century `/ref[]
.
code blocks
python
def do_something_productive():
pass
in this case, the first line of the section was
#!python
.
A document you should read.
The first lines of these sections were
#:other_doc
and
#https://example.com/hello
. If the section starts with
#:
, the link is relative.
extensions
mharkup
#\texm
\sum_{a=0}^{20} a^2
texm
$\sum_{a=0}^{20} a^2$
mharkup
or inline: `\texm<a^2> `2\texm{ \frac{1}{2} }}
or inline: $a^2$ or $ \frac{1}{2} $
mharkup
#\html
<marquee scrollamount="1">deprecated, but funny</marquee>
html