**Markdeep Documentation and 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/demodoc.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 Visual Studio Code, Cursor, Windsurf, Vi, Nodepad, Zed,
Emacs, Visual Studio, Sublime, Atom, or another
editor! You don't have to export, compile, or otherwise process
your document.
Basic Formatting
=======================================================================================
Text formatting:
Source | Result
-----------------------------------------|------------------------------
`**bold**` | **bold**
`__bold__` | __bold__
`*italic*` | *italic*
`_italic_` | _italic_
`~~strikethrough~~` | ~~strikethrough~~
`inline code` | `inline code`
<code lang=C++>if (inlinedHighlight == "yes") {</code> | if (inlinedHighlight == "yes") {
`[news](https://cbc.ca)` | [news](https://cbc.ca)
`https://casual-effects.com` | https://casual-effects.com
`morgan@casual-effects.com` | morgan@casual-effects.com
`5 kg/m^3` | 5 kg/m^3
`5 degrees` | 5 degrees
`"smart quote"` | "smart quote"
`xbelow` | xbelow
`size` | size
`size` | size
`$\frac{1}{\pi}\int_0^1 e^{-x} dx$` | $\frac{1}{\pi}\int_0^1 e^{-x} dx$
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 ``foo()` | `foo()`
Any section header name followed by "section", "subsection", or "sec." will automatically be
linked to that section. (The keyword "chapter" currently works but is unsupported and likely to
change to work differently with multi-file documents in the future.)
To link by number, use one of those key words followed by the section
name in brackets. This won't work if you use the actual word "section" _as the title of a
section_...but it would be unexpected to have a section named "section" in a real document
anyway.
You can also insert HTML anchor (``) tags to create arbitrary internal links.
When linking to a Markdeep document from another document, you can refer to sections
based on either a mangled version of their name or a fully-qualified version of that.
The mangling is URI encoding of the section name with spaces removed, in all lowercase.
For example, this section can be linked to as
`demodoc.md.html#links` or `demodoc.md.html#basicformatting/links`.
**The easiest way to generate a link to a section is to simply
right-click (or ctrl-click) on that section header in the
browser. This will bring up a context menu that allows you to copy
either the internal Markdeep text of the link or the external HTML
code link.** While a hover would be more discoverable, I chose to use
the context menu so that this functionality would work well on touch
screens, be easier to style for themes, and not affect layout.
Reference links include arbitrary formatted text in brackets
followed by a case-insensitive symbolic name that must be defined
elsewhere in the document:
- Example using a symbolic name: [New York Times][nyt]
- Example using the text as its own symbol: [Google][]
Put the definitions at a convenient location elsewhere in the document:
~~~~~~~~~~~~ none
[nyt]: http://nytimes.com
[google]: http://google.com
~~~~~~~~~~~~
Markdeep also supports footnotes, endnotes [^syntax], and citations
[#Kajiya86] using a similar syntax. The actual notes and bibliography
may be placed at the bottom of the document:
~~~~~~~~~~~~~~~~none
[#Kajiya86]: James T. Kajiya. 1986 ...
[^syntax]: Endnotes look like ...
~~~~~~~~~~~~~~~~
Multiple citations (but not footnotes) may be included within brackets:
~~~~~~~~~~~~~~~~~~none
...the early Monte Carlo rendering methods [#Cook84, #Kajiya86].
~~~~~~~~~~~~~~~~~~
API links are automatically created from standalone inline code references to functions,
arrays, and variables when a definition list exists that provides code-formatted
definitions of those entities using backticks. For example:
`foo(x, y)`
: Returns the foo of `x` and `y`
`gamepad_array[]`
: Array of all gamepads on this computer
A reference to `foo()` is then automatically linked back to its
definition. In the case of overloaded definitions, automatic links
will always point to the first one. Subsequent definitions are given
unique hash URLs that can be explicitly linked.
Regular links may also have attributes, for example,
[this link will directly download](http://casual-effects.com/markdeep/robot.jpg download).
URLs in explicit links may be surrounded by optional `"` quotation `"` marks. If your URL
contains parentheses, then it _must_ be surrounded in quotation marks to make it unambigious:
- [a link with parens]("http://casual-effects.com(bar)")
- []("http://casual-effects.com(bar)")
URLs with various forms of special characters are handled well even without quotation marks:
- [hyperlinks to URLs with underscores](https://archive.org/stream/Bazin_Andre_What_Is_Cinema_Volume_1/Bazin_Andre_What_Is_Cinema_Volume_1_djvu.txt)
- https://archive.org/stream/Bazin_Andre_What_Is_Cinema_Volume_1/Bazin_Andre_What_Is_Cinema_Volume_1_djvu.txt
You can also use the CommonMark angle bracket syntax
`
` at the start of the next line
without creating a new paragraph.
For example, this source:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ none
Roses are red,\
Violets are blue.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Renders as:
Roses are red,\
Violets are blue.
Two trailing spaces at the end of a line have the same effect but will elide with a paragraph break to avoid a double break (backslash forces a break even against a paragraph).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ none
Roses are red,
Violets are blue.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Renders as:
Roses are red,
Violets are blue.
A blank line between lines creates a separate paragraph.
These features are controlled by the `enableBackslashLineBreak` and `enableHiddenLineBreak`
options. Both default to on. You can also always use an explicit `
` tag, which is generally more visually intrusive but clearer in the source.
Stage Directions
---------------------------------------------------------------------------------------
Stage directions use double parentheses `((...))` to indicate non-dialogue
action or movement, as in screenplays and theatre scripts.
When a stage direction appears alone on a line, it is rendered as a
block-level element with indentation:
((The lights dim. A single spotlight illuminates center stage.))
When a stage direction appears within other text, it is rendered inline:
JULIET: O Romeo, Romeo! ((turns to the balcony)) Wherefore art thou Romeo?
She said ((laughing)) that the show must go on ((wipes tear)) indeed.
Stage directions support nested parentheses for mathematical or
parenthetical content:
((gestures at the (broken) prop on the table))
Disable this feature by setting `markdeepOptions` before loading Markdeep in a script tag:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
markdeepOptions = {enableStageDirections: false};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Images
------------------------------------------------------------------------------
There's no natural way to embed an image into a document that is also
readable as plain text. Markdeep follows markdown's somewhat
reasonable syntax. The source
` `
becomes:

Optional labels may be applied:
` ![Figure [robot]: A picture of a robot](robot.jpg)`
![Figure [robot]: A picture of a robot](robot.jpg)
Any text after the URL is used as HTML attributes. The image is also
linked to the original to make flip comparisons and zooming easier in
separate tabs. Use the `autoLinkImages: false` setting on
`markdeepOptions` to prevent this.
````
![Figure [robot2]: A picture of a robot with a caption larger
than it.](robot.jpg width="150px" border="1")
````
![Figure [robot2]: A picture of a robot with a caption larger
than it.](robot.jpg width="150px" border="1")

, but not other images.](robot.jpg width="150px" border="1")
 If the image is embedded in a
paragraph and has a caption, then it floats right and any width
specification is propagated to the full captioned image, for example,
the image to the right of this paragraph. Use a space as your caption
if you want this behavior but don't actually want a visible caption.
You can also just use a raw HTML `` tag:
`
`
Captionless images work as well. Source `` becomes:

Images are centered if they appear in their own paragraph block and
inlined otherwise. Grids of images are recognized and laid out as
grids using HTML tables:
  
  
Images may be shown pixel-perfect under zoom (which is good for computer graphics/computer
vision results and pixel art) by attaching the `pixel` CSS class:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Images may have an attribution overlaid, for example, to
display copyright information. Use `attrib` and `attrib-url`
properties for this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reference Images
----------------------------------------------------------------
Markdeep introduces a new feature called "reference images". These have several nice properties:
* Put long image URLs elsewhere in the document for clarity
* Indirection so that multiple images can reference a symbolic URL
* Embed [base64 encoded images as data URIs](https://www.base64-image.de/) directly in a Markdeep text file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![This is a base64 embedded reference image][hasselhoff.png]
[hasselhoff.png]: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAA...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
![This is a base64 embedded reference image][hasselhoff.png]
The syntax is the same as CommonMark reference _links_, just with square brackets.
You can use all of the Markdeep image features with reference images, including
image grids, floating images, and images with attributes.
[hasselhoff.png]: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAACACAMAAADDApyIAAAAwFBMVEWbnpufo6Wjp6WkramjtKytsKimpa2ru66qv7O4vbqQjoZ0bV+xsbSAfXNlX1BYQy1GNCI6OC8qKCEcEAduVDpQTUIMDAwFCgYWFxMpHBI5JRejtqYdHRkJERKetquctKULBQQOHBcQEhEMCwWyyLyju60GCgwFBguQak6ie2EEBAS6ineevLALBgrRoZNzNhuTVjXMdle3akjhgmb1pIj3tpnuknf4yK333Mj29fLnxMAAAADY2uTJyNMcRi0pY0RMIhbqAAAVt0lEQVR4AWSQCxLCMAhEMRDRfu9/W7fZyLTwhghjnH0RkVehAVVUwkBH0wsOFmDkDbr+vwBDILfw62iL9Cqw3hUwI2BqHHooeKfXo4AWCROAu5FkiFyMc+A/KAzHTcDf+1UOFHdzEXQWARs/a35KH4N9viaiTaTrsq4LrplP6p6mLK9I+Hrw3My2IXYHy74e54EurbslIpgWtrKihnoq3FT280dneeg5qutgPGdP9v6YMFifhchYikg2ngbb3v/xrg3ZGk561d9foQAxcgyxh8jQhhC6h2bfNH8k8dvk9VV5LBb9b9OiH+M/Pu4OrQgBx6ekfW80xD62BVQktbuHOuS0KaVqWTPYlPDDnocDgUTEfByT6zD0mkam5DDA0DXN/ewVsLw4X+5a9Mug2pWmG+gTEZRsvKbsfM3Js5OnFNlZ9fDwY9pm4BXwl0U/KrQyHoMRBAbxXADPOeVcXrFrYuZBVD7+KaHMrAtfDTqfL+e7DP5I+PHfACPSHvzs+RN1UC9ejVlNPTENhu6uq4Vxvj2XV5sW/ejP48NBLOWRqwZWpY6PkTh7SmqcmfvIffebhMsy+rwC1td3Nf3VoYddCAT18SkGIgAtazx6UjAn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qpgnsuojjy00yeeAIQ/WthUGwZTy39hNuUOAlOY1LN0luAEJDRkuJ653Xxm5yCJ3iwWgX1W/tjz1IAu/VAqwIwyMjg5q4DGOkgsakrI+gOtS3wIuKvrGure1lfcnBdlf96xFwDvlfCj+FQZzEVtGS0gyfPGVZXDHLtWF60FyLjksUvWWXuq1ifg+lyc+oKHPuwzYKoxgOlVoWlaUDdykDXGhoDYcQzaYXkN2VDqGCsDxZmvC16d+qtzX2eVln/WHw5ulcQKcFvWCWbX8VABHCA2YTgjUgNVBTxUXSd3EhdWxuCs7nvL6efSYRFJZfmAYyP/BwlyavFHkd5AAAAAAElFTkSuQmCC
Videos
----------------------------------------------------------------
Video file extensions are automatically detected and will embed a small video
player:

URLs for Youtube and Vimeo videos will also automatically embed a video player
(Note: YouTube now [blocks embedding on localhost](https://stackoverflow.com/questions/51969269/embedded-youtube-video-doesnt-work-on-local-server), so these must be viewed through a server or linked):


![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.
Audio
------------------------------------------------------------------------------
MP3, WAV, OGG, etc. audio for music and podcasts are supported using the same
syntax as for images and video:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creates:

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 x 6, 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.
Code Blocks
------------------------------------------------------------------------------
Inline code is between backticks. It is not syntax highlighted because
it is usually too short to autodetect the language. Use
`markdeepOptions = {inlineCodeLang: 'language'"}` in a `script` tag
to select a syntax highlighting language from the list below for inline
code.
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. The
supported languages are (capitalization ignored):
`bash cs C# cpp C++ css coffeescript html XML http JSON java Jlia JavaScript Makefile`
`markdown objectivec Objective-C PHP perl python PyxlScript ruby shell armasm glsl`
`go haskell kotlin lisp lua matlab R rust scheme swift sml tex typescript yaml none`
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.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`
`
`````````
`````````
!!! WARNING
Please refer to Section [Less-than Signs in Code] for best practices
regarding the use of < and >. We recommend wrapping the whole code block in
if you run into any unexpected issues.
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");
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### Line Numbers
Adding the `linenumbers` CSS class to a listing makes line numbers appear:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python linenumbers
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 [sort2]: An insertion sort with line numbers]
### 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 custom styling:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Python linenumbers
def insertionSort(data):
...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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 ####
Less-than and greater-than signs (`<` and `>`) do not need to be escaped in diagrams or code
as long as they do not appear immediately adjacent to a letter. You can even put HTML tags to appear *as* code inside of code fences and inline code. There are two special cases where you do need to do something different to render less-than signs correctly, however.
Browsers interpret `<` immediately followed by a letter or `/` as an HTML
tag. This only matters for `< script>` and `< /script>` tags inside code
blocks and for C++ templates where you are preserving capitalization.
**Script tags in code fences or inline code:** put a space, a UTF-8
zero-width space, or `\` between the `<` and the script tag name. Markdeep removes the break character when rendering, so the displayed and copy-pasted text is correct.
Inline example: `< script src="app.js">< /script>`
**C++ templates and other less-than followed by a capital letter:** wrap the
code fence or inline span in a `< script type="preformatted">` block. You
still need the space on any `< script>` or `< /script>` tags inside even with this workaround.
**Operators and arrows:** no special treatment is needed. `x < 3`,
`x->foo()`, and `std::vector~~~~~~~~~~~~~~ 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
**************
With code fences, you don't need any border markers at all:
```
.----.
| |
'----' .------------>
|
'-------------
```
Below are some more examples of diagrams.
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
```
```
X Y
/ \ / \
/ \ / \
A Y --> X C
/ \ / \
/ \ / \
B C A B
```
```
.-. .-.
| X | | Y |
+-+ +-+
/ \ / \
.+. .+. .+. .+.
| A | | Y | --> | X | | C |
'-' +-+ +-+ '-'
/ \ / \
.+. .+. .+. .+.
| B | | C | | A | | B |
'-' '-' '-' '-'
```
Digital Circuits
--------------------------------------------------------------------------------
*************************************************************************************************
* ____ * *
* | |_____.---. | *
* o _____| )----------)-------. *
* / \ | '---' | __|__ *
* /___\ | | \ / *
* | '-------------. | \ / *
* A ----------------' | | o *
* .-------------------. o-----)-------' | *
* | |___.---. | |___.---. *
* B ---*---.__.---. ___| )--*--.__..---. ____) )----- Y *
* __| o----*--' '---' ______)) )---' '---' *
* C -------' '---' | | ''---' *
* | o *
* | / \ *
* | /___\ *
* | | *
* '--------------' *
*************************************************************************************************
Analog Circuits
--------------------------------------------------------------------------------
*************************************************
* *
* k x₂ *
* .---.╱╲╱╲╱╲╱'---. .-----> *
* | | .+. *
* ----+ *--+ m₂+---> *
* | ---. | '-' x₁ *
* '--------┫+-----' *
* ---' *
* d *
* *
*************************************************
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 ┳ ⋱ ⋮ ◥██◤
* |
* ┣--+--┫
* |
* ┻
************************************************************************************************
Simple Plot Diagram
-------------------------------------------------------------------------------
*************************************************
* ▲
* Uin ┊ .------------------------
* ┊ |
* ┊ |
* *---'┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄▶
*
* Udc▲
* Udc_OK ┊ .---------------------
* ┊ / :
* ┊ / :
* *---'┄┄┄┄:┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄▶
* :<----->:
* ▲ 500ms :
* ┊ :
*Cpu.Qon ┊┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄.-----------
* ┊ | Inactive
* ┊ Active |
* *----------------'┄┄┄┄┄┄┄┄┄┄┄▶
*
*************************************************
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:
### Dark
For an aggressively-stylized document with a black background, insert the following anywhere in
your document:
### API Documentation
To use the API documentation template, insert the following anywhere in
your document:
### 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:
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 <`style>` tag and place the code in a CSS file
as well.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Localization
===================================================
There are two ways to localize the keywords such as Table, Diagram,
Monday, etc., from English to another natural 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="es" charset="utf-8"`>.
The second method is to manually set the `markdeepOptions.lang` option
in a `script` tag before you include Markdeep in your document, such as:
`var markdeepOptions = {lang: "es"}`.
When you've selected a language, keywords that you type such as
"figure", "listing", etc., the names of days and months, and any text
inserted by Markdeep such as "contents" will all be in that language.
The currently supported language options are:
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 ❦☠☢☣☤♲♳⌬♨♿ ☉☼☾☽ ♀♂ ♔♕♖ ♗♘♙ ♚♛ ♜♝♞♟
Embedding Documents
===================================================
Markdeep in iframe
---------------------------------------------------
### `src`
Markdeep content generally works well in a HTML iframe. If embedded
via the `src` attribute with a URL, it functions as if the iframe were
a small web browser of its own. In that case you may want to use the
optional link attributes to force links to open in the top context or
a new window:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ html
[CBC](https://cbc.ca target="_blank")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
### `srcdoc`
When embedded in a `srcdoc` inline, Markdeep still
works well but links must be handled specially. It
automatically adds the `target="_blank"` to externally
page links to prevent them from breaking.
Markdeep in Markdeep
---------------------------------------------------
Markdeep can embed/insert/include other Markdeep documents inline, so that flow and
links between them work seamlessly and they share a single table of
contents. This is convenient for multi-chapter books, 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.
Images cannot appear within hyperlinks, because Markdeep adds a number
of features on top of images (e.g., captions, tables, video, audio,
floating) that would interfere. To put an image in a link, use an HTML
image. For example:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ none
[Link
with image](https://myurl)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~