# Project page
- https://github.com/r-lyeh/stddoc.c
# About
- _stddoc.c_ is a tiny documentation generator for 60 programming languages.
- This page sample was auto-generated from the code comments found in `stddoc.c` file.
# How does it work?
- Markdeep code comments are extracted from stdin and printed into stdout as a HTML file.
# Usage
- `stddoc < source.code > documentation.html`
- `type source*.code | stddoc`
# Changelog
- 2020.1 (*v1.0.2*): Fix showcase example bein incorrectly rendered with latest markdeep.
- 2018.1 (*v1.0.1*): CSS overflow fixes, `///m""arkdeepOptions={tocStyle:'long'};");
fprintf(out, "%s\n", "");
}
~~~
# **Markdeep Feature Demo**
Morgan McGuire
This demonstration documents the features of
[Markdeep](http://casual-effects.com/markdeep) and acts as a test for
it. Markdeep is a text formatting syntax that extends Markdown, and a
Javascript program for making it work in browsers. The two most
powerful features are its ability to run in any **web browser** on the
client side and the inclusion of **diagrams**.
[Click here](https://casual-effects.com/markdeep/features.md.html?noformat)
to see this document without automatic formatting.
Markdeep is free and easy to use. It doesn't need a plugin, or
Internet connection. There's nothing to install. Just start
writing in Vi, Nodepad, Zed, Emacs, Visual Studio, Atom, or another
editor! You don't have to export, compile, or otherwise process
your document.
If you want to support development of Markdeep, just buy my
[Graphics Codex](http://graphicscodex.com) book for $10 on Amazon. Revenue from that funds my
open source projects.
Basic Formatting
=======================================================================================
Text formatting:
Source | Result
-----------------------------------------|------------------------------
`**bold**` | **bold**
`__bold__` | __bold__
`*italic*` | *italic*
`_italic_` | _italic_
`~~strikethrough~~` | ~~strikethrough~~
`inline code`
| `inline code`
`5 kg/m^3` | 5 kg/m^3
You can add CSS to change the styles. See the Custom Formatting section
for some examples.
Formatted text may **cross
lines** and be as small as **a** single character. It can _also
be indented and
split across lines_ simultaneously.
Markdeep intelligently does not apply bold or italic formatting to
math expressions such as x = 3 * y - 2 * z or WORDS_WITH_INTERNAL_UNDERSCORES.
It also protects HTML `
long caption](https://casual-effects.com/markdeep/robot.jpg width=100)
Video file extensions are automatically detected and will embed a small video
player:
![A video](https://casual-effects.com/markdeep/rocket.mp4)
URLs for Youtube and Vimeo videos will also automatically embed a video player:
![State Zero](https://www.youtube.com/watch?v=QgPMyvZMBY0)
![Figure [fig:boy]: The Boy with a Camera For a Face](https://vimeo.com/channels/staffpicks/151493973)
URLs for images may be surrounded in optional `"` quotation `"` marks. If your URL contains
parentheses, then it _must_ be surrounded in quotation marks to make it unambigious.
Recall that URLs are not permitted to contain spaces (by their specification), so to embed
a local image whose filename has a space, either rename the file or replace the spaces
with `%20` in the URL version of the name.
Symbol Substitutions
------------------------------------------------------------------------------
Markdeep converts `<->`, `<==>`, `->`, `-->`, `<-`, `<--`, `==>`, and `<==` to arrows if they
aren't in a code block or latex expression and are surrounded by whitespace. Examples:
- if this ==> then that
- here <== there
- this <==> that
- A <- B
- X -> Y
- back <-> forth
- long --> way
- back <-- there
Two or three minus signs are converted to an em dash--like that.
An "x" between numbers, such as 1920x1080 or 3 x 4, will be converted to the times
symbol.
Negative numbers, such as -5 and minus signs between numbers such as
2 - 1, will have a minus sign instead of a hyphen.
Degrees are reformatted to the degree symbol:
- Cold, 37-degree F water.
- A 45-degree angle.
- A right angle's measure is 90 degrees.
It doesn't reformat the word "degree" when not following digits:
- Don't give me the third degree!
- I have two degrees from MIT.
"Smart quotes" are applied for double-quote marks based on position
relative to whitespace:
"a" b c
a "b" c
a b "c"
a "b!" c
a "b," c
a "b". C
a, "b" c
a---"b"---c
a ("b") c
"error" ==> "correction"
Inch or minute markers such as 3' 9" are not converted. Quotation
marks in HTML attributes and
in code blocks, e.g., `var x = "hello world"`, are not converted.
Admonitions
-----------------------------------------------------------------------------
Admonitions are small break-out boxes with notes, tips, warnings, etc. for the reader. They
begin with a title line of a pattern of three exclaimation marks, an optional CSS class, and an
optional title. All following lines that are indented at least three spaces are included in the
body, which may include multiple paragraphs.
The default stylesheet provides classes for "note" (default), "tip", "warning", and "error".
These are case insensitive and ignore any colon after the CSS class. Here are some examples:
````````````````````````````````````````````````````````````` none
!!!
I'm a note. Don't mind me, I'm just sitting here.
!!! note
Another note.
!!! Tip
Close the door on the way out.
!!! WARNING
I'm a warning, perhaps. *Something might happen!*
!!! ERROR: Seriously
Watch out, something **bad** could happen.
This is still more error text.
`````````````````````````````````````````````````````````````
!!!
I'm a note. Don't mind me, I'm just sitting here.
!!! note
Another note.
!!! Tip
Close the door on the way out.
!!! WARNING
I'm a warning, perhaps. *Something might happen!*
!!! ERROR: Seriously
Watch out, something **bad** could happen.
This is still more error text.
Fenced Code Blocks
------------------------------------------------------------------------------
Set off large blocks of code using equal-length strings of tilde `~`
or back-tick `
characters. Each produces a different CSS
class so that they can be styled differently.
By default, tilde blocks have lines before and after them and are
inset for use as code listings instead of large inline code
blocks. Both styles receive syntax coloring and automatic programming
language detection.
You can override automatic programming language detection by putting
the name of the language immediately following the first fence. You can
specify a custom CSS class for a code block by placing its name after the
language name.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C
void insertion_sort(int data[], int length) {
for (int i = 0; i < length; ++i) {
...
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Alternative back-tick markup:
````````````````````````````````````
def insertionSort(data):
for i in range(0, len(data)):
j = i;
while (j > 0) and (data[j] < data[j - 1]):
temp = data[j]
data[j] = data[j - 1]
data[j] = temp
--j
````````````````````````````````````
### HTML and LaTeX Blocks
You can even have HTML in a code block:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Show this HTML as source,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C
void insertion_sort(int data[], int length) {
for (int i = 0; i < length; ++i) {
...
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
not code
.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LaTeX and other languages that use dollar signs work fine inside code
fences:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
$ \int_0^1 x^2 dx $
$$$a = $$$e
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...and of course, Markdeep inside Markdeep:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Do not
- Format
- this as a **list**!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Code Blocks with Captions
Code listings may have captions:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python
def insertionSort(data):
for i in range(0, len(data)):
j = i;
while (j > 0) and (data[j] < data[j - 1]):
temp = data[j]
data[j] = data[j - 1]
data[j] = temp
--j
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Listing [sort]: An insertion sort]
If you don't have a lot of exposition to share, then code blocks can be back to back:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf("Hello\n");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
printf("World\n");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Multi-code Blocks and Custom CSS
You can interlace different languages or CSS classes within a single code block, but each is required
to specify the language in this case. This is convenient for highighting lines or showing the
trace of an interactive session.
An example of a fenced code block with a CSS class:
And its result:
~~~~~~~~~~~~~~ Python input
>>> x = [1, 2, 3, 4]
>>> [y * 2 for y in x]
~~~~~~~~~~~~~~ none output
[2, 4, 6, 8]
~~~~~~~~~~~~~~ Python input
>>> x + [5]
~~~~~~~~~~~~~~ none output
[1, 2, 3, 4, 5]
~~~~~~~~~~~~~~
[This listing combines multiple code blocks to show the input and output of an interactive section.]
### Less-than Signs in Code ###
#### Summary ####
If you have trouble with less-than signs right next to capitalized
letters in code blocks, do _one_ of the following:
- Put spaces after angle brackets: `std::vector< Capitalized >`
- Use HTML entity escapes: `std::vector<Capitalized>`
- Wrap code examples in `<script type="preformatted">...</script>`
- Wrap your whole document in `<script type="preformatted">...</script>`
You don't need to do this for legal HTML or XML in code blocks.
#### Details ####
Less-than and greater-than signs are allowed in code blocks
(as well as anywhere else in Markdeep), and will be handled
correctly if they are followed by a whitespace character.
Likewise, legal HTML and XML are correctly processed as code
when in code blocks.
However, because browsers interpret "`<`" _immediately followed by_
a character as an HTML tag, less-than signs without a following space
must be formatted more carefully in shell scripts and languages such
as C++ and Java.
If the character following the less-than sign is lower-case, for
example in: "`std::vector<int>`", then no consideration is
needed. If the character following less-than is a capital letter, then
the browser will automatically make it lower case. If the following
character is a slash, then the browser will interpret it as a stray
tag and automatically remove it.
If you care most about being able to read your document in a browser
when the markdeep.js script is not available (due to no local copy and
no Internet connection), then either use surrounding whitespace or
use HTML entity codes to avoid incorrect processing of less-than signs.
**Reformatted Examples:**
~~~~~~~~~~~~~~~~~~~~
#include <foo.h>
ls < /dev/null
ls</dev/null
std::vector< Capitalized > array;
std::vector<Capitalized> array;
~~~~~~~~~~~~~~~~~~~~
If care more about not having to reformat your code examples, then
just include them in preformatted `<script>` blocks:
**Script Block Examples:**
You can also include your entire document in a preformatted script
block to avoid the need for marking up each code (and inline code)
example.
Diagrams
--------------------------------------------------------------------------------
Diagrams can be inserted alongside, as in this ****************************
example, or between paragraphs of text as shown * .---------. *
below. * | Server |<------. *
* '----+----' | *
The diagram parser leaves symbols used as labels * | | *
unmodified, so characters like > and ( can appear * | DATA CYCLE | *
inside of the diagram. In fact, any plain text * v | *
may appear in the diagram. In addition to labels, * .-------. .----+----. *
any un-beautified text will remain in place for * | Security| | File | *
use as ASCII art. Thus, the diagram is rarely * | Policy +->| Manager | *
distored by the beautification process. * '-------' '---------' *
****************************
*************************************************************************************************
*.-------------------. ^ .---. *
*| A Box |__.--.__ __.--> | | | *
*| | '--' v | | *
*'-------------------' | | *
* Round *---(-. | *
* .-----------------. .-------. .----------. .-------. | | | *
* | Mixed Rounded | | | / Diagonals \ | | | | | | *
* | & Square Corners | '--. .--' / \ |---+---| '-)-' .--------. *
* '--+------------+-' .--. | '-------+--------' | | | | / Search / *
* | | | | '---. | '-------' | '-+------' *
* |<---------->| | | | v Interior | ^ *
* ' <---' '----' .-----------. ---. .--- v | *
* .------------------. Diag line | .-------. +---. \ / . | *
* | if (a > b) +---. .--->| | | | | Curved line \ / / \ | *
* | obj->fcn() | \ / | '-------' |<--' + / \ | *
* '------------------' '--' '--+--------' .--. .--. | .-. +Done?+-' *
* .---+-----. | ^ |\ | | /| .--+ | | \ / *
* | | | Join | | Curved | \| |/ | | \ | \ / *
* | | +----> | '-' Vertical '--' '--' '-- '--' + .---. *
* '---+-----' | | | 3 | *
* v not:line 'quotes' .-' '---' *
* .---+--------. / A || B *bold* | ^ *
* | Not a dot | <---+---<-- A dash--is not a line v | *
* '---------+--' / Nor/is this. --- *
*************************************************************************************************
[Figure [diagram]: Diagrams can also have captions]
Code with line-like symbols is allowed in diagrams and is parsed correctly so
long as you make it unambiguous:
**********************************************
* .-------------------------+--+--------.
* | --x; x->y |__| |
* | 0 __proto__ __FILE__ <= |
* | __ a | b --> foo |
* | |__| y--; x || y a + b <--o--+
* |__|__|_______________________________|
**********************************************
Here's a diagram on the left of some text:
************** _Song of Myself: 35_
* | | *
* --+<---+-- * Would you hear of an old-time sea-fight? ~~~~~~~~~~~~~~ Python input
>>> x = [1, 2, 3, 4]
>>> [y * 2 for y in x]
~~~~~~~~~~~~~~ none output
[2, 4, 6, 8]
~~~~~~~~~~~~~~ Python input
>>> x + [5]
~~~~~~~~~~~~~~ none output
[1, 2, 3, 4, 5]
~~~~~~~~~~~~~
[This listing combines multiple code blocks to show the input and output of an interactive section.]
* | ^ * Would you learn who won by the light of the moon and stars?
* v | * List to the yarn, as my grandmother's father the sailor told it to me.
* --+--->+-- *
* | | * Walt Whitman
**************
If there is no leading text on the left except for whitespace, a diagram may omit the asterisks on the
right side for convenience:
****************************************
* .----.
* | |
* '----' .------------>
* |
* '-------------
****************************************
Diagram Examples
================================================================================
Lines with Decorations
--------------------------------------------------------------------------------
*************************************************************************************************
* ________ o * * .--------------. *
* *---+--. | | o o | ^ \ / | .----------. | *
* | | '--* -+- | | v / \ / | | <------. | | *
* | '-----> .---(---' --->*<--- / .+->*<--o----' | | | | | *
* <--' ^ ^ | | | | | ^ \ | '--------' | | *
* \/ *-----' o |<----->| '-----' |__| v '------------' | *
* /\ *---------------' *
*************************************************************************************************
Graph with Large Nodes
--------------------------------------------------------------------------------
*************************************************************************************************
* *
* .---. .-. .-. .-. .-. *
* | A +----->| 1 +<---->| 2 |<----+ 4 +------------------. | 8 | *
* '---' '-' '+' '-' | '-' *
* | ^ | ^ *
* v | v | *
* .-. .-+-. .-. .-+-. .-. .+. .---. *
* | 3 +---->| B |<----->| 5 +---->| C +---->| 6 +---->| 7 |<---->| D | *
* '-' '---' '-' '---' '-' '-' '---' *
*************************************************************************************************
Graph with Small Nodes
--------------------------------------------------------------------------------
*************************************************************************************************
* A 1 2 4 8 *
* *----->o<---->o<----o-----------. o *
* ^ ^ | ^ *
* | | | | *
* v | v | *
* o<--->*<---->o---->*---->o---->o<---->* *
* 3 B 5 C 6 7 D *
*************************************************************************************************
Flow Chart
--------------------------------------------------------------------------------
*************************************************************************************************
* . *
* .---------. / \ *
* | START | / \ .-+-------+-. ___________ *
* '----+----' .-------. A / \ B | |COMPLEX| | / \ .-. *
* | | END |<-----+CHOICE +----->| | | +--->+ PREPARATION +--->| X | *
* v '-------' \ / | |PROCESS| | \___________/ '-' *
* .---------. \ / '-+---+---+-' *
* / INPUT / \ / *
* '-----+---' ' *
* | ^ *
* v | *
* .-----------. .-----+-----. .-. *
* | PROCESS +---------------->| PROCESS |<------+ X | *
* '-----------' '-----------' '-' *
*************************************************************************************************
Line Ends
--------------------------------------------------------------------------------
*************************************************************************************************
* *
* o--o *--o / / * o o o o o * * * * o o o o * * * * o o o o * * * * *
* o--* *--* v v ^ ^ | | | | | | | | \ \ \ \ \ \ \ \ / / / / / / / / *
* o--> *--> * o / / o * v ' o * v ' o * v \ o * v \ o * v / o * v / *
* o--- *--- *
* ^ ^ ^ ^ . . . . ^ ^ ^ ^ \ \ \ \ ^ ^ ^ ^ / / / / *
* | | * o \ \ * o | | | | | | | | \ \ \ \ \ \ \ \ / / / / / / / / *
* v v ^ ^ v v ^ ^ o * v ' o * v ' o * v \ o * v \ o * v / o * v / *
* * o | | * o \ \ *
* *
* <--o <--* <--> <--- ---o ---* ---> ---- *<-- o<-- -->o -->* *
* *
*************************************************************************************************
Tests for some tough cases:
************************************************
* +-+ \ \ | / / *
* + + \ v v v / *
* +-+ \ .---------. / \ | / *
* v| |v vvv *
* +-+ --->| |<--- -->o<-- *
* | | ^| |^ ^^^ *
* +-+ / '---------' \ / | \ *
* / ^ ^ ^ \ *
* / / | \ \ *
************************************************
Trees
--------------------------------------------------------------------------------
*************************************************************************************************
* *
* . . . .--- 1 .-- 1 / 1 *
* / \ | | .---+ .-+ + *
* / \ .---+---. .--+--. | '--- 2 | '-- 2 / \ 2 *
* + + | | | | ---+ ---+ + *
* / \ / \ .-+-. .-+-. .+. .+. | .--- 3 | .-- 3 \ / 3 *
* / \ / \ | | | | | | | | '---+ '-+ + *
* 1 2 3 4 1 2 3 4 1 2 3 4 '--- 4 '-- 4 \ 4 *
* *
*************************************************************************************************
Circuits
--------------------------------------------------------------------------------
*************************************************************************************************
* ____ * *
* | |_____.---. | *
* o _____| )----------)-------. *
* / \ | '---' | __|__ *
* /___\ | | \ / *
* | '-------------. | \ / *
* A ----------------' | | o *
* .-------------------. o-----)-------' | *
* | |___.---. | |___.---. *
* B ---*---.__.---. ___| )--*--.__..---. ____) )----- Y *
* __| o----*--' '---' ______)) )---' '---' *
* C -------' '---' | | ''---' *
* | o *
* | / \ *
* | /___\ *
* | | *
* '--------------' *
*************************************************************************************************
Gantt Chart
--------------------------------------------------------------------------------
*************************************************************************************************
* ║ Preproduction┆ Alpha┆ RC1┆
* ═══════════╬══════════════╪════════════╪════════════════╪══
* Story ║ ▆▆▆▆▆▆▆▆ ┆ ▆┆▆▆▆ ┆
* Concept Art║ └▆▆▆▆▆▆┆▆▆▆┐ ┆ ┆
* Modeling ║ ┆ └▆▆▆▆▆▆▆▆┆▆▆▆▆▆▆▆ ┆
* Rigging ║ ┆ └▆▆▆┆▆▆▆▆▆▆▆▆▆▆▆▆ ┆
* Mechanics ║ ▆▆▆▆▆▆┆▆▆┐ ┆ ░░░░▆▆▆▆ ┆
* Engine Code║ ▆▆▆▆▆▆▆┐ │ ┆ └────────▆┆▆▆▆▆▆▆▆▆▆▆▆▆▆ ┆
* Game Code ║ └─┴▆┆▆▆▆▆▆▆▆▆▆▆▆▆┆▆▆▆▆ ░░░░ ▆ ┆
* ║ ┆ ┆ Freeze ┆
*************************************************************************************************
Big Shapes
--------------------------------------------------------------------------------
*************************************************************************************************
* *
* .---------. . .-------. .-------. .---------. .-----. .----. *
* \ / / \ \ \ | | | | / \ / \ *
* \ / / \ \ \ | | | | / \ | | *
* \ / / \ \ \ | | | | \ / | | *
* \ / / \ \ \ | | | | \ / \ / *
* ' '---------' '-------' '-------' '---------' '-----' '----' *
* *
*************************************************************************************************
Small Shapes
--------------------------------------------------------------------------------
*************************************************************************************************
* .---. __ .. *
* .--. . .-----. \ / .---. .---. ___ ___ | | | ) *
* / \ / \ \ / .-. . ' . | | .---. .---. | | / \ | | '--' '' *
* \ / / \ \ / | | / \ / \ '---' / / \ \ | | \___/ |___| .. __ *
* '--' '-----' ' '-' '---' /___\ '---' '---' '---' ( | |__| *
* '' *
*************************************************************************************************
Overlaps and Intersections
--------------------------------------------------------------------------------
*************************************************************************************************
* *
* .-. .-. .-. .-. .-. .-. *
* | | | | | | | | | | | | *
* .---------. .--+---+--. .--+---+--. .--| |--. .--+ +--. .------|--. *
* | | | | | | | | | | | | | | | | | | *
* '---------' '--+---+--' '--+---+--' '--| |--' '--+ +--' '--|------' *
* | | | | | | | | | | | | *
* '-' '-' '-' '-' '-' '-' *
*************************************************************************************************
Big Grids
--------------------------------------------------------------------------------
*************************************************************************************************
* .----. .----. *
* / \ / \ .-----+-----+-----. *
* + +----+ +----. | | | | .-----+-----+-----+-----+ *
* \ / \ / \ | | | | / / / / / *
* +----+ B +----+ + +-----+-----+-----+ +-----+-----+-----+-----+ *
* / \ / \ / | | | | / / / / / *
* + A +----+ +----+ | | B | | +-----+-----+-----+-----+ *
* \ / \ / \ +-----+-----+-----+ / / A / B / / *
* '----+ +----+ + | | | | +-----+-----+-----+-----+ *
* \ / \ / | A | | | / / / / / *
* '----' '----' '-----+-----+-----' '-----+-----+-----+-----+ *
* *
*************************************************************************************************
Small Grids
--------------------------------------------------------------------------------
*************************************************************************************************
* ___ ___ .---+---+---+---+---. .---+---+---+---. .---. .---. *
* ___/ \___/ \ | | | | | | / \ / \ / \ / \ / | +---+ | *
* / \___/ \___/ +---+---+---+---+---+ +---+---+---+---+ +---+ +---+ *
* \___/ b \___/ \ | | | b | | | \ / \a/ \b/ \ / \ | +---+ | *
* / a \___/ \___/ +---+---+---+---+---+ +---+---+---+---+ +---+ b +---+ *
* \___/ \___/ \ | | a | | | | / \ / \ / \ / \ / | a +---+ | *
* \___/ \___/ '---+---+---+---+---' '---+---+---+---' '---' '---' *
* *
*************************************************************************************************
Tiny Grids
--------------------------------------------------------------------------------
*************************************************************************************************
* ┌─┬─┬─┬─┬─┐ ▉▉ ▉▉ ▉▉ ⬢ ⬡ ⬡ ┌┬┬┬┬┬┬┬┬┐ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ ___________ +-+-+-+-+ *
* ├─┼─┼─┼─┼─┤ ▉▉ ▉▉ ⬢ ⬢ ⬡ ⬡ ├┼┼┼┼┼┼┼┼┤ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ *
* ├─┼─┼─┼─┼─┤ ▉▉ ▉▉ ▉▉ ⬢ ⬢ ⬢ ⬡ ⬡ ├┼┼┼┼┼┼┼┼┤ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ *
* ├─┼─┼─┼─┼─┤ ▉▉ ▉▉ ⬡ ⬡ ⬡ ⬡ ├┼┼┼┼┼┼┼┼┤ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ *
* └─┴─┴─┴─┴─┘ ▉▉ ▉▉ ▉▉ ⬡ ⬡ ⬡ └┴┴┴┴┴┴┴┴┘ ⁚⁚⁚⁚⁚⁚⁚⁚⁚⁚ |__|__|__|__| +-+-+-+-+ *
*************************************************************************************************
Dot Grids
--------------------------------------------------------------------------------
*************************************************************************************************
* *
* o o o o o * * * * * * * o o * o o o * * * o o o · * · · · · · · *
* o o o o o * * * * * o o o o * o o o o * * * * * o * * · * * · · · · · · *
* o o o o o * * * * * o * o o o o o o o o * * * * * o o o o o · o · · o · · * * · *
* o o o o o * * * * * o * o o o o o o o * * * * o * o o · · · · o · · * · *
* o o o o o * * * * * * * * * o o o o * * * o * o · · · · · · · * *
* *
*************************************************************************************************
Unicode in Diagram
--------------------------------------------------------------------------------
************************************************************************************************
* ↖ ↗ ✶ ✹ ✩ ⓵ ⎲ ░░▒▒▓▓▉▉ ▚▚ ▢ ▢ ⬚ ⬚ ⊕
* ▲ ◀━━━━━━━▶ ↙ ↘ ➊ ❶ ➀ ① ➕ ➖ ➗ ❌ ⎳ ╲ ╱ ▚▚ ▢ ▢ ⬚ ⬚
*
* ┃ ╭╌╌╌╌╌╌╌╮ ╔═══════╗ ┏━━━━━━━┓ ┏╍╍╍╍╍╍╍┓ ╲ ╱ ░░▒▒▓▓▉▉ ▚▚ ⬣ ⬣ ⎔ ⎔ ⊗
* ┃ ╎ ╎ ║ ║ ┃ ┃ ╏ ╏ ⎛ ⎧ ⎡ ╳ ░░▒▒▓▓▉▉ ▚▚ ⬣ ⬣ ⎔ ⎔ ⊘
* ┃ ╎ ╎ ║ ║ ┃ ┃ ╏ ╏⋮ ⎜ ⎨ ⎢ ╱ ╲ ░░▒▒▓▓▉▉ ▚▚ ◯ ◯ ⏣ ⏣ ⊙
* ▼ ╰╌╌╌╌╌╌╌╯ ╚═══════╝ ┗━━━━━━━┛ ⋱ ┗╍╍╍╍╍╍╍┛⋮ ⎝ ⎩ ⎣╱ ╲ ░░▒▒▓▓▉▉ ▚▚ ◯ ◯ ⏣ ⏣ ⊛
* ⋱ ⋮ ◢▉▉◣ ⊜
* ∑xᵢ 𝚺xᵢ ∫t²dt ⋱ ⋮ ◥▉▉◤
************************************************************************************************
Graphics Diagram
-------------------------------------------------------------------------------
*************************************************************************************************
* . *
* 0 3 P * Eye / ^ / *
* *-------* +y \ +) \ / Reflection *
* 1 /| 2 /| ^ \ \ \ v *
* *-------* | | v0 \ v3 --------*-------- *
* | |4 | |7 | ◄╮ *----\-----* *
* | *-----|-* ⤹ +-----> +x / v X \ .-.<-------- o *
* |/ |/ / ⤴ / o \ | / | Refraction / \ *
* *-------* v / \ +-' / \ *
* 5 6 +z v1 *------------------* v2 | o-----o *
* v *
*************************************************************************************************
Annotated Table Diagram
--------------------------------------------------------------------------------
**********************************************
* ┏━━━━┳━━━━┳ ┳━━━━┓
* ┃ A₁ ┃ A₂ ┃ ⋯ ┃ Aⱼ ┃ <--- Basis
* ┡━━━━╇━━━━╇ ╇━━━━┩
* │ 16 │ 4 │ ⋯ │ 9 │
* ⎧ ├────┼────┼ ┼────┤
* │ │ 1 │ -2 │ ⋯ │ 10 │
* Xᵢ ⎨ ├────┼────┼ ┼────┤
* │ │ 8 │ 52 │ ⋯ │ 0 │
* ⎩ ├────┼────┼ ┼────┤
* │ 14 │ 0 │ ⋯ │ -1 │
* └────┴────┴ ┴────┘
**********************************************
Icon Diagram
--------------------------------------------------------------------------------
*************************************************************************************************
* .-. .--------. *
* .-+ | | | *
* .--+ '--. |'--------'| *
* | Server Cloud |<------------------>| Database | *
* '-------------' | | *
* ^ ^ '--------' *
* Internet | | ^ *
* .------------------------' '-------------. | *
* | | v *
* v v .------. .------. *
* .--------. WiFi .--------. Bluetooth .-----. / # # /| / # # /| *
* | |<------------->| |<---------->| | +------+/| LAN +------+/| *
* |Windows | | OS X | | iOS | | +/|<--->| +/| *
* +--------+ +--------+ | | |Ubuntu+/| |Ubuntu+/| *
* /// ____ \\\ /// ____ \\\ | o | | +/ | +/ *
* '------------' '------------' '-----' '------' '------' *
* Laptop 1 Laptop 2 Tablet 1 Dedicated Server Rack *
*************************************************************************************************
Styling Diagrams
------------------------------------------------------------------------------------
You can use CSS to style all diagrams or individual diagrams. For example,
the following has light lines on a dark background:
<link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/latex.css?">
### Dark
For an aggressively-stylized document with a black background, insert the following anywhere in
your document:
<link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/dark.css?">
### API Documentation
To use the API documentation template, insert the following anywhere in
your document:
<link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/apidoc.css?">
### Presentation Slides
To create presentation slides as a PDF, insert the following into
your document, using first-level headers for sections and second-level
headers for slides:
<link rel="stylesheet" href="https://casual-effects.com/markdeep/latest/slides.css?">
Then, print the document to PDF.
Paragraph Numbering
--------------------------------------------------
Academic article or book proofs often have line numbers so that reviewers and editors can refer
to specific passages. This doesn't make sense for a document in a browser because line breaks
change based on the reader's screen size.
You can add _paragraph_ numbers to your Markdeep document by including the following HTML at
the bottom of your document. You can remove the `
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Localization
===================================================
There are two ways to localize the keywords such as Table, Diagram,
Monday, etc., from English to your favorite language.
The first is to
put a meta tag with a
[`lang`](http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry)
attribute in the document, such as <`meta lang="ru"
charset="utf-8"`>. If your favorite language isn't supported by
Markdeep, just e-mail me a Javascript snippet with the appropriate
translations and I'll add it (see the source code for examples).
The second method is to manually set the `markdeepOptions.lang` field
before you include the script in your document.
Unicode (in UTF-8 encoding)
===================================================
To support Unicode input, you must add <`meta charset="utf-8"`> to
the *top* of your document (in the first 512 bytes).
- Asian characters 林花謝了春紅 太匆匆, 無奈朝來寒雨 晚來風 胭脂淚 留人醉 幾時重, 自是人生長恨 水長東
- Asian punctuation: 、。!,:
- Matching pairs «»‹›“”‘’〖〗【】「」『』〈〉《》〔〕
- Greek ΑΒΓΔ ΕΖΗΘ ΙΚΛΜ ΝΞΟΠ ΡΣΤΥ ΦΧΨΩ αβγδ εζηθ ικλμ νξοπ ρςτυ φχψω
- Currency ¤ $ ¢ € ₠ £ ¥
- Common symbols © ® ™ ² ³ § ¶ † ‡ ※
- Bullets •◦ ‣ ✓ ●■◆ ○□◇ ★☆ ♠♣♥♦ ♤♧♡♢
- Phonetic ᴁ ᴂ ᴈ
- Music ♩♪♫♬♭♮♯
- Punctuation “” ‘’ ¿¡ ¶§ª - ‐ ‑ ‒ – — ― …
- Accents àáâãäåæç èéêë ìíîï ðñòóôõö øùúûüýþÿ ÀÁÂÃÄÅ Ç ÈÉÊË ÌÍÎÏ ÐÑ ÒÓÔÕÖ ØÙÚÛÜÝÞß
- Math ° ⌈⌉ ⌊⌋ ∏ ∑ ∫ ×÷ ⊕ ⊖ ⊗ ⊘ ⊙ ⊚ ⊛ ∙ ∘ ′ ″ ‴ ∼ ∂ √ ≔ × ⁱ ⁰ ¹ ² ³ ₀ ₁ ₂ π ∞ ± ∎
- Logic & Set Theory ∀¬∧∨∃⊦∵∴∅∈∉⊂⊃⊆⊇⊄⋂⋃
- Relations ≠≤≥≮≯≫≪≈≡
- Sets ℕℤℚℝℂ
- Arrows ←→↑↓ ↔ ↖↗↙↘ ⇐⇒⇑⇓ ⇔⇗ ⇦⇨⇧⇩ ↞↠↟↡ ↺↻ ☞☜☝☟
- Computing ⌘ ⌥ ‸ ⇧ ⌤ ↑ ↓ → ← ⇞ ⇟ ↖ ↘ ⌫ ⌦ ⎋⏏ ↶↷ ◀▶▲▼ ◁▷△▽ ⇄ ⇤⇥ ↹ ↵↩⏎ ⌧ ⌨ ␣ ⌶ ⎗⎘⎙⎚ ⌚⌛ ✂✄ ✉✍
- Digits ➀➁➂➃➄➅➆➇➈➉
- Religious and cultural symbols ✝✚✡☥⎈☭☪☮☺☹☯☰☱☲☳☴☵☶☷
- Dingbats ❦☠☢☣☤♲♳⌬♨♿ ☉☼☾☽ ♀♂ ♔♕♖ ♗♘♙ ♚♛ ♜♝♞♟
Gravizo Support
===================================================
Markdeep diagrams have no dependency on third parties or the network
(you can store the `markdeep.min.js` file locally on your machine!)
and look the same in your document as on screen in the final document.
If you need the full power of DOT/GraphViz automated layout graphs and
can accept a network and third party dependency, you can embed
[Gravizo](http://g.gravizo.com/) within a Markdeep document using either
direct Markdeep image syntax or an embedded HTML `img` tag:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![](http://g.gravizo.com/g?digraph G { A -> B -> C; A -> C; })
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![](http://g.gravizo.com/g?digraph G { A -> B -> C; A -> C; })
Markdeep also allows captions on Gravizo graphs and newlines within
the URL itself:
![Figure [graph]: A more complex graph example](http://g.gravizo.com/g?
digraph G {
main -> parse -> execute;
main -> init;
main -> cleanup;
execute -> make_string;
execute -> printf
init -> make_string;
main -> printf;
execute -> compare;
})
Including/Inserting Other Documents
===================================================
Markdeep currently contains experimental (i.e., beta, may-not-be-supported-in-the-future)
support for including one document within another. This is convenient for bibliographies,
boilerplate footers and headers, and styling. The syntax is:
` and `
` tags
that appear in the document, you cannot nest a code tag inside of another code tag, and
likewise for pre tags. Fortunately, it is pretty hard to imagine a case where you would want
nested code tags.