diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/cheatsheet/haddocks.md | 17 | ||||
| -rw-r--r-- | doc/markup.rst | 20 | 
2 files changed, 37 insertions, 0 deletions
| diff --git a/doc/cheatsheet/haddocks.md b/doc/cheatsheet/haddocks.md index fbe71392..a3464584 100644 --- a/doc/cheatsheet/haddocks.md +++ b/doc/cheatsheet/haddocks.md @@ -118,3 +118,20 @@ definitions with "[thing]"  {-# OPTIONS_HADDOCK show-extensions #-}    Show all enabled LANGUAGE extensions  ``` + +# Grid tables + +``` ++------------------------+------------+----------+----------+ +| Header row, column 1   | Header 2   | Header 3 | Header 4 | +| (header rows optional) |            |          |          | ++========================+============+==========+==========+ +| body row 1, column 1   | column 2   | column 3 | column 4 | ++------------------------+------------+----------+----------+ +| body row 2             | Cells may span columns.          | ++------------------------+------------+---------------------+ +| body row 3             | Cells may  | \[                  | ++------------------------+ span rows. | f(n) = \sum_{i=1}   | +| body row 4             |            | \]                  | ++------------------------+------------+---------------------+ +``` diff --git a/doc/markup.rst b/doc/markup.rst index 4d56cc83..1a278da3 100644 --- a/doc/markup.rst +++ b/doc/markup.rst @@ -1092,6 +1092,26 @@ If the output format supports it, the mathematics will be rendered  inside the documentation. For example, the HTML backend will display  the mathematics via `MathJax <https://www.mathjax.org>`__. +Grid Tables +~~~~~~~~~~~ + +Inspired by reSTs grid tables Haddock supports a complete table representation via a grid-like "ASCII art". Grid tables are described with a visual grid made up of the characters "-", "=", "|", and "+". The hyphen ("-") is used for horizontal lines (row separators). The equals sign ("=") may be used to separate optional header rows from the table body. The vertical bar ("|") is used for vertical lines (column separators). The plus sign ("+") is used for intersections of horizontal and vertical lines. :: + +    -- | This is a grid table:  +    --  +    -- +------------------------+------------+----------+----------+ +    -- | Header row, column 1   | Header 2   | Header 3 | Header 4 | +    -- | (header rows optional) |            |          |          | +    -- +========================+============+==========+==========+ +    -- | body row 1, column 1   | column 2   | column 3 | column 4 | +    -- +------------------------+------------+----------+----------+ +    -- | body row 2             | Cells may span columns.          | +    -- +------------------------+------------+---------------------+ +    -- | body row 3             | Cells may  | \[                  | +    -- +------------------------+ span rows. | f(n) = \sum_{i=1}   | +    -- | body row 4             |            | \]                  | +    -- +------------------------+------------+---------------------+ +  Anchors  ~~~~~~~ | 
