Skip to content

Commit

Permalink
Add task to generate report reference
Browse files Browse the repository at this point in the history
    bundle exec rake references:report

It runs `puppet doc -r report` to generate references/report.md

The docs site does not use the generated markdown to render the webpage, but at
least this file will be accurate if new report processors are added in the future.
  • Loading branch information
joshcooper committed Aug 28, 2024
1 parent 7d751b4 commit 8523585
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rakelib/generate_references.rake
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ CONFIGURATION_ERB = File.join(__dir__, 'references/configuration.erb')
CONFIGURATION_MD = File.join(OUTPUT_DIR, 'configuration.md')
METAPARAMETER_ERB = File.join(__dir__, 'references/metaparameter.erb')
METAPARAMETER_MD = File.join(OUTPUT_DIR, 'metaparameter.md')
REPORT_ERB = File.join(__dir__, 'references/report.erb')
REPORT_MD = File.join(OUTPUT_DIR, 'report.md')

def render_erb(erb_file, variables)
# Create a binding so only the variables we specify will be visible
Expand Down Expand Up @@ -48,4 +50,10 @@ namespace :references do
body = puppet_doc('metaparameter')
generate_reference('metaparameter', METAPARAMETER_ERB, body, METAPARAMETER_MD)
end

desc "Generate report reference"
task :report do
body = puppet_doc('report')
generate_reference('report', REPORT_ERB, body, REPORT_MD)
end
end
13 changes: 13 additions & 0 deletions rakelib/references/report.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
layout: default
built_from_commit: <%= sha %>
title: Report Reference
toc: columns
canonical: "/puppet/latest/report.html"
---

# Report Reference

> **NOTE:** This page was generated from the Puppet source code on <%= now %>
<%= body %>

0 comments on commit 8523585

Please sign in to comment.