Sha256: c423000c41f0fb48029bafa0224b1dbd5e4e76c2717593bfdfe10aca8817250e
Contents?: true
Size: 1.38 KB
Versions: 3
Compression:
Stored size: 1.38 KB
Contents
require 'puppet-strings/json' # module for parsing Yard Registries and generating markdown module PuppetStrings::Markdown require_relative 'markdown/puppet_classes' require_relative 'markdown/functions' require_relative 'markdown/defined_types' require_relative 'markdown/resource_types' require_relative 'markdown/puppet_tasks' require_relative 'markdown/puppet_plans' require_relative 'markdown/table_of_contents' # generates markdown documentation # @return [String] markdown doc def self.generate final = "# Reference\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::PuppetTasks.render final << PuppetStrings::Markdown::PuppetPlans.render final end # mimicks the behavior of the json render, although path will never be nil # @param [String] path path to destination file 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 end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
puppet-strings-2.2.0 | lib/puppet-strings/markdown.rb |
puppet-strings-2.1.0 | lib/puppet-strings/markdown.rb |
puppet-strings-2.0.0 | lib/puppet-strings/markdown.rb |