Table of Contents  ▸  G'MIC Markdown◀  Funny Oneliners    |    Help Writing Reference Documentation  ▶

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
#### Sub-sub-sub-section title
is rendered as

1. Section title
1.1. Sub-section title
1.1.1. Sub-sub-section title Sub-sub-sub-section title

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

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 NameLast NameGroup
 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.

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_palette={ 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_palette=0'.

[#1] image.jpg +index 1,1,1
[#2] image.jpg (0;255;255^0;128;255^0;0;255) +index[-2] [-1],1,1


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 'word' ⟶ This is a highlighted monospace word (works only for words, without whitespaces).

There are three different ways of inserting a clickable link in a .gmd file:

Enclose the link between separators < and >, as <>
Enclose a text between two consecutive single quotes to link to:
A reference page, about a command: ''blur''blur.
A section in a reference page: ''Mathematical Expressions''Mathematical Expressions.
  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]( is a link.

There are two different ways to insert an image in a .gmd file:

Use the expression
This is an image: ![gmicky the tiger](
is rendered as

This is an image: gmicky the tiger

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: sp gmicky,220 deform 30 blur_radial 2% frame 1,1,0

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

f(x) &= \cos\left(x + \frac{\pi}{2}\right) \\         &= -\sin(x)

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:

[This is an anchor link](#document_top)  ⟶ This is an anchor link

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

◀  Funny Oneliners    |    Help Writing Reference Documentation  ▶