Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Restore missing variant headers
Browse files Browse the repository at this point in the history
  • Loading branch information
samhedin committed Jul 22, 2020
1 parent c7981c3 commit ac646fe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ main :: IO ()
main = toJSONFilter runAll

runAll :: [Block] -> [Block]
runAll = map (fixBulletList . makeTitle . sections . cleanBlock)
--runAll b = b
runAll b = map (fixBulletList . makeTitle . sections . cleanBlock) b

emptyAttrs :: (T.Text, [T.Text], [(T.Text, T.Text)])
emptyAttrs = ("", [], [])
Expand Down Expand Up @@ -57,7 +58,7 @@ cleanBlock block = case block of
== "toggle-wrapper"
-> Null

(Div (_, [_, section], _) _) | section == "small-section-header" -> Null
(Div (_, [_, section], _) blocks) | section == "small-section-header" -> Div emptyAttrs $ map cleanBlock blocks

(Para [Link _ [] _]) -> Null

Expand Down Expand Up @@ -141,7 +142,7 @@ mkNotice = foldr

sections :: Block -> Block
sections b = case b of
(Plain [Link _ _ (url, _), Code (id, _, _) code]) ->
(Plain [Link _ _ (_, _), Code (_, _, _) code]) ->
Header 3 emptyAttrs [Code emptyAttrs code]
(Div (_, classnames, _) blocks) | "stability" `elem` classnames ->
Plain $ mkNotice blocks
Expand Down

0 comments on commit ac646fe

Please sign in to comment.