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

(hack) Convert guides to YAML and pretty print #2937

Merged
merged 1 commit into from
Jul 20, 2021

Conversation

lucywyman
Copy link
Contributor

When we first implemented the guide subcommand, we chose to make the
file format of guides flat text and documented how users could add their
own guides to Bolt to be loaded by the bolt guide subcommand. While
useful, we haven't seen anyone use this functionality, and further it
does not seem like the file format has much impact on whether users add
their own guides or not. This converts the file format from flat text to
YAML, which supports both being read as data and formatting multiline
strings. This lets us format the bolt guide <guide> output to be more
readable and inline with other bolt output, make the guide text easily
editable (as opposed to JSON), and still lets users add their own guides
if they choose.

!feature

  • Beautify bolt guide output (hack)
    This converts our existing guides from flat text to YAML so that they
    can be pretty printed.

@lucywyman lucywyman force-pushed the hack/yaml-guides branch 2 times, most recently from d1a9afc to aba0105 Compare July 16, 2021 22:17
@beechtom
Copy link
Contributor

Since these now need to be parsed before printing, should the guides just be data in Bolt instead of separate files?

@lucywyman
Copy link
Contributor Author

I don't think so - this still allows people to add their own guides if they'd like, plus having so much text as code is kind of awful, plus having these be JSON makes them more difficult to format so keeping them as YAML is preferable. I don't see any advantage to changing where they're loaded from.

@lucywyman lucywyman marked this pull request as ready for review July 19, 2021 14:40
@lucywyman lucywyman requested review from hestonhoffman and a team as code owners July 19, 2021 14:40
guides/guide.txt Show resolved Hide resolved
guides/debugging.yaml Outdated Show resolved Hide resolved
guides/logging.yaml Outdated Show resolved Hide resolved
guides/module.yaml Show resolved Hide resolved
guides/targets.yaml Outdated Show resolved Hide resolved
guides/transports.yaml Outdated Show resolved Hide resolved
rakelib/pwsh.rake Outdated Show resolved Hide resolved
guides/logging.yaml Show resolved Hide resolved
When we first implemented the `guide` subcommand, we chose to make the
file format of guides flat text and documented how users could add their
own guides to Bolt to be loaded by the `bolt guide` subcommand. While
useful, we haven't seen anyone use this functionality, and further it
does not seem like the file format has much impact on whether users add
their own guides or not. This converts the file format from flat text to
YAML, which supports both being read as data and formatting multiline
strings. This lets us format the `bolt guide <guide>` output to be more
readable and inline with other bolt output, make the guide text easily
editable (as opposed to JSON), and still lets users add their own guides
if they choose.

!feature

* **Beautify `bolt guide` output** (hack)
  This converts our existing guides from flat text to YAML so that they
  can be pretty printed.
@beechtom beechtom merged commit 1b30891 into puppetlabs:main Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants