From d0d943436e702741a435d6b664cae580d358514b Mon Sep 17 00:00:00 2001 From: Charlie Sharpsteen Date: Fri, 30 May 2014 08:58:17 -0700 Subject: [PATCH] Add parameter summary to hostclass html docs Format cribbed from YARD method and attribute summary blocks. Still some work to do, but initial results don't look that bad. --- .../hostclass/html/parameter_details.erb | 18 ++++++++++++++++++ .../yard/templates/default/hostclass/setup.rb | 7 ++++++- 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 lib/puppetx/yardoc/yard/templates/default/hostclass/html/parameter_details.erb diff --git a/lib/puppetx/yardoc/yard/templates/default/hostclass/html/parameter_details.erb b/lib/puppetx/yardoc/yard/templates/default/hostclass/html/parameter_details.erb new file mode 100644 index 0000000..5daaa2b --- /dev/null +++ b/lib/puppetx/yardoc/yard/templates/default/hostclass/html/parameter_details.erb @@ -0,0 +1,18 @@ +

Parameter Summary(collapse)

+ diff --git a/lib/puppetx/yardoc/yard/templates/default/hostclass/setup.rb b/lib/puppetx/yardoc/yard/templates/default/hostclass/setup.rb index 5e7ccd1..959a4f3 100644 --- a/lib/puppetx/yardoc/yard/templates/default/hostclass/setup.rb +++ b/lib/puppetx/yardoc/yard/templates/default/hostclass/setup.rb @@ -1,7 +1,12 @@ include T('default/module') def init - sections :header, :box_info, :pre_docstring, T('docstring'), :subclasses + sections :header, :box_info, :pre_docstring, T('docstring'), :parameter_details, :subclasses +end + +def parameter_details + return if object.parameters.empty? + erb(:parameter_details) end def subclasses