From 2d59213b345b90b125bdf2fa647dafda39ab82e3 Mon Sep 17 00:00:00 2001 From: Eric Putnam Date: Fri, 20 Apr 2018 16:25:40 +0100 Subject: [PATCH] (PDOC-238) add generated message to markdown Currently there is no evidence in REFERENCE.md itself that it was generated and should not be edited. This adds a comment in the markdown, so as not to disrupt its rendered appearance but still communicate to the user when editing that the file is generated. --- lib/puppet-strings/markdown.rb | 3 ++- spec/fixtures/unit/markdown/output.md | 1 + spec/fixtures/unit/markdown/output_with_plan.md | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/puppet-strings/markdown.rb b/lib/puppet-strings/markdown.rb index c3cebee..6a9f33c 100644 --- a/lib/puppet-strings/markdown.rb +++ b/lib/puppet-strings/markdown.rb @@ -13,7 +13,8 @@ module PuppetStrings::Markdown # generates markdown documentation # @return [String] markdown doc def self.generate - final = "# Reference\n\n" + final = "# Reference\n" + final << "\n\n" final << PuppetStrings::Markdown::TableOfContents.render final << PuppetStrings::Markdown::PuppetClasses.render final << PuppetStrings::Markdown::DefinedTypes.render diff --git a/spec/fixtures/unit/markdown/output.md b/spec/fixtures/unit/markdown/output.md index 307c620..7ebc635 100644 --- a/spec/fixtures/unit/markdown/output.md +++ b/spec/fixtures/unit/markdown/output.md @@ -1,4 +1,5 @@ # Reference + ## Classes diff --git a/spec/fixtures/unit/markdown/output_with_plan.md b/spec/fixtures/unit/markdown/output_with_plan.md index b00ef0f..9ca179a 100644 --- a/spec/fixtures/unit/markdown/output_with_plan.md +++ b/spec/fixtures/unit/markdown/output_with_plan.md @@ -1,4 +1,5 @@ # Reference + ## Classes