G'MIC Markdown
The main
G'MIC documentation pages are written using a specific Markdown-like syntax, namely
G'MIC Markdown (a.k.a
gmd). You can contribute writing documentation pages with this syntax.
G'MIC Markdown is defined by these simple rules:
• Sections and subsections
Start a line with one, two, three or four consecutive number signs (
#), then a whitespace, to begin a section, a sub-section, a sub-sub-section or a sub-sub-sub-section:
# 1. Section title
## 1.1. Sub-section title
### 1.1.1. Sub-sub-section title
#### 1.1.1.1. Sub-sub-sub-section title
is rendered as
1. Section title
1.1. Sub-section title
1.1.1. Sub-sub-section title
1.1.1.1. Sub-sub-sub-section title
• Lists:
Start a line with one of the characters
*,
-,
+ or
_ to insert a list item:
* First item
* Second item
- Indent with two whitespaces to start a sub-list.
+ Indent with four whitespaces to start a sub-sub-list.
* Third iterm
is rendered as
First item
Second item
Indent with two whitespaces to start a sub-list.
Indent with four whitespaces to start a sub-sub-list.
Third iterm
• Centered blocks:
A line that contains three consecutive equal signs
=== opens or closes a centered block:
===
This text is centered
===
is rendered as
This text is centered
• Right-aligned blocks:
A line that contains three consecutive greater-than signs
>>> opens or closes a right-aligned block:
>>>
This text is right-aligned
>>>
is rendered as
This text is right-aligned
• Tables:
A line starting with
|,
||,
|- or
|+ defines one row of a table.
|+ **First Name** | **Last Name** | **Group**
| Angus | Young | AC/DC
| Kirk | Hammett | Metallica
| David | Gilmour | Pink Floyd
is rendered as:
First Name | Last Name | Group |
Angus | Young | AC/DC |
Kirk | Hammett | Metallica |
David | Gilmour | Pink Floyd |
The first delimiter actually defines the border style:
|: No borders.
||: Vertical borders only.
|-: Horizontal borders only.
|+: Both horizontal and vertical borders.
• Blockquote:
A line starting with
> defines a blockquote (possibly multi-line):
> \G'MIC is a full-featured open-source framework for digital image processing,
> distributed under the **CeCILL** free software licenses (**LGPL**-like and/or **GPL**-compatible).
>
> It provides several user interfaces to _convert / process / visualize_ generic images.
is rendered as
G'MIC is a full-featured open-source framework for digital image processing,
distributed under the CeCILL free software licenses (LGPL-like and/or GPL-compatible).
It provides several user interfaces to convert / process / visualize generic images.
• Detail block:
A line starting with three consecutive question mark (
???) opens or closes a detail block that the user can open or close on demand.
??? Details:
There are the details you want!
???
is rendered as
Details:
There are the details you want!
• Code block:
A line that contains three consecutive backticks (
```) or tildes (
~~~) opens or closes a block of code:
~~~
1. This is a block of code.
2. It can have multiple lines.
~~~
is rendered as
1. This is a block of code.
2. It can have multiple lines.
• Shell command:
A line that contains three consecutive double quotes (
""") opens or close a shell command block.
It displays what you gets in
stderr and
stdout when you run a command from the shell.
"""
gmic help index
"""
is rendered as
$ gmic help index
index (+):
{ [palette] | palette_name },0<=_dithering<=1,_map_colors={ 0 | 1 }
Index selected vector-valued images by specified vector-valued palette.
'palette_name' can be { default | hsv | lines | hot | cool | jet | flag | cube | rainbow | algae | amp |balance | curl | deep | delta | dense | diff | haline | ice | matter | oxy
| phase | rain | solar | speed | tarn |tempo | thermal | topo | turbid | aurora | hocuspocus | srb2 | uzebox }
Default values: 'dithering=0' and 'map_colors=0'.
Example:
[#1] image.jpg +index 1,1,1
[#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1
Tutorial: https://gmic.eu/tutorial/gindex
• Horizontal rule:
A line that contains three consecutives minus signs (
---) or underscores (
___) or asterisks (
***) inserts an horizontal rule.
---
***
___
is rendered as
• Text styles
Special separators can be used to enclose a word or a phrase to apply specific text styles:
This is ***bold and italic*** ⟶ This is bold and italic (colored version).
This is ___bold and italic___ ⟶ This is bold and italic.
This is **bold only** ⟶ This is bold only (colored version).
This is __bold only__ ⟶ This is bold only.
This is *italic only* ⟶ This is italic only (colored version).
This is _italic only_ ⟶ This is italic only.
This is ~~strikethrough~~ ⟶ This is strikethrough.
This is ==underlined== ⟶ This is underlined.
This is `in monospace` ⟶ This is in monospace.
This is { a set of values } ⟶ This is { a set of values }.
This is a highlighted monospace 'expression' ⟶ This is a highlighted monospace expression (works for expressions having up to two whitespaces).
• Links
There are three different ways of inserting a clickable link in a
.gmd file:
Enclose the link between separators
< and
>, as
<https://gmic.eu> ⟶
https://gmic.eu.
Enclose a text between two consecutive single quotes to link to:
A reference page, about a command:
''blur'' ⟶
blur.
To force a hard link to a
G'MIC reference page, add a minus sign
- as first character of the link:
''-blur'' ⟶
blur.
Use the generic expression
[This is a link](https://gmic.eu) ⟶
This is a link.
• Images
There are two different ways to insert an image in a
.gmd file:
Use the expression
This is an image: ![gmicky the tiger](https://gmic.eu/img/gmicky_deevad220.jpg)
is rendered as
This is an image:
You can also directly invoke the G'MIC interpreter to generate an image:
This is a G'MIC-generated image: %% sp gmicky,220 deform 30 blur_radial 2% frame 1,1,0 %%
is rendered as
This is a
G'MIC-generated image:
• Math Formula
If you have
pdflatex installed on your system, you can insert
LaTeX equations in your
.gmd document:
$$ f(x) &= \cos\left(x + \frac{pi}{2}\right) \\
&= -\sin(x) $$
is rendered as
• Anchor
Start a line with an equal sign (
=), then a whitespace, to define an invisible anchor that can be used in links afterwards:
= document_top
Then, you can add an anchor link somewhere else:
• Convert a .gmd file to HTML
Assuming you have
gmic installed (the CLI interface of
G'MIC), then the command below converts a file
input.gmd into a HTML file
output.html:
$ gmic it input.gmd gmd2html ot output.html