Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade the Tags list

  • Loading branch information...
commit 5b3233b476cb4fec4d9cb7119c1c5b2b3e10d949 1 parent 22860b7
Nicolas Pouillard authored
Showing with 23 additions and 17 deletions.
  1. +23 −17 Text/TDoc/Tags.hs
40 Text/TDoc/Tags.hs
View
@@ -139,13 +139,6 @@ bold = spanDocCA "bold"
--
-$(node "Subsection" [NoTag] [] [])
-instance IsBlock a => IsChildOf a Subsection
-class SubsectionTag t where
- subsectionTag :: (a `IsChildOf` Span) => TDoc t a -> t Subsection
-subsection :: forall a b t. (SubsectionTag t, a `IsChildOf` Span, ToTDoc b t a) => b -> Star t Subsection
-subsection t = tStar (subsectionTag (toTDoc t :: TDoc t a))
-
data Div a
class DivTag t where divTag :: t (Div a)
div :: DivTag t => Star t (Div a)
@@ -155,6 +148,13 @@ instance IsBlock a => IsBlock (Div a)
instance IsBlockOrInline a => IsBlockOrInline (Div a)
instance IsChildOf b a => IsChildOf b (Div a)
+$(node "Subsection" [NoTag] [] [])
+instance IsBlock a => IsChildOf a Subsection
+class SubsectionTag t where
+ subsectionTag :: (a `IsChildOf` Span) => TDoc t a -> t Subsection
+subsection :: forall a b t. (SubsectionTag t, a `IsChildOf` Span, ToTDoc b t a) => b -> Star t Subsection
+subsection t = tStar (subsectionTag (toTDoc t :: TDoc t a))
+
$(node "Section" [NoTag] [] [''Paragraph, ''UList, ''Table, ''Hr, ''Subsection])
-- instance IsBlock a => IsChildOf a Section
instance a ~ Section => IsChildOf (Div a) Section
@@ -193,23 +193,29 @@ root :: forall t doc preambule. (RootTag t, ToTDoc preambule t Preambule, ToTDoc
root x y = tStar rootTag [ Child (toTDoc x :: TDoc t Preambule)
, Child (toTDoc y :: TDoc t Document) ]
-class (SpanTag t
- ,AnchorTag t
- ,ItemTag t
- ,UListTag t
+class (AttributeTags t
+ ,LeafTags t
,ParagraphTag t
+ ,TitleTag t
,BrTag t
,HrTag t
- ,TableTag t
- ,RowTag t
,ColTag t
,HColTag t
- ,AttributeTags t
+ ,RowTag t
+ ,TableTag t
+ ,ItemTag t
+ ,UListTag t
+ ,SpanTag t
+ ,DivTag t
+ ,SubsectionTag t
+ ,SectionTag t
+ ,HLinkTag t
+ ,AnchorTag t
,ImageTag t
- ,RootTag t
- ,DocumentTag t
,PreambuleTag t
- ,LeafTags t) => Tags t where
+ ,DocumentTag t
+ ,RootTag t
+ ) => Tags t where
-- since their is no 'instance IsChildOf X Leaf'
-- one cannot build a 'TNode attrs [x] :: Tags t => TDoc t Leaf'
Please sign in to comment.
Something went wrong with that request. Please try again.