Skip to content
This repository was archived by the owner on Aug 3, 2024. It is now read-only.

Commit ed6e7b2

Browse files
author
Iñaki García Etxebarria
committed
Add documentation for anchors in section headings
1 parent 75c20e5 commit ed6e7b2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/markup.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,19 @@ on, where the number of ``*``\ s indicates the level of the heading
508508
If you use section headings, then Haddock will generate a table of
509509
contents at the top of the module documentation for you.
510510

511+
By default, when generating HTML documentation Haddock will create an
512+
anchor to each section of the form ``#g:n``, where ``n`` is an integer
513+
that might change as the you add new section headings. If you want to
514+
create stable links, you can add an explicit anchor (see
515+
:ref:`anchors`) after the section heading: ::
516+
517+
module Foo (
518+
-- * Classes #classes#
519+
C(..)
520+
) where
521+
522+
This will create an HTML anchor ``#g:classes`` to the section.
523+
511524
The alternative style of placing the commas at the beginning of each
512525
line is also supported. e.g.: ::
513526

@@ -1150,6 +1163,8 @@ Inspired by reSTs grid tables Haddock supports a complete table representation v
11501163
-- | body row 4 | | \] |
11511164
-- +------------------------+------------+---------------------+
11521165

1166+
.. _anchors:
1167+
11531168
Anchors
11541169
~~~~~~~
11551170

0 commit comments

Comments
 (0)