Skip to content
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

Merged
merged 9 commits into from
Nov 4, 2024
Merged

Improve restyled.yaml.5 #287

merged 9 commits into from
Nov 4, 2024

Conversation

pbrisbin
Copy link
Member

@pbrisbin pbrisbin commented Nov 4, 2024

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:

  1. Stop using default.yaml, put defaults into the settings builders
  2. Expand help and example to approximate current docs
  3. Use ronn-opt-env-conf + bespoke template building to generate a readable restyled.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.

@pbrisbin pbrisbin added the chore label Nov 4, 2024
@pbrisbin pbrisbin changed the title pb/config Improve restyled.yaml.5 Nov 4, 2024
Comment on lines +24 to +28
main = do
getArgs >>= \case
["__render-docs-man1__"] -> renderDocsPage Restyle1
["__render-docs-man5__"] -> renderDocsPage RestyledYaml5
_ -> pure ()
Copy link
Member Author

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
Copy link
Member Author

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.

Comment on lines +101 to +102
withShownByDefault :: (a -> String) -> a -> Parser a -> Parser a
withShownByDefault f a = withShownDefault a (f a)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pbrisbin pbrisbin merged commit b849b50 into main Nov 4, 2024
8 checks passed
@pbrisbin pbrisbin deleted the pb/config branch November 4, 2024 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant