You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 3, 2024. It is now read-only.
Fix multiple typos and inconsistencies in doc/markup.rst
Note: I noticed some overlap with #1112 from @wygulmage and #1081 from
@parsonsmatt after creating these proposed changes - mea culpa for not
looking at the open PRs sooner.
We now give several examples that produce similar results and
354
354
illustrate most of the structural markup features. The first two
355
-
example use an export list, but the third example does not.
355
+
examples use an export list, but the third example does not.
356
356
357
357
The first example, using an export list with :ref:`section-headings`
358
358
and inline section descriptions: ::
@@ -362,7 +362,7 @@ and inline section descriptions: ::
362
362
--
363
363
-- | There is a "smart" importer, 'readImage', that determines
364
364
-- the image format from the file extension, and several
365
-
-- "dumb" format-specific importers that decode the file at
365
+
-- "dumb" format-specific importers that decode the file as
366
366
-- the specified type.
367
367
readImage
368
368
, readPngImage
@@ -417,7 +417,7 @@ defined elsewhere (the ``$imageImporters``; see :ref:`named-chunks`):
417
417
--
418
418
-- There is a "smart" importer, 'readImage', that determines the
419
419
-- image format from the file extension, and several "dumb"
420
-
-- format-specific importers that decode the file at the specified
420
+
-- format-specific importers that decode the file as the specified
421
421
-- type.
422
422
423
423
-- | Read an image, guessing the format from the file name.
@@ -450,7 +450,7 @@ The third example, without an export list: ::
450
450
--
451
451
-- There is a "smart" importer, 'readImage', that determines the
452
452
-- image format from the file extension, and several "dumb"
453
-
-- format-specific importers that decode the file at the specified
453
+
-- format-specific importers that decode the file as the specified
454
454
-- type.
455
455
456
456
-- | Read an image, guessing the format from the file name.
@@ -509,11 +509,11 @@ If you use section headings, then Haddock will generate a table of
509
509
contents at the top of the module documentation for you.
510
510
511
511
The alternative style of placing the commas at the beginning of each
512
-
line is also supported. e.g.: ::
512
+
line is also supported, e.g.: ::
513
513
514
514
module Foo (
515
515
-- * Classes
516
-
, C(..)
516
+
C(..)
517
517
-- * Types
518
518
-- ** A data type
519
519
, T
@@ -526,7 +526,7 @@ line is also supported. e.g.: ::
526
526
527
527
When not using an export list, you may insert section headers in the
528
528
module body. Such section headers associate with all entities
529
-
declaried up until the next section header. For example: ::
529
+
declared up until the next section header. For example: ::
530
530
531
531
module Foo where
532
532
@@ -601,7 +601,7 @@ re-exporting module.
601
601
It is often desirable to include a chunk of documentation which is not
602
602
attached to any particular Haskell declaration, for example, when
603
603
giving summary documentation for a group of related definitions (see
604
-
:ref:`structure-examples`). In addition to including such documenation
604
+
:ref:`structure-examples`). In addition to including such documentation
605
605
chunks at the top of the file, as part of the
606
606
:ref:`module-description`, you can also associate them with
607
607
:ref:`section-headings`.
@@ -655,14 +655,14 @@ headings, depending on whether you are using an export list or not:
655
655
-- Here is a large chunk of documentation which may be referred to by
656
656
-- the name $doc.
657
657
658
-
Just like with entity declariations when not using an export list,
658
+
Just like with entity declarations when not using an export list,
659
659
named chunks of documentation are associated with the preceding
660
660
section header here, or with the implicit top-level documentation
661
661
section if there is no preceding section header.
662
662
663
663
**Warning**: the form used in the first bullet above, where the
664
664
chunk is not named, *does not work* when you aren't using an
665
-
export list. For example ::
665
+
export list. For example: ::
666
666
667
667
module Foo where
668
668
@@ -673,7 +673,7 @@ headings, depending on whether you are using an export list or not:
673
673
-- | The fooifier.
674
674
foo :: ...
675
675
676
-
will result in ``Some documentation not ...`` being attached to
676
+
will result in ``Some documentation not ...`` being attached to the
677
677
*next* entity declaration, here ``foo``, in addition to any other
678
678
documentation that next entity already has!
679
679
@@ -743,7 +743,7 @@ type in ``C`` will therefore point locally to ``C.T``.
743
743
Module Attributes
744
744
-----------------
745
745
746
-
Certain attributes may be specified for each module which affects the
746
+
Certain attributes may be specified for each module which affect the
747
747
way that Haddock generates documentation for that module. Attributes are
748
748
specified in a comma-separated list in an
749
749
``{-# OPTIONS_HADDOCK ... #-}`` pragma at the top of the module, either
@@ -794,7 +794,7 @@ Markup
794
794
795
795
Haddock understands certain textual cues inside documentation
796
796
annotations that tell it how to render the documentation. The cues (or
797
-
“markup”) have been designed to be simple and mnemonic in ASCII so that
797
+
“markup”) have been designed to be simple and mnemonic in ASCII so
798
798
the programmer doesn't have to deal with heavyweight annotations when
799
799
editing documentation comments.
800
800
@@ -807,8 +807,8 @@ comment.
807
807
Special Characters
808
808
~~~~~~~~~~~~~~~~~~
809
809
810
-
The following characters have special meanings in documentation
811
-
comments: ``\``, ``/``, ``'``, `````, ``"``, ``@``, ``<``, ``$``, ``#``. To insert a
810
+
The following characters have special meanings in documentation comments:
811
+
``\``, ``/``, ``'``, `````, ``"``, ``@``, ``<``, ``$``, ``#``. To insert a
812
812
literal occurrence of one of these special characters, precede it with a
813
813
backslash (``\``).
814
814
@@ -826,7 +826,7 @@ Character References
826
826
827
827
Although Haskell source files may contain any character from the Unicode
828
828
character set, the encoding of these characters as bytes varies between
829
-
systems, so that only source files restricted to the ASCII character set
829
+
systems. Consequently, only source files restricted to the ASCII character set
830
830
are portable. Other characters may be specified in character and string
831
831
literals using Haskell character escapes. To represent such characters
832
832
in documentation comments, Haddock supports SGML-style numeric character
@@ -913,10 +913,11 @@ If ``M.T`` is not otherwise in scope, then Haddock will simply emit a
913
913
link pointing to the entity ``T`` exported from module ``M`` (without
914
914
checking to see whether either ``M`` or ``M.T`` exist).
915
915
916
-
Since values and types live in different namespaces in Haskell, it is
917
-
possible for a reference such as ``'X'`` to be ambiguous. In such a case,
918
-
Haddock defaults to pointing to the type. The ambiguity can be overcome by explicitly specifying a namespace, by way of a ``v`` (for value) or ``t``
919
-
(for type) immediately before the link: ::
916
+
Since values and types live in different namespaces in Haskell, it is possible
917
+
for a reference such as ``'X'`` to be ambiguous. In such a case, Haddock
918
+
defaults to pointing to the type. The ambiguity can be overcome by explicitly
919
+
specifying a namespace, by way of a ``v`` (for value) or ``t`` (for type)
920
+
immediately before the link: ::
920
921
921
922
-- | An implicit reference to 'X', the type constructor
922
923
-- An explicit reference to v'X', the data constructor
@@ -973,7 +974,7 @@ Itemized and Enumerated Lists
973
974
974
975
A bulleted item is represented by preceding a paragraph with either
975
976
“``*``” or “``-``”. A sequence of bulleted paragraphs is rendered as an
976
-
itemized list in the generated documentation, eg.: ::
977
+
itemized list in the generated documentation, e.g.: ::
977
978
978
979
-- | This is a bulleted list:
979
980
--
@@ -1012,7 +1013,7 @@ You can have more than one line of content in a list element: ::
1012
1013
1013
1014
You can even nest whole paragraphs inside of list elements. The rules
1014
1015
are 4 spaces for each indentation level. You're required to use a
1015
-
newline before such nested paragraph: ::
1016
+
newline before such nested paragraphs: ::
1016
1017
1017
1018
{-|
1018
1019
* Beginning of list
@@ -1099,7 +1100,7 @@ followed by the URL enclosed in regular parentheses, for example: ::
1099
1100
1100
1101
[some link](http://example.com)
1101
1102
1102
-
The link text is used as a descriptive text for the URL, if the output
1103
+
The link text is used as a description for the URL if the output
1103
1104
format supports it.
1104
1105
1105
1106
Images
@@ -1112,8 +1113,8 @@ like this: ::
1112
1113

1113
1114
1114
1115
If the output format supports it, the image will be rendered inside the
1115
-
documentation. The image description is used as relpacement text and/or
1116
-
image title.
1116
+
documentation. The image description is used as replacement text and/or
1117
+
an image title.
1117
1118
1118
1119
Mathematics / LaTeX
1119
1120
~~~~~~~~~~~~~~~~~~~
@@ -1133,7 +1134,13 @@ the mathematics via `MathJax <https://www.mathjax.org>`__.
1133
1134
Grid Tables
1134
1135
~~~~~~~~~~~
1135
1136
1136
-
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. ::
1137
+
Inspired by reSTs grid tables, Haddock supports a complete table representation
1138
+
via grid-like "ASCII art". Grid tables are described with a visual grid made
1139
+
up of the characters "-", "=", "|", and "+". The hyphen ("-") is used for
1140
+
horizontal lines (row separators). The equals sign ("=") may be used to
1141
+
separate optional header rows from the table body. The vertical bar ("|") is
1142
+
used for vertical lines (column separators). The plus sign ("+") is used for
1143
+
intersections of horizontal and vertical lines. ::
1137
1144
1138
1145
-- | This is a grid table:
1139
1146
--
@@ -1225,7 +1232,7 @@ Since
1225
1232
^^^^^
1226
1233
1227
1234
``@since`` annotation can be used to convey information about when the
1228
-
function was introduced or when it has changed in the way significant to
1235
+
function was introduced or when it has changed in a way significant to
1229
1236
the user. ``@since`` is a paragraph-level element. While multiple such
1230
1237
annotations are not an error, only the one to appear in the comment last
1231
1238
will be used. ``@since`` has to be followed with a version number, no
0 commit comments