From 0861affeca4d72938f05a2eceddfae2c19199071 Mon Sep 17 00:00:00 2001 From: Simon Jakobi Date: Fri, 20 Jul 2018 15:06:06 +0200 Subject: Additional tests for the identifier parser (#816) * Add tests for the identifier parser * docs: Clarify how to delimit identifiers --- doc/markup.rst | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'doc/markup.rst') diff --git a/doc/markup.rst b/doc/markup.rst index acabaa28..590bee00 100644 --- a/doc/markup.rst +++ b/doc/markup.rst @@ -845,10 +845,13 @@ Hyperlinked Identifiers ~~~~~~~~~~~~~~~~~~~~~~~ Referring to a Haskell identifier, whether it be a type, class, -constructor, or function, is done by surrounding it with single quotes: :: +constructor, or function, is done by surrounding it with a combination +of single quotes and backticks. For example: :: -- | This module defines the type 'T'. +```T``` is also ok. ``'T``` and ```T'`` are accepted but less common. + If there is an entity ``T`` in scope in the current module, then the documentation will hyperlink the reference in the text to the definition of ``T`` (if the output format supports hyperlinking, of course; in a @@ -876,14 +879,6 @@ apostrophes themselves: to hyperlink ``foo'`` one would simply type ``'foo''``. To hyperlink identifiers written in infix form, simply put them in quotes as always: ``'`elem`'``. -For compatibility with other systems, the following alternative form of -markup is accepted [3]_: ```T'``. - -.. [3] - We chose not to use this as the primary markup for identifiers - because strictly speaking the ````` character should not be used as a - left quote, it is a grave accent. - Emphasis, Bold and Monospaced Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 532b209d127e4cecdbf7e9e3dcf4f653a5605b5a Mon Sep 17 00:00:00 2001 From: Masahiro Sakai Date: Sat, 21 Jul 2018 00:06:42 +0900 Subject: Add # as a special character (#884) '#' has special meaning used for anchors and can be escaped using backslash. Therefore it would be nice to be listed as special characters. --- doc/markup.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/markup.rst') diff --git a/doc/markup.rst b/doc/markup.rst index 590bee00..e22c25e7 100644 --- a/doc/markup.rst +++ b/doc/markup.rst @@ -762,7 +762,7 @@ Special Characters ~~~~~~~~~~~~~~~~~~ The following characters have special meanings in documentation -comments: ``\\``, ``/``, ``'``, ``\```, ``"``, ``@``, ``<``, ``$``. To insert a +comments: ``\\``, ``/``, ``'``, ``\```, ``"``, ``@``, ``<``, ``$``, ``#``. To insert a literal occurrence of one of these special characters, precede it with a backslash (``\\``). -- cgit v1.2.3 From 9712d8899d452292913a260058a6dd3346e8d39b Mon Sep 17 00:00:00 2001 From: Noel Bourke Date: Tue, 21 Aug 2018 08:34:18 +0100 Subject: Remove unnecessary backslashes from docs (#908) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On https://haskell-haddock.readthedocs.io/en/latest/markup.html#special-characters the backslash and backtick special characters showed up with an extra backslash before them – I think the escaping is not (or no longer) needed for those characters in rst. --- doc/markup.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/markup.rst') diff --git a/doc/markup.rst b/doc/markup.rst index e22c25e7..edbd45b2 100644 --- a/doc/markup.rst +++ b/doc/markup.rst @@ -762,14 +762,14 @@ Special Characters ~~~~~~~~~~~~~~~~~~ The following characters have special meanings in documentation -comments: ``\\``, ``/``, ``'``, ``\```, ``"``, ``@``, ``<``, ``$``, ``#``. To insert a +comments: ``\``, ``/``, ``'``, `````, ``"``, ``@``, ``<``, ``$``, ``#``. To insert a literal occurrence of one of these special characters, precede it with a -backslash (``\\``). +backslash (``\``). Additionally, the character ``>`` has a special meaning at the beginning of a line, and the following characters have special meanings at the beginning of a paragraph: ``*``, ``-``. These characters can also be -escaped using ``\\``. +escaped using ``\``. Furthermore, the character sequence ``>>>`` has a special meaning at the beginning of a line. To escape it, just prefix the characters in the -- cgit v1.2.3