diff options
Diffstat (limited to 'utils/mkUserGuidePart/Main.hs')
-rw-r--r-- | utils/mkUserGuidePart/Main.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/utils/mkUserGuidePart/Main.hs b/utils/mkUserGuidePart/Main.hs index b30cc8f01d..41e8e40f86 100644 --- a/utils/mkUserGuidePart/Main.hs +++ b/utils/mkUserGuidePart/Main.hs @@ -52,13 +52,11 @@ flagsTable theFlags = ["Flag", "Description", "Static/Dynamic", "Reverse"] (map flagRow theFlags) where - code "" = "" - code str = "``"++str++"``" flagRow flag = - [ code (flagName flag) + [ role "ghc-flag" (flagName flag) , flagDescription flag , type_ - , code (flagReverse flag) + , role "ghc-flag" (flagReverse flag) ] where type_ = case flagType flag of @@ -71,6 +69,12 @@ flagsTable theFlags = inlineCode :: String -> ReST inlineCode s = "``" ++ s ++ "``" +-- | @role "hi" "Hello world"@ produces the ReST inline role element +-- @:hi:`Hello world`@. +role :: String -> String -> ReST +role _ "" = "" +role r c = concat [":",r,":`",c,"`"] + heading :: Char -> String -> ReST heading chr title = unlines [ title |