Blame doc/markdown.doc

Packit 1c1d7e
/******************************************************************************
Packit 1c1d7e
 *
Packit 1c1d7e
 * 
Packit 1c1d7e
 *
Packit 1c1d7e
 * Copyright (C) 1997-2015 by Dimitri van Heesch.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Permission to use, copy, modify, and distribute this software and its
Packit 1c1d7e
 * documentation under the terms of the GNU General Public License is hereby 
Packit 1c1d7e
 * granted. No representations are made about the suitability of this software 
Packit 1c1d7e
 * for any purpose. It is provided "as is" without express or implied warranty.
Packit 1c1d7e
 * See the GNU General Public License for more details.
Packit 1c1d7e
 *
Packit 1c1d7e
 * Documents produced by Doxygen are derivative works derived from the
Packit 1c1d7e
 * input used in their production; they are not affected by this license.
Packit 1c1d7e
 *
Packit 1c1d7e
 */
Packit 1c1d7e
/*! \page markdown Markdown support
Packit 1c1d7e
Packit 1c1d7e
[TOC]
Packit 1c1d7e
Packit 1c1d7e
[Markdown] support 
Packit 1c1d7e
was introduced in doxygen version 1.8.0. It is a plain text formatting
Packit 1c1d7e
syntax written by John Gruber, with the following underlying design goal:
Packit 1c1d7e
Packit 1c1d7e
> The design goal for Markdown's formatting syntax is to 
Packit 1c1d7e
> make it as readable as possible. The idea is that a Markdown-formatted 
Packit 1c1d7e
> document should be publishable as-is, as plain text, without 
Packit 1c1d7e
> looking like it's been marked up with tags or formatting instructions. 
Packit 1c1d7e
> While Markdown's syntax has been influenced by several existing 
Packit 1c1d7e
> text-to-HTML filters, the single biggest source of inspiration 
Packit 1c1d7e
> for Markdown's syntax is the format of plain text email.
Packit 1c1d7e
Packit 1c1d7e
In the \ref markdown_std "next section" the standard Markdown features
Packit 1c1d7e
are briefly discussed. The reader is referred to the [Markdown site][markdown]
Packit 1c1d7e
for more details.
Packit 1c1d7e
Packit 1c1d7e
Some enhancements were made, for instance [PHP Markdown Extra][mdextra], and
Packit 1c1d7e
[GitHub flavored Markdown][github]. The section \ref markdown_extra discusses
Packit 1c1d7e
the extensions that doxygen supports.
Packit 1c1d7e
Packit 1c1d7e
Finally section \ref markdown_dox discusses some specifics for doxygen's
Packit 1c1d7e
implementation of the Markdown standard.
Packit 1c1d7e
Packit 1c1d7e
[markdown]: http://daringfireball.net/projects/markdown/ 
Packit 1c1d7e
[mdextra]:  https://michelf.ca/projects/php-markdown/extra/
Packit 1c1d7e
[github]:   https://github.github.com/github-flavored-markdown/
Packit 1c1d7e
Packit 1c1d7e
\section markdown_std Standard Markdown
Packit 1c1d7e
Packit 1c1d7e
\subsection md_para Paragraphs
Packit 1c1d7e
Packit 1c1d7e
Even before doxygen had Markdown support it supported the same way
Packit 1c1d7e
of paragraph handling as Markdown: to make a paragraph you just separate
Packit 1c1d7e
consecutive lines of text by one or more blank lines.
Packit 1c1d7e
Packit 1c1d7e
An example:
Packit 1c1d7e
Packit 1c1d7e
    Here is text for one paragraph.
Packit 1c1d7e
Packit 1c1d7e
    We continue with more text in another paragraph.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_headers Headers
Packit 1c1d7e
Packit 1c1d7e
Just like Markdown, doxygen supports two types of headers
Packit 1c1d7e
Packit 1c1d7e
Level 1 or 2 headers can be made as the follows
Packit 1c1d7e
Packit 1c1d7e
    This is a level 1 header
Packit 1c1d7e
    ========================
Packit 1c1d7e
Packit 1c1d7e
    This is a level 2 header
Packit 1c1d7e
    ------------------------
Packit 1c1d7e
Packit 1c1d7e
A header is followed by a line containing only ='s or -'s.
Packit 1c1d7e
Note that the exact amount of ='s or -'s is not important as long as
Packit 1c1d7e
there are at least two.
Packit 1c1d7e
Packit 1c1d7e
Alternatively, you can use #'s at the start of a line to make a header. 
Packit 1c1d7e
The number of #'s at the start of the line determines the level (up to 6 levels are supported).
Packit 1c1d7e
You can end a header by any number of #'s.
Packit 1c1d7e
Packit 1c1d7e
Here is an example:
Packit 1c1d7e
Packit 1c1d7e
    # This is a level 1 header
Packit 1c1d7e
Packit 1c1d7e
    ### This is level 3 header #######
Packit 1c1d7e
Packit 1c1d7e
\subsection md_blockquotes Block quotes
Packit 1c1d7e
Packit 1c1d7e
Block quotes can be created by starting each line with one or more >'s, 
Packit 1c1d7e
similar to what is used in text-only emails.
Packit 1c1d7e
Packit 1c1d7e
    > This is a block quote
Packit 1c1d7e
    > spanning multiple lines
Packit 1c1d7e
Packit 1c1d7e
Lists and code blocks (see below) can appear inside a quote block.
Packit 1c1d7e
Quote blocks can also be nested.
Packit 1c1d7e
Packit 1c1d7e
Note that doxygen requires that you put a space after the (last) > character
Packit 1c1d7e
to avoid false positives, i.e. when writing
Packit 1c1d7e
Packit 1c1d7e
    0  if OK\n
Packit 1c1d7e
    >1 if NOK
Packit 1c1d7e
Packit 1c1d7e
the second line will not be seen as a block quote.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_lists Lists
Packit 1c1d7e
Packit 1c1d7e
Simple bullet lists can be made by starting a line with -, +, or *.
Packit 1c1d7e
Packit 1c1d7e
    - Item 1
Packit 1c1d7e
Packit 1c1d7e
      More text for this item.
Packit 1c1d7e
Packit 1c1d7e
    - Item 2
Packit 1c1d7e
      + nested list item.
Packit 1c1d7e
      + another nested item.
Packit 1c1d7e
    - Item 3
Packit 1c1d7e
Packit 1c1d7e
List items can span multiple paragraphs (if each paragraph starts with
Packit 1c1d7e
the proper indentation) and lists can be nested.
Packit 1c1d7e
You can also make a numbered list like so
Packit 1c1d7e
Packit 1c1d7e
    1. First item.
Packit 1c1d7e
    2. Second item.
Packit 1c1d7e
Packit 1c1d7e
Make sure to also read \ref mddox_lists for doxygen specifics.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_codeblock Code Blocks
Packit 1c1d7e
Packit 1c1d7e
Preformatted verbatim blocks can be created by indenting
Packit 1c1d7e
each line in a block of text by at least 4 extra spaces
Packit 1c1d7e
Packit 1c1d7e
    This a normal paragraph
Packit 1c1d7e
Packit 1c1d7e
        This is a code block
Packit 1c1d7e
Packit 1c1d7e
    We continue with a normal paragraph again.
Packit 1c1d7e
Packit 1c1d7e
Doxygen will remove the mandatory indentation from the code block.
Packit 1c1d7e
Note that you cannot start a code block in the middle of a paragraph
Packit 1c1d7e
(i.e. the line preceding the code block must be empty).
Packit 1c1d7e
Packit 1c1d7e
See section \ref mddox_code_blocks for more info how doxygen handles
Packit 1c1d7e
indentation as this is slightly different than standard Markdown.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_rulers Horizontal Rulers
Packit 1c1d7e
Packit 1c1d7e
A horizontal ruler will be produced for lines containing at least three or more
Packit 1c1d7e
hyphens, asterisks, or underscores. The line may also include any amount of whitespace.
Packit 1c1d7e
Packit 1c1d7e
Examples:
Packit 1c1d7e
Packit 1c1d7e
    - - -
Packit 1c1d7e
    ______
Packit 1c1d7e
Packit 1c1d7e
Note that using asterisks in comment blocks does not work. See 
Packit 1c1d7e
\ref mddox_stars for details.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_emphasis Emphasis
Packit 1c1d7e
Packit 1c1d7e
To emphasize a text fragment you start and end the fragment with an underscore or star.
Packit 1c1d7e
Using two stars or underscores will produce strong emphasis.
Packit 1c1d7e
Packit 1c1d7e
Examples:
Packit 1c1d7e
Packit 1c1d7e
*    *single asterisks*
Packit 1c1d7e
*
Packit 1c1d7e
*    _single underscores_
Packit 1c1d7e
*
Packit 1c1d7e
*    **double asterisks**
Packit 1c1d7e
*
Packit 1c1d7e
*    __double underscores__
Packit 1c1d7e
Packit 1c1d7e
See section \ref mddox_emph_spans for more info how doxygen handles
Packit 1c1d7e
emphasis spans slightly different than standard Markdown.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_codespan code spans
Packit 1c1d7e
Packit 1c1d7e
To indicate a span of code, you should wrap it in backticks (`). Unlike code blocks,
Packit 1c1d7e
code spans appear inline in a paragraph. An example:
Packit 1c1d7e
Packit 1c1d7e
    Use the `printf()` function.
Packit 1c1d7e
Packit 1c1d7e
To show a literal backtick inside a code span use double backticks, i.e.
Packit 1c1d7e
Packit 1c1d7e
    To assign the output of command `ls` to `var` use ``var=`ls```.
Packit 1c1d7e
Packit 1c1d7e
See section \ref mddox_code_spans for more info how doxygen handles
Packit 1c1d7e
code spans slightly different than standard Markdown.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_links Links
Packit 1c1d7e
Packit 1c1d7e
Doxygen supports both styles of make links defined by Markdown: *inline* and *reference*.
Packit 1c1d7e
Packit 1c1d7e
For both styles the link definition starts with the link text delimited by [square 
Packit 1c1d7e
brackets].
Packit 1c1d7e
Packit 1c1d7e
\subsubsection md_inlinelinks Inline Links
Packit 1c1d7e
Packit 1c1d7e
For an inline link the link text is followed by a URL and an optional link title which
Packit 1c1d7e
together are enclosed in a set of regular parenthesis. 
Packit 1c1d7e
The link title itself is surrounded by quotes.
Packit 1c1d7e
Packit 1c1d7e
Examples:
Packit 1c1d7e
Packit 1c1d7e
    [The link text](http://example.net/)
Packit 1c1d7e
    [The link text](http://example.net/ "Link title")
Packit 1c1d7e
    [The link text](/relative/path/to/index.html "Link title") 
Packit 1c1d7e
    [The link text](somefile.html) 
Packit 1c1d7e
Packit 1c1d7e
In addition doxygen provides a similar way to link a documented entity:
Packit 1c1d7e
Packit 1c1d7e
    [The link text](@ref MyClass) 
Packit 1c1d7e
Packit 1c1d7e
\subsubsection md_reflinks Reference Links
Packit 1c1d7e
Packit 1c1d7e
Instead of putting the URL inline, you can also define the link separately
Packit 1c1d7e
and then refer to it from within the text.
Packit 1c1d7e
Packit 1c1d7e
The link definition looks as follows:
Packit 1c1d7e
Packit 1c1d7e
    [link name]: http://www.example.com "Optional title"
Packit 1c1d7e
Packit 1c1d7e
Instead of double quotes also single quotes or parenthesis can
Packit 1c1d7e
be used for the title part.
Packit 1c1d7e
Packit 1c1d7e
Once defined, the link looks as follows
Packit 1c1d7e
  
Packit 1c1d7e
    [link text][link name]
Packit 1c1d7e
Packit 1c1d7e
If the link text and name are the same, also
Packit 1c1d7e
Packit 1c1d7e
    [link name][]
Packit 1c1d7e
Packit 1c1d7e
or even
Packit 1c1d7e
Packit 1c1d7e
    [link name]
Packit 1c1d7e
Packit 1c1d7e
can be used to refer to the link.
Packit 1c1d7e
Note that the link name matching is not case sensitive
Packit 1c1d7e
as is shown in the following example:
Packit 1c1d7e
Packit 1c1d7e
    I get 10 times more traffic from [Google] than from
Packit 1c1d7e
    [Yahoo] or [MSN].
Packit 1c1d7e
Packit 1c1d7e
    [google]: http://google.com/        "Google"
Packit 1c1d7e
    [yahoo]:  http://search.yahoo.com/  "Yahoo Search"
Packit 1c1d7e
    [msn]:    http://search.msn.com/    "MSN Search"
Packit 1c1d7e
Packit 1c1d7e
Link definitions will not be visible in the output.
Packit 1c1d7e
Packit 1c1d7e
Like for inline links doxygen also supports \@ref inside a link definition:
Packit 1c1d7e
Packit 1c1d7e
    [myclass]: @ref MyClass "My class"
Packit 1c1d7e
Packit 1c1d7e
\subsection md_images Images
Packit 1c1d7e
Packit 1c1d7e
Markdown syntax for images is similar to that for links.
Packit 1c1d7e
The only difference is an additional ! before the link text.
Packit 1c1d7e
Packit 1c1d7e
Examples:
Packit 1c1d7e
Packit 1c1d7e
    ![Caption text](/path/to/img.jpg)
Packit 1c1d7e
    ![Caption text](/path/to/img.jpg "Image title")
Packit 1c1d7e
    ![Caption text][img def]
Packit 1c1d7e
    ![img def]
Packit 1c1d7e
Packit 1c1d7e
    [img def]: /path/to/img.jpg "Optional Title"
Packit 1c1d7e
Packit 1c1d7e
Also here you can use \@ref to link to an image:
Packit 1c1d7e
Packit 1c1d7e
    ![Caption text](@ref image.png)
Packit 1c1d7e
    ![img def]
Packit 1c1d7e
Packit 1c1d7e
    [img def]: @ref image.png "Caption text"
Packit 1c1d7e
Packit 1c1d7e
The caption text is optional.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_autolink Automatic Linking
Packit 1c1d7e
Packit 1c1d7e
To create a link to an URL or e-mail address Markdown supports the following
Packit 1c1d7e
syntax:
Packit 1c1d7e
Packit 1c1d7e
    <http://www.example.com>
Packit 1c1d7e
    <https://www.example.com>
Packit 1c1d7e
    <ftp://www.example.com>
Packit 1c1d7e
    <mailto:address@example.com>
Packit 1c1d7e
    <address@example.com>
Packit 1c1d7e
Packit 1c1d7e
Note that doxygen will also produce the links without the angle brackets.
Packit 1c1d7e
Packit 1c1d7e
\section markdown_extra Markdown Extensions
Packit 1c1d7e
Packit 1c1d7e
\subsection md_toc Table of Contents
Packit 1c1d7e
Packit 1c1d7e
Doxygen supports a special link marker `[TOC]` which can be placed in a page
Packit 1c1d7e
to produce a table of contents at the start of the page, listing all sections.
Packit 1c1d7e
Packit 1c1d7e
Note that using `[TOC]` is the same as using a
Packit 1c1d7e
\ref cmdtableofcontents "\\tableofcontents" command.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_tables Tables
Packit 1c1d7e
Packit 1c1d7e
Of the features defined by "Markdown Extra" is support for
Packit 1c1d7e
simple tables:
Packit 1c1d7e
Packit 1c1d7e
A table consists of a header line, a separator line, and at least one
Packit 1c1d7e
row line. Table columns are separated by the pipe (|) character.
Packit 1c1d7e
Packit 1c1d7e
Here is an example:
Packit 1c1d7e
Packit 1c1d7e
    First Header  | Second Header
Packit 1c1d7e
    ------------- | -------------
Packit 1c1d7e
    Content Cell  | Content Cell 
Packit 1c1d7e
    Content Cell  | Content Cell 
Packit 1c1d7e
Packit 1c1d7e
which will produce the following table:
Packit 1c1d7e
Packit 1c1d7e
First Header  | Second Header
Packit 1c1d7e
------------- | -------------
Packit 1c1d7e
Content Cell  | Content Cell 
Packit 1c1d7e
Content Cell  | Content Cell 
Packit 1c1d7e
Packit 1c1d7e
Column alignment can be controlled via one or two colons 
Packit 1c1d7e
at the header separator line:
Packit 1c1d7e
Packit 1c1d7e
    | Right | Center | Left  |
Packit 1c1d7e
    | ----: | :----: | :---- |
Packit 1c1d7e
    | 10    | 10     | 10    |
Packit 1c1d7e
    | 1000  | 1000   | 1000  |
Packit 1c1d7e
Packit 1c1d7e
which will look as follows:
Packit 1c1d7e
Packit 1c1d7e
| Right | Center | Left  |
Packit 1c1d7e
| ----: | :----: | :---- |
Packit 1c1d7e
| 10    | 10     | 10    |
Packit 1c1d7e
| 1000  | 1000   | 1000  |
Packit 1c1d7e
Packit 1c1d7e
Additionally, column and row spans are supported.  Using a caret ("^")
Packit 1c1d7e
in a cell indicates that the cell above should span rows.  Sequences
Packit 1c1d7e
of carets may be used for any number of row spans.  For example:
Packit 1c1d7e
Packit 1c1d7e
    | Right | Center | Left  |
Packit 1c1d7e
    | ----: | :----: | :---- |
Packit 1c1d7e
    | 10    | 10     | 10    |
Packit 1c1d7e
    | ^     | 1000   | 1000  |
Packit 1c1d7e
Packit 1c1d7e
which will look as follows:
Packit 1c1d7e
Packit 1c1d7e
| Right | Center | Left  |
Packit 1c1d7e
| ----: | :----: | :---- |
Packit 1c1d7e
| 10    | 10     | 10    |
Packit 1c1d7e
| ^     | 1000   | 1000  |
Packit 1c1d7e
Packit 1c1d7e
Column spans are supported by means of directly adjacent vertical bars
Packit 1c1d7e
("|").  Each additional vertical bar indicates an additional column to
Packit 1c1d7e
be spanned.  To put it another way, a single vertical bar indicates a
Packit 1c1d7e
single column span, two vertical bars indicates a 2 columns span, and
Packit 1c1d7e
so on.  For example:
Packit 1c1d7e
Packit 1c1d7e
    | Right | Center | Left  |
Packit 1c1d7e
    | ----: | :----: | :---- |
Packit 1c1d7e
    | 10    | 10     | 10    |
Packit 1c1d7e
    | 1000  |||
Packit 1c1d7e
Packit 1c1d7e
which will look as follows:
Packit 1c1d7e
Packit 1c1d7e
| Right | Center | Left  |
Packit 1c1d7e
| ----: | :----: | :---- |
Packit 1c1d7e
| 10    | 10     | 10    |
Packit 1c1d7e
| 1000  |||   
Packit 1c1d7e
Packit 1c1d7e
For more complex tables in doxygen please have a look at: \ref tables
Packit 1c1d7e
Packit 1c1d7e
\subsection md_fenced Fenced Code Blocks
Packit 1c1d7e
Packit 1c1d7e
Another feature defined by "Markdown Extra" is support for
Packit 1c1d7e
Packit 1c1d7e
fenced code blocks:
Packit 1c1d7e
Packit 1c1d7e
A fenced code block does not require indentation, and is
Packit 1c1d7e
defined by a pair of "fence lines". Such a line consists of 3 or
Packit 1c1d7e
more tilde (~) characters on a line. The end of the block should have the
Packit 1c1d7e
same number of tildes. Here is an example:
Packit 1c1d7e
Packit 1c1d7e
Packit 1c1d7e
    This is a paragraph introducing:
Packit 1c1d7e
Packit 1c1d7e
    ~~~~~~~~~~~~~~~~~~~~~
Packit 1c1d7e
    a one-line code block
Packit 1c1d7e
    ~~~~~~~~~~~~~~~~~~~~~
Packit 1c1d7e
Packit 1c1d7e
By default the output is the same as for a normal code block.
Packit 1c1d7e
Packit 1c1d7e
For languages supported by doxygen you can also make the code block
Packit 1c1d7e
appear with syntax highlighting. To do so you need to 
Packit 1c1d7e
indicate the typical file extension that corresponds to the 
Packit 1c1d7e
programming language after the opening fence. For highlighting according
Packit 1c1d7e
to the Python language for instance, you would need to write the following:
Packit 1c1d7e
Packit 1c1d7e
    ~~~~~~~~~~~~~{.py}
Packit 1c1d7e
    # A class
Packit 1c1d7e
    class Dummy:
Packit 1c1d7e
        pass
Packit 1c1d7e
    ~~~~~~~~~~~~~
Packit 1c1d7e
Packit 1c1d7e
which will produce:
Packit 1c1d7e
~~~~~~~~~~~~~{.py}
Packit 1c1d7e
# A class
Packit 1c1d7e
class Dummy:
Packit 1c1d7e
    pass
Packit 1c1d7e
~~~~~~~~~~~~~
Packit 1c1d7e
Packit 1c1d7e
and for C you would write:
Packit 1c1d7e
Packit 1c1d7e
    ~~~~~~~~~~~~~~~{.c}
Packit 1c1d7e
    int func(int a,int b) { return a*b; }
Packit 1c1d7e
    ~~~~~~~~~~~~~~~
Packit 1c1d7e
Packit 1c1d7e
which will produce:
Packit 1c1d7e
Packit 1c1d7e
~~~~~~~~~~~~~~~{.c}
Packit 1c1d7e
int func(int a,int b) { return a*b; }
Packit 1c1d7e
~~~~~~~~~~~~~~~
Packit 1c1d7e
Packit 1c1d7e
The curly braces and dot are optional by the way.
Packit 1c1d7e
Packit 1c1d7e
Another way to denote fenced code blocks is to use 3 or more backticks (```):
Packit 1c1d7e
Packit 1c1d7e
    ```
Packit 1c1d7e
    also a fenced code block
Packit 1c1d7e
    ```
Packit 1c1d7e
Packit 1c1d7e
\subsection md_header_id Header Id Attributes
Packit 1c1d7e
Packit 1c1d7e
Standard Markdown has no support for labeling headers, which
Packit 1c1d7e
is a problem if you want to link to a section.
Packit 1c1d7e
Packit 1c1d7e
PHP Markdown Extra allows you to label a header by adding
Packit 1c1d7e
the following to the header
Packit 1c1d7e
Packit 1c1d7e
    Header 1                {#labelid}
Packit 1c1d7e
    ========
Packit 1c1d7e
Packit 1c1d7e
    ## Header 2 ##          {#labelid2}
Packit 1c1d7e
Packit 1c1d7e
To link to a section in the same comment block you can use
Packit 1c1d7e
Packit 1c1d7e
    [Link text](#labelid)
Packit 1c1d7e
Packit 1c1d7e
to link to a section in general, doxygen allows you to use \@ref
Packit 1c1d7e
Packit 1c1d7e
    [Link text](@ref labelid)
Packit 1c1d7e
Packit 1c1d7e
Note this only works for the headers of level 1 to 4.
Packit 1c1d7e
Packit 1c1d7e
\section markdown_dox Doxygen specifics
Packit 1c1d7e
Packit 1c1d7e
Even though doxygen tries to following the Markdown standard as closely as
Packit 1c1d7e
possible, there are couple of deviation and doxygen specifics additions.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_page_header Including Markdown files as pages
Packit 1c1d7e
Packit 1c1d7e
Doxygen can process files with Markdown formatting. 
Packit 1c1d7e
For this to work the extension for such a file should 
Packit 1c1d7e
be `.md` or `.markdown` (see 
Packit 1c1d7e
\ref cfg_extension_mapping "EXTENSION_MAPPING" if your Markdown files have 
Packit 1c1d7e
a different extension, and use `md` as the name of the parser).
Packit 1c1d7e
Each file is converted to a page (see the \ref cmdpage "page" command for
Packit 1c1d7e
details). 
Packit 1c1d7e
Packit 1c1d7e
By default the name and title of the page are derived from the file name.
Packit 1c1d7e
If the file starts with a level 1 header however, it is used as the title
Packit 1c1d7e
of the page. If you specify a label for the 
Packit 1c1d7e
header (as shown in \ref md_header_id) doxygen will use that as the
Packit 1c1d7e
page name. 
Packit 1c1d7e
Packit 1c1d7e
If the label is called `index` or `mainpage` doxygen will put the
Packit 1c1d7e
documentation on the front page (`index.html`).
Packit 1c1d7e
Packit 1c1d7e
Here is an example of a file `README.md` that will appear as the main page
Packit 1c1d7e
when processed by doxygen:
Packit 1c1d7e
Packit 1c1d7e
    My Main Page                         {#mainpage}
Packit 1c1d7e
    ============
Packit 1c1d7e
Packit 1c1d7e
    Documentation that will appear on the main page
Packit 1c1d7e
Packit 1c1d7e
If a page has a label you can link to it using \ref cmdref "\@ref" as 
Packit 1c1d7e
is shown above. To refer to a markdown page without
Packit 1c1d7e
such label you can simple use the file name of the page, e.g.
Packit 1c1d7e
Packit 1c1d7e
    See [the other page](other.md) for more info.
Packit 1c1d7e
Packit 1c1d7e
\subsection md_html_blocks Treatment of HTML blocks
Packit 1c1d7e
Packit 1c1d7e
Markdown is quite strict in the way it processes block-level HTML:
Packit 1c1d7e
Packit 1c1d7e
> block-level HTML elements — e.g. 
Packit 1c1d7e
> `
`, ``, `
`, `

`, etc. —

Packit 1c1d7e
> must be separated from surrounding content by blank lines, 
Packit 1c1d7e
> and the start and end tags of the block should not be indented 
Packit 1c1d7e
> with tabs or spaces.
Packit 1c1d7e
Packit 1c1d7e
Doxygen does not have this requirement, and will also process 
Packit 1c1d7e
Markdown formatting inside such HTML blocks. The only exception is
Packit 1c1d7e
`
` blocks, which are passed untouched (handy for ASCII art).
Packit 1c1d7e
Packit 1c1d7e
Doxygen will not process Markdown formatting inside verbatim or code blocks,
Packit 1c1d7e
and in other sections that need to be processed without changes
Packit 1c1d7e
(for instance formulas or inline dot graphs).
Packit 1c1d7e
Packit 1c1d7e
\subsection mddox_code_blocks Code Block Indentation
Packit 1c1d7e
Packit 1c1d7e
Markdown allows both a single tab or 4 spaces to start a code block.
Packit 1c1d7e
Since doxygen already replaces tabs by spaces before doing Markdown
Packit 1c1d7e
processing, the effect will only be same if TAB_SIZE in the config file
Packit 1c1d7e
has been set to 4. When it is set to a higher value spaces will be
Packit 1c1d7e
present in the code block. A lower value will prevent a single tab to be 
Packit 1c1d7e
interpreted as the start of a code block.
Packit 1c1d7e
Packit 1c1d7e
With Markdown any block that is indented by 4 spaces (and 8 spaces
Packit 1c1d7e
inside lists) is treated as a code block. This indentation amount
Packit 1c1d7e
is absolute, i.e. counting from the start of the line.
Packit 1c1d7e
Packit 1c1d7e
Since doxygen comments can appear at any indentation level
Packit 1c1d7e
that is required by the programming language, it
Packit 1c1d7e
uses a relative indentation instead. The amount of 
Packit 1c1d7e
indentation is counted relative to the preceding paragraph.
Packit 1c1d7e
In case there is no preceding paragraph (i.e. you want to start with a
Packit 1c1d7e
code block), the minimal amount of indentation of the whole comment block 
Packit 1c1d7e
is used as a reference.
Packit 1c1d7e
Packit 1c1d7e
In most cases this difference does not result in different output.
Packit 1c1d7e
Only if you play with the indentation of paragraphs the difference
Packit 1c1d7e
is noticeable:
Packit 1c1d7e
Packit 1c1d7e
    text
Packit 1c1d7e
Packit 1c1d7e
     text
Packit 1c1d7e
Packit 1c1d7e
      text
Packit 1c1d7e
  
Packit 1c1d7e
       code
Packit 1c1d7e
Packit 1c1d7e
In this case Markdown will put the word code in a code block,
Packit 1c1d7e
whereas doxygen will treat it as normal text, since although the absolute
Packit 1c1d7e
indentation is 4, the indentation with respect to the previous paragraph
Packit 1c1d7e
is only 1.
Packit 1c1d7e
Packit 1c1d7e
Note that list markers are not counted when determining the
Packit 1c1d7e
relative indent:
Packit 1c1d7e
Packit 1c1d7e
    1.  Item1
Packit 1c1d7e
Packit 1c1d7e
        More text for item1
Packit 1c1d7e
Packit 1c1d7e
    2.  Item2
Packit 1c1d7e
Packit 1c1d7e
            Code block for item2
Packit 1c1d7e
Packit 1c1d7e
For Item1 the indentation is 4 (when treating the list marker as whitespace), 
Packit 1c1d7e
so the next paragraph "More text..." starts at the same indentation level 
Packit 1c1d7e
and is therefore not seen as a code block.
Packit 1c1d7e
Packit 1c1d7e
\subsection mddox_emph_spans Emphasis limits
Packit 1c1d7e
Packit 1c1d7e
Unlike standard Markdown, doxygen will not touch internal underscores or
Packit 1c1d7e
stars, so the following will appear as-is:
Packit 1c1d7e
Packit 1c1d7e
    a_nice_identifier
Packit 1c1d7e
Packit 1c1d7e
Furthermore, a `*` or `_` only starts an emphasis if
Packit 1c1d7e
- it is followed by an alphanumerical character, and
Packit 1c1d7e
- it is preceded by a space, newline, or one the following characters `<{([,:;`
Packit 1c1d7e
Packit 1c1d7e
An emphasis ends if
Packit 1c1d7e
- it is not followed by an alphanumerical character, and
Packit 1c1d7e
- it is not preceded by a space, newline, or one the following characters `({[<=+-\@`
Packit 1c1d7e
Packit 1c1d7e
Lastly, the span of the emphasis is limited to a single paragraph.
Packit 1c1d7e
Packit 1c1d7e
Packit 1c1d7e
\subsection mddox_code_spans Code Spans Limits
Packit 1c1d7e
Packit 1c1d7e
Note that unlike standard Markdown, doxygen leaves the following untouched.
Packit 1c1d7e
Packit 1c1d7e
    A `cool' word in a `nice' sentence.
Packit 1c1d7e
Packit 1c1d7e
In other words; a single quote cancels the special treatment of a code span
Packit 1c1d7e
wrapped in a pair of backtick characters. This extra restriction was
Packit 1c1d7e
added for backward compatibility reasons.
Packit 1c1d7e
Packit 1c1d7e
\subsection mddox_lists Lists Extensions
Packit 1c1d7e
Packit 1c1d7e
With Markdown two lists separated by an empty line are joined together into
Packit 1c1d7e
a single list which can be rather unexpected and many people consider it to
Packit 1c1d7e
be a bug. Doxygen, however, will make two separate lists as you would expect.
Packit 1c1d7e
Packit 1c1d7e
Example:
Packit 1c1d7e
  
Packit 1c1d7e
    - Item1 of list 1
Packit 1c1d7e
    - Item2 of list 1
Packit 1c1d7e
Packit 1c1d7e
    1. Item1 of list 2
Packit 1c1d7e
    2. Item2 of list 2
Packit 1c1d7e
Packit 1c1d7e
With Markdown the actual numbers you use to mark the list have no 
Packit 1c1d7e
effect on the HTML output Markdown produces. I.e. standard Markdown treats the 
Packit 1c1d7e
following as one list with 3 numbered items:
Packit 1c1d7e
Packit 1c1d7e
    1. Item1
Packit 1c1d7e
    1. Item2
Packit 1c1d7e
    1. Item3
Packit 1c1d7e
Packit 1c1d7e
Doxygen however requires that the numbers used as marks are in 
Packit 1c1d7e
strictly ascending order, so the above example would produce 3 lists 
Packit 1c1d7e
with one item. An item with an equal or lower number than 
Packit 1c1d7e
the preceding item, will start a new list. For example:
Packit 1c1d7e
Packit 1c1d7e
    1. Item1 of list 1
Packit 1c1d7e
    3. Item2 of list 1
Packit 1c1d7e
    2. Item1 of list 2
Packit 1c1d7e
    4. Item2 of list 2
Packit 1c1d7e
Packit 1c1d7e
will produce:
Packit 1c1d7e
Packit 1c1d7e
1. Item1 of list 1
Packit 1c1d7e
3. Item2 of list 1
Packit 1c1d7e
2. Item1 of list 2
Packit 1c1d7e
4. Item2 of list 2
Packit 1c1d7e
    
Packit 1c1d7e
Historically doxygen has an additional way to create numbered 
Packit 1c1d7e
lists by using `-#` markers:
Packit 1c1d7e
Packit 1c1d7e
    -# item1
Packit 1c1d7e
    -# item2
Packit 1c1d7e
Packit 1c1d7e
\subsection mddox_stars Use of asterisks
Packit 1c1d7e
Packit 1c1d7e
Special care has to be taken when using *'s in a comment block 
Packit 1c1d7e
to start a list or make a ruler.
Packit 1c1d7e
Packit 1c1d7e
Doxygen will strip off any leading *'s from the comment before doing
Packit 1c1d7e
Markdown processing. So although the following works fine
Packit 1c1d7e
Packit 1c1d7e
@verbatim
Packit 1c1d7e
    /** A list:
Packit 1c1d7e
     *  * item1
Packit 1c1d7e
     *  * item2
Packit 1c1d7e
     */
Packit 1c1d7e
@endverbatim
Packit 1c1d7e
Packit 1c1d7e
When you remove the leading *'s doxygen will strip the other stars
Packit 1c1d7e
as well, making the list disappear!
Packit 1c1d7e
Packit 1c1d7e
Rulers created with *'s will not be visible at all. They only work
Packit 1c1d7e
in Markdown files.
Packit 1c1d7e
Packit 1c1d7e
\subsection mddox_limits Limits on markup scope
Packit 1c1d7e
Packit 1c1d7e
To avoid that a stray * or _ matches something many paragraphs later,
Packit 1c1d7e
and shows everything in between with emphasis, doxygen limits the scope
Packit 1c1d7e
of a * and _ to a single paragraph.
Packit 1c1d7e
Packit 1c1d7e
For a code span, between the starting and ending backtick only two
Packit 1c1d7e
new lines are allowed. 
Packit 1c1d7e
Packit 1c1d7e
Also for links there are limits; the link text, and link title each can
Packit 1c1d7e
contain only one new line, the URL may not contain any newlines. 
Packit 1c1d7e
Packit 1c1d7e
\section markdown_debug Debugging of problems
Packit 1c1d7e
Packit 1c1d7e
When doxygen parses the source code it first extracts the comments blocks,
Packit 1c1d7e
then passes these through the Markdown preprocessor. The output of the
Packit 1c1d7e
Markdown preprocessing consists of text with \ref cmd_intro "special commands" 
Packit 1c1d7e
and \ref htmlcmds "HTML commands".
Packit 1c1d7e
A second pass takes the output of the Markdown preprocessor and
Packit 1c1d7e
converts it into the various output formats.
Packit 1c1d7e
Packit 1c1d7e
During Markdown preprocessing no errors are produced. Anything that
Packit 1c1d7e
does not fit the Markdown syntax is simply passed on as-is. In the subsequent
Packit 1c1d7e
parsing phase this could lead to errors, which may not always be obvious
Packit 1c1d7e
as they are based on the intermediate format.
Packit 1c1d7e
Packit 1c1d7e
To see the result after Markdown processing you can run doxygen with the
Packit 1c1d7e
`-d Markdown` option. It will then print each comment block before and
Packit 1c1d7e
after Markdown processing.
Packit 1c1d7e
Packit 1c1d7e
\htmlonly
Packit 1c1d7e
Go to the next section or return to the
Packit 1c1d7e
 index.
Packit 1c1d7e
\endhtmlonly
Packit 1c1d7e
Packit 1c1d7e
*/