diff --git a/src/Xrefcheck/CLI.hs b/src/Xrefcheck/CLI.hs index 2db27f43..58d7094f 100644 --- a/src/Xrefcheck/CLI.hs +++ b/src/Xrefcheck/CLI.hs @@ -31,7 +31,7 @@ import Options.Applicative (Mod, OptionFields, Parser, ReadM, auto, command, eitherReader, execParser, flag, flag', footerDoc, fullDesc, help, helpDoc, helper, hsubparser, info, infoOption, long, metavar, option, progDesc, short, strOption, switch, value) -import Options.Applicative.Help.Pretty (Doc, displayS, fill, fillSep, indent, renderPretty, text) +import Options.Applicative.Help.Pretty (Doc, fill, fillSep, indent, pretty) import Options.Applicative.Help.Pretty qualified as Pretty import Text.Interpolation.Nyan @@ -289,17 +289,13 @@ getCommand = do footerDoc (pure ignoreModesMsg) ignoreModesMsg :: Doc -ignoreModesMsg = text $ header <> body +ignoreModesMsg = text header <> body where header = "To ignore a link in your markdown, \ \include \"\"\n\ \comment with one of these modes:\n" - body = displayS (renderPretty pageParam pageWidth doc) "" - pageWidth = 80 - pageParam = 1 - - doc = fillSep $ map formatDesc modeDescr + body = fillSep $ map formatDesc modeDescr modeDescr = [ (" \"link\"", L.words "Ignore the link right after the comment.") @@ -314,3 +310,6 @@ ignoreModesMsg = text $ header <> body formatDesc (mode, descr) = fill modeIndent (text mode) <> indent descrIndent (fillSep $ map text descr) + +text :: String -> Doc +text = pretty