Skip to content

Commit

Permalink
(maint) display Plans in markdown table of contents
Browse files Browse the repository at this point in the history
Currently, Plans are not being included in the table of contents in the
markdown output. This is because Plans were not being passed to the
table of contents renderer. This adds Plans to the renderer and updates
tests accordingly.
  • Loading branch information
eputnam committed Apr 3, 2018
1 parent a4e9150 commit d4ca490
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/puppet-strings/markdown/puppet_plans.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.render
def self.toc_info
final = ["Plans"]

in_classes.each do |plan|
in_plans.each do |plan|
final.push(plan.toc_info)
end

Expand Down
3 changes: 2 additions & 1 deletion lib/puppet-strings/markdown/table_of_contents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ def self.render
PuppetStrings::Markdown::DefinedTypes,
PuppetStrings::Markdown::ResourceTypes,
PuppetStrings::Markdown::Functions,
PuppetStrings::Markdown::PuppetTasks].each do |r|
PuppetStrings::Markdown::PuppetTasks,
PuppetStrings::Markdown::PuppetPlans].each do |r|
toc = r.toc_info
group_name = toc.shift
group = toc
Expand Down
4 changes: 4 additions & 0 deletions spec/fixtures/unit/markdown/output_with_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@

* [`(stdin)`](#(stdin)): Allows you to backup your database to local file.

## Plans

* [`plann`](#plann): A simple plan.

## Classes

### klass
Expand Down

0 comments on commit d4ca490

Please sign in to comment.