Skip to content

Commit

Permalink
Fix haddocks for TreeRenderingTutorial and StackMachineTutorial (quch…
Browse files Browse the repository at this point in the history
  • Loading branch information
sjakobi authored Jan 12, 2020
1 parent f6313a2 commit a17f465
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
-- source form.
module Data.Text.Prettyprint.Doc.Render.Tutorials.StackMachineTutorial
{-# DEPRECATED "Writing your own stack machine is probably more efficient and customizable; also consider using »renderSimplyDecorated(A)« instead" #-}
(
module Data.Text.Prettyprint.Doc.Render.Tutorials.StackMachineTutorial
) where


where

import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
Expand All @@ -36,11 +32,9 @@ import Data.Text.Prettyprint.Doc.Render.Util.StackMachine
import Control.Applicative
#endif



-- $standalone-text
-- * The type of available markup
--
-- = The type of available markup
-- $standalone-text
--
-- First, we define a set of valid annotations must be defined, with the goal of
-- defining a @'Doc' 'SimpleHtml'@. We will later define how to convert this to
Expand All @@ -49,11 +43,7 @@ import Control.Applicative
data SimpleHtml = Bold | Italics | Color Color | Paragraph | Headline
data Color = Red | Green | Blue



-- $standalone-text
--
-- == Conveinence definitions
-- ** Convenience definitions

bold, italics, paragraph, headline :: Doc SimpleHtml -> Doc SimpleHtml
bold = annotate Bold
Expand All @@ -64,11 +54,9 @@ headline = annotate Headline
color :: Color -> Doc SimpleHtml -> Doc SimpleHtml
color c = annotate (Color c)



-- $standalone-text
-- * The rendering algorithm
--
-- = The rendering algorithm
-- $standalone-text
--
-- With the annotation definitions out of the way, we can now define a
-- conversion function from 'SimpleDocStream' annotated with our 'SimpleHtml' to the
Expand Down Expand Up @@ -149,9 +137,9 @@ render doc
<> show (length remainingStyles)
<> " unpaired styles! Please report this as a bug.")

-- $standalone-text
-- * Example invocation
--
-- = Example invocation
-- $standalone-text
--
-- We can now render an example document using our definitions:
--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
--
-- The module is written to be readable top-to-bottom in both Haddock and raw
-- source form.
module Data.Text.Prettyprint.Doc.Render.Tutorials.TreeRenderingTutorial (
module Data.Text.Prettyprint.Doc.Render.Tutorials.TreeRenderingTutorial
) where


module Data.Text.Prettyprint.Doc.Render.Tutorials.TreeRenderingTutorial where

import qualified Data.Text as T
import qualified Data.Text.Lazy as TL
Expand All @@ -33,11 +29,9 @@ import Data.Foldable (foldMap)
import Data.Semigroup
#endif



-- $standalone-text
-- * The type of available markup
--
-- = The type of available markup
-- $standalone-text
--
-- First, we define a set of valid annotations must be defined, with the goal of
-- defining a @'Doc' 'SimpleHtml'@. We will later define how to convert this to
Expand All @@ -46,11 +40,7 @@ import Data.Semigroup
data SimpleHtml = Bold | Italics | Color Color | Paragraph | Headline
data Color = Red | Green | Blue



-- $standalone-text
--
-- == Conveinence definitions
-- ** Convenience definitions

bold, italics, paragraph, headline :: Doc SimpleHtml -> Doc SimpleHtml
bold = annotate Bold
Expand All @@ -61,8 +51,9 @@ headline = annotate Headline
color :: Color -> Doc SimpleHtml -> Doc SimpleHtml
color c = annotate (Color c)


-- = The rendering algorithm
-- * The rendering algorithm
--
-- $standalone-text
--
-- With the annotation definitions out of the way, we can now define a
-- conversion function from 'SimpleDocStream' (annotated with our 'SimpleHtml')
Expand Down Expand Up @@ -116,9 +107,9 @@ encloseInTagFor sh = case sh of
Green -> "#0f0"
Blue -> "#00f"

-- $standalone-text
-- * Example invocation
--
-- = Example invocation
-- $standalone-text
--
-- We can now render an example document using our definitions:
--
Expand Down

0 comments on commit a17f465

Please sign in to comment.