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

Commit 89ec565

Browse files
mattaudesseharpocrates
authored andcommitted
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.
1 parent dae8d9d commit 89ec565

File tree

1 file changed

+42
-35
lines changed

1 file changed

+42
-35
lines changed

doc/markup.rst

Lines changed: 42 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ or like this: ::
131131
b -- ^ This is the documentation for the argument of type 'b'
132132

133133
There is one edge case that is handled differently: only one ``-- ^``
134-
annotation occuring after the constructor and all its arguments is
134+
annotation occurring after the constructor and all its arguments is
135135
applied to the constructor, not its last argument: ::
136136

137137
data T a b
@@ -156,16 +156,16 @@ Alternative layout styles are generally accepted by Haddock - for
156156
example doc comments can appear before or after the comma in separated
157157
lists such as the list of record fields above.
158158

159-
In case that more than one constructor exports a field with the same
160-
name, the documentation attached to the first occurence of the field
159+
In cases where more than one constructor exports a field with the same
160+
name, the documentation attached to the first occurrence of the field
161161
will be used, even if a comment is not present. ::
162162

163163
data T a = A { someField :: a -- ^ Doc for someField of A
164164
}
165165
| B { someField :: a -- ^ Doc for someField of B
166166
}
167167

168-
In the above example, all occurences of ``someField`` in the
168+
In the above example, all occurrences of ``someField`` in the
169169
documentation are going to be documented with
170170
``Doc for someField of A``. Note that Haddock versions 2.14.0 and before
171171
would join up documentation of each field and render the result. The
@@ -238,7 +238,7 @@ module documentation example and then talk about the fields. ::
238238

239239
All fields are optional but they must be in order if they do appear.
240240
Multi-line fields are accepted but the consecutive lines have to start
241-
indented more than their label. If your label is indented one space as
241+
indented more than their label. If your label is indented one space, as
242242
is often the case with the ``--`` syntax, the consecutive lines have
243243
to start at two spaces at the very least. For example, above we saw a
244244
multiline ``Copyright`` field: ::
@@ -250,22 +250,22 @@ multiline ``Copyright`` field: ::
250250
...
251251
-}
252252

253-
That could equivalently be written as ::
253+
That could equivalently be written as: ::
254254

255255
-- | ...
256256
-- Copyright:
257257
-- (c) Some Guy, 2013
258258
-- Someone Else, 2014
259259
-- ...
260260

261-
or as ::
261+
or as: ::
262262

263263
-- | ...
264264
-- Copyright: (c) Some Guy, 2013
265265
-- Someone Else, 2014
266266
-- ...
267267

268-
but not as ::
268+
but not as: ::
269269

270270
-- | ...
271271
-- Copyright: (c) Some Guy, 2013
@@ -352,7 +352,7 @@ Documentation Structure Examples
352352

353353
We now give several examples that produce similar results and
354354
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.
356356

357357
The first example, using an export list with :ref:`section-headings`
358358
and inline section descriptions: ::
@@ -362,7 +362,7 @@ and inline section descriptions: ::
362362
--
363363
-- | There is a "smart" importer, 'readImage', that determines
364364
-- 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
366366
-- the specified type.
367367
readImage
368368
, readPngImage
@@ -417,7 +417,7 @@ defined elsewhere (the ``$imageImporters``; see :ref:`named-chunks`):
417417
--
418418
-- There is a "smart" importer, 'readImage', that determines the
419419
-- 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
421421
-- type.
422422

423423
-- | Read an image, guessing the format from the file name.
@@ -450,7 +450,7 @@ The third example, without an export list: ::
450450
--
451451
-- There is a "smart" importer, 'readImage', that determines the
452452
-- 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
454454
-- type.
455455

456456
-- | 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
509509
contents at the top of the module documentation for you.
510510

511511
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.: ::
513513

514514
module Foo (
515515
-- * Classes
516-
, C(..)
516+
C(..)
517517
-- * Types
518518
-- ** A data type
519519
, T
@@ -526,7 +526,7 @@ line is also supported. e.g.: ::
526526

527527
When not using an export list, you may insert section headers in the
528528
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: ::
530530

531531
module Foo where
532532

@@ -601,7 +601,7 @@ re-exporting module.
601601
It is often desirable to include a chunk of documentation which is not
602602
attached to any particular Haskell declaration, for example, when
603603
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
605605
chunks at the top of the file, as part of the
606606
:ref:`module-description`, you can also associate them with
607607
:ref:`section-headings`.
@@ -655,14 +655,14 @@ headings, depending on whether you are using an export list or not:
655655
-- Here is a large chunk of documentation which may be referred to by
656656
-- the name $doc.
657657

658-
Just like with entity declariations when not using an export list,
658+
Just like with entity declarations when not using an export list,
659659
named chunks of documentation are associated with the preceding
660660
section header here, or with the implicit top-level documentation
661661
section if there is no preceding section header.
662662

663663
**Warning**: the form used in the first bullet above, where the
664664
chunk is not named, *does not work* when you aren't using an
665-
export list. For example ::
665+
export list. For example: ::
666666

667667
module Foo where
668668

@@ -673,7 +673,7 @@ headings, depending on whether you are using an export list or not:
673673
-- | The fooifier.
674674
foo :: ...
675675

676-
will result in ``Some documentation not ...`` being attached to
676+
will result in ``Some documentation not ...`` being attached to the
677677
*next* entity declaration, here ``foo``, in addition to any other
678678
documentation that next entity already has!
679679

@@ -743,7 +743,7 @@ type in ``C`` will therefore point locally to ``C.T``.
743743
Module Attributes
744744
-----------------
745745

746-
Certain attributes may be specified for each module which affects the
746+
Certain attributes may be specified for each module which affect the
747747
way that Haddock generates documentation for that module. Attributes are
748748
specified in a comma-separated list in an
749749
``{-# OPTIONS_HADDOCK ... #-}`` pragma at the top of the module, either
@@ -794,7 +794,7 @@ Markup
794794

795795
Haddock understands certain textual cues inside documentation
796796
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
798798
the programmer doesn't have to deal with heavyweight annotations when
799799
editing documentation comments.
800800

@@ -807,8 +807,8 @@ comment.
807807
Special Characters
808808
~~~~~~~~~~~~~~~~~~
809809

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
812812
literal occurrence of one of these special characters, precede it with a
813813
backslash (``\``).
814814

@@ -826,7 +826,7 @@ Character References
826826

827827
Although Haskell source files may contain any character from the Unicode
828828
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
830830
are portable. Other characters may be specified in character and string
831831
literals using Haskell character escapes. To represent such characters
832832
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
913913
link pointing to the entity ``T`` exported from module ``M`` (without
914914
checking to see whether either ``M`` or ``M.T`` exist).
915915

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: ::
920921

921922
-- | An implicit reference to 'X', the type constructor
922923
-- An explicit reference to v'X', the data constructor
@@ -973,7 +974,7 @@ Itemized and Enumerated Lists
973974

974975
A bulleted item is represented by preceding a paragraph with either
975976
“``*``” 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.: ::
977978

978979
-- | This is a bulleted list:
979980
--
@@ -1012,7 +1013,7 @@ You can have more than one line of content in a list element: ::
10121013

10131014
You can even nest whole paragraphs inside of list elements. The rules
10141015
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: ::
10161017

10171018
{-|
10181019
* Beginning of list
@@ -1099,7 +1100,7 @@ followed by the URL enclosed in regular parentheses, for example: ::
10991100

11001101
[some link](http://example.com)
11011102

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
11031104
format supports it.
11041105

11051106
Images
@@ -1112,8 +1113,8 @@ like this: ::
11121113
![image description](pathtoimage.png)
11131114

11141115
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.
11171118

11181119
Mathematics / LaTeX
11191120
~~~~~~~~~~~~~~~~~~~
@@ -1133,7 +1134,13 @@ the mathematics via `MathJax <https://www.mathjax.org>`__.
11331134
Grid Tables
11341135
~~~~~~~~~~~
11351136

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. ::
11371144

11381145
-- | This is a grid table:
11391146
--
@@ -1225,7 +1232,7 @@ Since
12251232
^^^^^
12261233

12271234
``@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
12291236
the user. ``@since`` is a paragraph-level element. While multiple such
12301237
annotations are not an error, only the one to appear in the comment last
12311238
will be used. ``@since`` has to be followed with a version number, no

0 commit comments

Comments
 (0)