-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve restyled.yaml.5 #287
Conversation
main = do | ||
getArgs >>= \case | ||
["__render-docs-man1__"] -> renderDocsPage Restyle1 | ||
["__render-docs-man5__"] -> renderDocsPage RestyledYaml5 | ||
_ -> pure () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving this here is better, and idiomatic according to ronn
documentation.
, env "DRY_RUN" | ||
, conf "dry_run" | ||
] | ||
withDefault False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using withDefault
is needed for yesNoSwitch
. Defaults added with value
don't show up in docs.
withShownByDefault :: (a -> String) -> a -> Parser a -> Parser a | ||
withShownByDefault f a = withShownDefault a (f a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal here is to retire any existing configuration docs (which are already out of sync) and instead link to the generated man-page that is automatically maintained with the help of opt-env-conf and ronn libraries.
To do this, we:
default.yaml
, put defaults into the settings buildershelp
andexample
to approximate current docsronn-opt-env-conf
+ bespoke template building to generate a readablerestyled.yaml.5
As of this PR we're pretty close, we're only missing the
restylers
documentation and examples, since that's a lot of important text, I'd like to work on it separately after.