Module

FPO.Dto.DocumentDto.TreeDto

This module defines the document tree structure with meta information. The meta map is not part of this (one layer above).

#Edge

data Edge a

Constructors

Instances

#Meta

newtype Meta

Metadata for a tree node. title is a html-escaped string that represents the title of the node. label is an optional html-escaped string that represents the label of the node (e.g. "§x", etc.). It can be Nothing if the node has no label.

Note: Altough the label and title are html-escaped strings, they should not contain any html tags except for <span> and </span>. Because there is no convenient way to insert raw html into Halogen rendering, we can drop these tags before rendering (using, e.g., getFullTitle). This isn't a perfect solution, but easier than other approaches. We could use FPO.UI.HTML.rawHtml, but this would not work for tooltips... TODO: This workaround causes a bug where some special characters are not rendered correctly, see issue #656.

Constructors

Instances

#Result

data Result a

Signals if a generated TOC title was parsed successfully or not.

Constructors

Instances

#RootTree

data RootTree a

Constructors

Instances

#Tree

data Tree a

Constructors

Instances

#TreeHeader

newtype TreeHeader

Constructors

Instances

#errorMeta

#findRootTree

findRootTree :: forall a. (a -> Boolean) -> RootTree a -> Maybe a

#findTitleRootTree

findTitleRootTree :: forall a. (a -> Boolean) -> RootTree a -> Maybe String

#firstLeafRootTree

firstLeafRootTree :: forall a. RootTree a -> Maybe a

#getContent

getContent :: forall a. Result a -> a

#getContentOr

getContentOr :: forall a. a -> Result (Maybe a) -> a

#getEdgeTree

getEdgeTree :: forall a. Edge a -> Tree a

#getFullTitle

getFullTitle :: Meta -> String

Returns the full title of the node, including the label if it exists. Removes HTML tags.

#getHeading

#modifyNodeRootTree

modifyNodeRootTree :: forall a. (a -> Boolean) -> (a -> a) -> RootTree a -> RootTree a

#replaceNodeRootTree

replaceNodeRootTree :: forall a. (a -> Boolean) -> a -> RootTree a -> RootTree a

#unspecifiedMeta

#updateHeading

updateHeading :: String -> TreeHeader -> TreeHeader

Updates the heading of a TreeHeader.

Modules