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-12064) Add task to generate function reference #9463

Merged
merged 1 commit into from
Aug 30, 2024

Conversation

joshcooper
Copy link
Contributor

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.

@joshcooper joshcooper changed the title References function 12064 (PUP-12064) Add task to generate function reference Aug 28, 2024
@joshcooper joshcooper added the maintenance Maintenance chores are excluded from changelogs label Aug 29, 2024
@joshcooper joshcooper force-pushed the references_function_12064 branch from 98bd5dd to f78896b Compare August 29, 2024 23:25
@joshcooper joshcooper marked this pull request as ready for review August 29, 2024 23:52
@joshcooper joshcooper requested a review from a team as a code owner August 29, 2024 23:52
    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.
@joshcooper joshcooper force-pushed the references_function_12064 branch from f78896b to eb9eee1 Compare August 30, 2024 00:01
@joshcooper
Copy link
Contributor Author

Assuming you have the osp-docs repo checked out, you can verify the rake task generates the same result, ignoring the date and git ref:

$ bundle config set with documentation
$ bundle update
$ bundle exec rake references:function
...
$ diff --brief -I built_from_commit -I 'This page was generated from the Puppet source code' references/function.md ../osp-docs/function.md 
$

@cthorn42 cthorn42 merged commit 0e2c0b4 into puppetlabs:main Aug 30, 2024
9 checks passed
@joshcooper joshcooper deleted the references_function_12064 branch September 3, 2024 16:02
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