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

(PUP-12057) Generate resource type references #9465

Merged
merged 7 commits into from
Sep 3, 2024

Conversation

joshcooper
Copy link
Contributor

@joshcooper joshcooper commented Aug 28, 2024

bundle exec rake references:type

Generates:

  • single page reference in references/type.md
  • overview reference in references/types/overview.md
  • one page per resource type in references/types/<name>.md

Only these commits need to be reviewed:

cc89237
3343f91
1a9c881
7df593d
93fc700

Blocked on #9464

@joshcooper joshcooper added the maintenance Maintenance chores are excluded from changelogs label Aug 29, 2024
    bundle exec rake references:function

This task uses puppet strings to generate references/function.md.

The task requires the puppet-strings gems, so add it to the documentation
bundler group. Since the group is optional, check to see if the gem is present
before trying to load it, similar to how we handle ronn.

If there are both 3.x and 4.x functions with the same name, we ignore the 3.x
version and document the 4.x version.

This code is adapted from puppet-docs. The old code had a bug as it used to
replace /####\s/ with '###\s' resulting in a literal '\s' in the header for
some functions.

If `puppet-strings` gem is installed, then the man page generation will include
strings as a new application type. Since we don't actually ship strings
in puppet, hide it from man page generation.
    bundle exec rake references:man

This task generates an overview page that lists all of the puppet commands.

Next, we run the gen_manpages rake task that generates roff formatted man pages
in the man directory. Then we convert roff to markdown using pandoc. We
unfortunately can't generate markdown directly as legacy apps are hardcoded to
generate ronn, such as when running `puppet agent --help`.

The task requires the pandoc-ruby gem, so add it to the documentation bundler
group. Since the group is optional, check to see if the gem is present before
loading it, similar to how we handle ronn.

The task also requires the pandoc executable.
    bundle exec references:type

Run puppet strings, convert the `resource_types` and generate the type overview
page in `references/types/overview.md`
This commit runs `ruby get_typedocs.rb` to extract the resource type
information and render the unified page for all resource types.

This code should be converted to use the puppet strings data that we're using
to generate the type overview page.
This generates one page per resource type in references/types/*.md
similar to what was done in puppet-docs.
Generated using `bundle exec rake references:type`
    bundle exec rake references:all
@joshcooper joshcooper force-pushed the references_types_12057 branch from 83a6f64 to 93fc700 Compare August 30, 2024 16:17
@joshcooper joshcooper marked this pull request as ready for review August 30, 2024 16:20
@joshcooper joshcooper requested a review from a team as a code owner August 30, 2024 16:20
@cthorn42 cthorn42 merged commit 775f89b into puppetlabs:main Sep 3, 2024
9 checks passed
@joshcooper joshcooper deleted the references_types_12057 branch October 10, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Maintenance chores are excluded from changelogs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants