HTMell-0.1.0.0: Minimal filesystem powered markdown content management system
Copyright(c) 2021-2022 Mirko Westermeier
LicenseMIT
Safe HaskellSafe-Inferred
LanguageHaskell2010

HTMell.Tree.Load.Transformations

Description

This module is a collection of all tree modifications used in buildTree (and loadHTMell). They are applied in a chain of processTree calls and do not need to be used outside of HTMell. For details on the somewhat strange signatures, refer to processTree.

Synopsis

Content of inner nodes

While a leaf of the content tree gets its content from a file, it is not immediately clear for (inner) directories that they can also contain content. "index" children to the rescue!

Caveat: Don't use directories named "index"!

indexContent :: String -> Maybe b -> [Tree (String, Maybe b)] -> Tree (String, Maybe b) #

Attaches the content of a content tree leaf to its parent HTree if its children name is "index".

removeIndex :: String -> Maybe c -> [HTree c] -> Tree (String, Maybe c) #

Removes all children named "index".

Tree cleansing

noEmptyLeaves :: String -> Maybe c -> [Tree (String, Maybe c)] -> Tree (String, Maybe c) #

Removes content tree leaves with Nothing as their content.