packages feed

mdoc 0.4.1.3 → 0.4.1.4

raw patch · 5 files changed

+27/−9 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Mdoc.Examples.OptEnvConf: conf5 :: Named
+ Mdoc.Examples.OptEnvConf: crontab5 :: Named

Files

examples/crontab.5 view
@@ -16,6 +16,15 @@ .It Cm bar.bat : Ar number Ns [] Bar's bat is better than that (required)+.Pp+Example:+.Bd -literal -offset indent+# enable bat+bat: 1+.Pp+# disable bat+bat: 0+.Ed .It Cm bar.baz : Ar boolean Bar's baz of bazzle (required)
mdoc.cabal view
@@ -1,6 +1,6 @@ cabal-version:      1.18 name:               mdoc-version:            0.4.1.3+version:            0.4.1.4 license:            AGPL-3 license-file:       COPYING maintainer:         Pat Brisbin
src/Mdoc/Examples/OptEnvConf.hs view
@@ -7,7 +7,7 @@ -- Stability   : experimental -- Portability : POSIX module Mdoc.Examples.OptEnvConf-  ( conf5+  ( crontab5   , example1   , examplerc5   ) where@@ -20,8 +20,8 @@ import OptEnvConf hiding (name) import OptEnvConf.Mdoc -conf5 :: Named-conf5 =+crontab5 :: Named+crontab5 =   mempty     & (<> getPage confParser)     & setSynopsis@@ -40,8 +40,11 @@ confParser = void $ (,)   <$> setting [conf @String "foo", help "Foo's the fooing of fooers"]   <*> subConfig "bar" ((,)-    <$> setting [conf @Bool "baz", help "Bar's baz of bazzle"]-    <*> setting [conf @[Int] "bat", help "Bar's bat is better than that"])+    <$> setting [ conf @Bool "baz", help "Bar's baz of bazzle"]+    <*> setting [ conf @[Int] "bat", help "Bar's bat is better than that"+                , example "# enable bat\nbat: 1"+                , example "# disable bat\nbat: 0"+                ]) {- FOURMOLU_ENABLE -}  example1 :: Named@@ -66,7 +69,7 @@ {- FOURMOLU_DISABLE -} exampleParser :: Parser () exampleParser = void $ (,,,,,)-  <$>           switch'   [           long "debug",                    help "Enable debug", env "DEBUG", conf "debug", example "# enable debug" , example "debug: true"]+  <$>           switch'   [           long "debug",                    help "Enable debug", env "DEBUG", conf "debug", example "# enable debug\ndebug: true"]   <*>           switch'   [short 'v', long "verbose",                                                    conf "verbose"]   <*> (         switch'   [short 'a', long "apple",                    help "Use apples"]     <|>         switch'   [short 'b', long "banana",                   help "Use bananas"])
src/OptEnvConf/Mdoc.hs view
@@ -49,6 +49,7 @@ import Autodocodec.Schema.Mdoc qualified as JSONSchema import Control.Monad (foldM) import Control.Monad.State (MonadState (..), evalState, modify)+import Data.Text qualified as T import Mdoc.Data.Argument import Mdoc.Data.Command import Mdoc.Data.Config@@ -168,7 +169,12 @@         }  exampleMdoc :: NonEmpty String -> Mdoc-exampleMdoc = Mdoc . map (TextLine . esc . pack) . toList+exampleMdoc ne =+  ne+    & toList -- [x]+    & map (map TextLine . T.lines . pack) -- [[x, y], [z]]+    & intercalate [MacroLine Pp []] -- [x, y, Pp, z]+    & Mdoc  dashedFlags :: [Dashed] -> Maybe Flag dashedFlags = fmap go . nonEmpty
test/Mdoc/ExamplesSpec.hs view
@@ -42,7 +42,7 @@   it "pass.1" $ exampleGolden man1 pass1 1   it "docker.1" $ exampleGolden man1 docker1 1   it "mandoc.1" $ exampleGolden man1 mandoc1 1-  it "conf.5" $ exampleGolden man5 conf5 5+  it "crontab.5" $ exampleGolden man5 crontab5 5   it "examplerc.5" $ exampleGolden man5 examplerc5 5   it "person.5" $ exampleGolden man5 person5 5