diff options
-rw-r--r-- | doc/haddock.xml | 10 | ||||
-rw-r--r-- | src/Haddock/Backends/Xhtml/DocMarkup.hs | 2 | ||||
-rw-r--r-- | src/Haddock/Lex.x | 6 | ||||
-rw-r--r-- | src/Haddock/Types.hs | 2 | ||||
-rw-r--r-- | tests/golden-tests/tests/Examples.hs | 14 | ||||
-rw-r--r-- | tests/golden-tests/tests/Examples.html.ref | 14 |
6 files changed, 24 insertions, 24 deletions
diff --git a/doc/haddock.xml b/doc/haddock.xml index 58047598..39c4f9d2 100644 --- a/doc/haddock.xml +++ b/doc/haddock.xml @@ -1508,9 +1508,9 @@ module A where <literal>*</literal>, <literal>-</literal>. These characters can also be escaped using <literal>\</literal>.</para> - <para>Furthermore, the character sequence <literal>ghci></literal> + <para>Furthermore, the character sequence <literal>>>></literal> has a special meaning at the beginning of a line. To - escape it, just prefix the <literal>></literal> character with a + escape it, just prefix the characters in the sequence with a backslash.</para> </section> @@ -1568,16 +1568,16 @@ module A where <para> Haddock has markup support for examples of interaction with a <emphasis>read-eval-print loop (REPL)</emphasis>. An example is introduced with - <literal>ghci></literal> followed by an expression followed + <literal>>>></literal> followed by an expression followed by zero or more result lines:</para> <programlisting> -- | Two examples are given bellow: -- --- ghci> fib 10 +-- >>> fib 10 -- 55 -- --- ghci> putStrLn "foo\nbar" +-- >>> putStrLn "foo\nbar" -- foo -- bar </programlisting> diff --git a/src/Haddock/Backends/Xhtml/DocMarkup.hs b/src/Haddock/Backends/Xhtml/DocMarkup.hs index b1260a9c..be9ae876 100644 --- a/src/Haddock/Backends/Xhtml/DocMarkup.hs +++ b/src/Haddock/Backends/Xhtml/DocMarkup.hs @@ -69,7 +69,7 @@ parHtmlMarkup ppId isTyCon = Markup { exampleToHtml (Example expression result) = htmlExample where htmlExample = htmlPrompt +++ htmlExpression +++ (toHtml $ unlines result) - htmlPrompt = (thecode . toHtml $ "ghci> ") ! [theclass "prompt"] + htmlPrompt = (thecode . toHtml $ ">>> ") ! [theclass "prompt"] htmlExpression = (strong . thecode . toHtml $ expression ++ "\n") ! [theclass "userinput"] diff --git a/src/Haddock/Lex.x b/src/Haddock/Lex.x index fc3b3d51..4f877fc9 100644 --- a/src/Haddock/Lex.x +++ b/src/Haddock/Lex.x @@ -48,7 +48,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] <0,para> { $ws* \n ; $ws* \> { begin birdtrack } - $ws* ghci \> { strtoken TokExamplePrompt `andBegin` exampleexpr } + $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* [\*\-] { token TokBullet `andBegin` string } $ws* \[ { token TokDefStart `andBegin` def } $ws* \( $digit+ \) { token TokNumber `andBegin` string } @@ -59,7 +59,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] -- beginning of a line <line> { $ws* \> { begin birdtrack } - $ws* ghci \> { strtoken TokExamplePrompt `andBegin` exampleexpr } + $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } $ws* \n { token TokPara `andBegin` para } -- Here, we really want to be able to say -- $ws* (\n | <eof>) { token TokPara `andBegin` para} @@ -74,7 +74,7 @@ $ident = [$alphanum \'\_\.\!\#\$\%\&\*\+\/\<\=\>\?\@\\\\\^\|\-\~\:] <example> { $ws* \n { token TokPara `andBegin` para } - $ws* ghci \> { strtoken TokExamplePrompt `andBegin` exampleexpr } + $ws* \>\>\> { strtoken TokExamplePrompt `andBegin` exampleexpr } () { begin exampleresult } } diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs index 3ec37469..33892e49 100644 --- a/src/Haddock/Types.hs +++ b/src/Haddock/Types.hs @@ -296,7 +296,7 @@ data Example = Example exampleToString :: Example -> String exampleToString (Example expression result) = - "ghci> " ++ expression ++ "\n" ++ unlines result + ">>> " ++ expression ++ "\n" ++ unlines result data DocMarkup id a = Markup { diff --git a/tests/golden-tests/tests/Examples.hs b/tests/golden-tests/tests/Examples.hs index ed22b614..7b703428 100644 --- a/tests/golden-tests/tests/Examples.hs +++ b/tests/golden-tests/tests/Examples.hs @@ -4,28 +4,28 @@ module Examples where -- -- Examples: -- --- ghci> fib 5 +-- >>> fib 5 -- 5 --- ghci> fib 10 +-- >>> fib 10 -- 55 -- --- ghci> fib 10 +-- >>> fib 10 -- 55 -- -- One more Example: -- --- ghci> fib 5 +-- >>> fib 5 -- 5 -- -- One more Example: -- --- ghci> fib 5 +-- >>> fib 5 -- 5 -- -- Example with an import: -- --- ghci> import Data.Char --- ghci> isSpace 'a' +-- >>> import Data.Char +-- >>> isSpace 'a' -- False -- fib :: Integer -> Integer diff --git a/tests/golden-tests/tests/Examples.html.ref b/tests/golden-tests/tests/Examples.html.ref index 9139ac80..3bf475ab 100644 --- a/tests/golden-tests/tests/Examples.html.ref +++ b/tests/golden-tests/tests/Examples.html.ref @@ -3,20 +3,20 @@ window.onload = function () {pageLoad();setSynopsis("mini_Examples.html");}; //]]> </script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><A HREF="">Contents</a></li><li><A HREF="">Index</a></li></ul><p class="caption" class="empty"> </p></div><div id="content"><div id="module-header"><p class="caption">Examples</p></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><A HREF="">fib</a> :: <A HREF="">Integer</a> -> <A HREF="">Integer</a></li></ul></div><div id="interface"><h1>Documentation</h1><div class="top"><p class="src"><a name="v:fib" class="def">fib</a> :: <A HREF="">Integer</a> -> <A HREF="">Integer</a></p><div class="doc"><p>Fibonacci number of given <code><A HREF="">Integer</a></code>. </p><p>Examples: -</p><pre class="screen"><code class="prompt">ghci> </code><strong class="userinput"><code>fib 5 +</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>fib 5 </code></strong>5 -<code class="prompt">ghci> </code><strong class="userinput"><code>fib 10 +<code class="prompt">>>> </code><strong class="userinput"><code>fib 10 </code></strong>55 -</pre><pre class="screen"><code class="prompt">ghci> </code><strong class="userinput"><code>fib 10 +</pre><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>fib 10 </code></strong>55 </pre><p>One more Example: -</p><pre class="screen"><code class="prompt">ghci> </code><strong class="userinput"><code>fib 5 +</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>fib 5 </code></strong>5 </pre><p>One more Example: -</p><pre class="screen"><code class="prompt">ghci> </code><strong class="userinput"><code>fib 5 +</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>fib 5 </code></strong>5 </pre><p>Example with an import: -</p><pre class="screen"><code class="prompt">ghci> </code><strong class="userinput"><code>import Data.Char -</code></strong><code class="prompt">ghci> </code><strong class="userinput"><code>isSpace 'a' +</p><pre class="screen"><code class="prompt">>>> </code><strong class="userinput"><code>import Data.Char +</code></strong><code class="prompt">>>> </code><strong class="userinput"><code>isSpace 'a' </code></strong>False </pre></div></div></div></div><div id="footer"><p>Produced by <A HREF="">Haddock</a> version 2.8.0</p></div></body></html>
\ No newline at end of file |