Module: PuppetStrings::Markdown
- Defined in:
- lib/puppet-strings/markdown.rb,
lib/puppet-strings/markdown/base.rb,
lib/puppet-strings/markdown/function.rb,
lib/puppet-strings/markdown/data_type.rb,
lib/puppet-strings/markdown/functions.rb,
lib/puppet-strings/markdown/data_types.rb,
lib/puppet-strings/markdown/puppet_plan.rb,
lib/puppet-strings/markdown/puppet_task.rb,
lib/puppet-strings/markdown/defined_type.rb,
lib/puppet-strings/markdown/puppet_class.rb,
lib/puppet-strings/markdown/puppet_plans.rb,
lib/puppet-strings/markdown/puppet_tasks.rb,
lib/puppet-strings/markdown/defined_types.rb,
lib/puppet-strings/markdown/resource_type.rb,
lib/puppet-strings/markdown/puppet_classes.rb,
lib/puppet-strings/markdown/resource_types.rb,
lib/puppet-strings/markdown/table_of_contents.rb
Overview
module for parsing Yard Registries and generating markdown
Defined Under Namespace
Modules: DataTypes, DefinedTypes, Functions, PuppetClasses, PuppetPlans, PuppetTasks, ResourceTypes, TableOfContents Classes: Base, DataType, DefinedType, Function, PuppetClass, PuppetPlan, PuppetTask, ResourceType
Class Method Summary collapse
-
.generate ⇒ String
generates markdown documentation.
-
.render(path = nil) ⇒ Object
mimicks the behavior of the json render, although path will never be nil.
Class Method Details
.generate ⇒ String
generates markdown documentation
18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/puppet-strings/markdown.rb', line 18 def self.generate final = "# Reference\n\n" final += "<!-- DO NOT EDIT: This document was generated by Puppet Strings -->\n\n" final += PuppetStrings::Markdown::TableOfContents.render final += PuppetStrings::Markdown::PuppetClasses.render final += PuppetStrings::Markdown::DefinedTypes.render final += PuppetStrings::Markdown::ResourceTypes.render final += PuppetStrings::Markdown::Functions.render final += PuppetStrings::Markdown::DataTypes.render final += PuppetStrings::Markdown::PuppetTasks.render final += PuppetStrings::Markdown::PuppetPlans.render final end |
.render(path = nil) ⇒ Object
mimicks the behavior of the json render, although path will never be nil
35 36 37 38 39 40 41 42 43 |
# File 'lib/puppet-strings/markdown.rb', line 35 def self.render(path = nil) if path.nil? puts generate exit else File.open(path, 'w') { |file| file.write(generate) } YARD::Logger.instance.debug "Wrote markdown to #{path}" end end |