From 5e3938174ece9de46430306ccac12ae51007bbb5 Mon Sep 17 00:00:00 2001 From: Yannick Schaus Date: Sat, 2 Mar 2019 15:05:43 +0100 Subject: [PATCH] Add a more generic add-on ignore list Put bundles which are not add-ons but now have READMEs on the ignore list. Workaround for #159. Signed-off-by: Yannick Schaus --- prepare-docs.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/prepare-docs.rb b/prepare-docs.rb index fbe57cf0..18ee2a0e 100644 --- a/prepare-docs.rb +++ b/prepare-docs.rb @@ -14,7 +14,7 @@ $esh_repo_root = $esh_repo + "/blob/master/docs/documentation" $version = nil -$ignore_bindings = [] +$ignore_addons = ['transport.modbus', 'transport.feed', 'javasound', 'webaudio'] if ENV["OH_DOCS_VERSION"] then @@ -194,7 +194,7 @@ def process_file(indir, file, outdir, source) # Handle obsolete bindings if in_frontmatter && (line =~ /label: / || line =~ /title: /) && outdir == 'addons/bindings' && file =~ /1\// then addon = file.split('/')[0] - if !$ignore_bindings.include?(addon.gsub('1', '')) && Dir.exists?("#{indir}/#{addon.gsub('1', '')}") then + if !$ignore_addons.include?(addon.gsub('1', '')) && Dir.exists?("#{indir}/#{addon.gsub('1', '')}") then line = line.gsub("\n", "") + ' (1.x)' if !(line =~ /1\.x/) if !obsolete_binding then obsolete_binding = true @@ -453,6 +453,7 @@ def process_file(indir, file, outdir, source) Dir.glob(".vuepress/openhab-docs/_addons_persistences/**") { |path| addon = File.basename(path) + next if $ignore_addons.include?(addon) puts " -> #{addon}" FileUtils.mkdir_p("addons/persistence/" + addon) process_file(".vuepress/openhab-docs/_addons_persistences", addon + "/readme.md", "addons/persistence", nil) @@ -465,6 +466,7 @@ def process_file(indir, file, outdir, source) Dir.glob(".vuepress/openhab-docs/_addons_transformations/**") { |path| addon = File.basename(path) + next if $ignore_addons.include?(addon) puts " -> #{addon}" FileUtils.mkdir_p("addons/transformations/" + addon) process_file(".vuepress/openhab-docs/_addons_transformations", addon + "/readme.md", "addons/transformations", nil) @@ -477,6 +479,7 @@ def process_file(indir, file, outdir, source) Dir.glob(".vuepress/openhab-docs/_addons_voices/**") { |path| addon = File.basename(path) + next if $ignore_addons.include?(addon) puts " -> #{addon}" FileUtils.mkdir_p("addons/voice/" + addon) process_file(".vuepress/openhab-docs/_addons_voices", addon + "/readme.md", "addons/voice", nil) @@ -489,6 +492,7 @@ def process_file(indir, file, outdir, source) Dir.glob(".vuepress/openhab-docs/_addons_ios/**") { |path| # See below for the Alexa & Mycroft special cases + next if $ignore_addons.include?(addon) next if path =~ /alexa-skill/ next if path =~ /mycroft-skill/ next if path =~ /google-assistant/ @@ -518,7 +522,7 @@ def process_file(indir, file, outdir, source) Dir.glob(".vuepress/openhab-docs/_addons_bindings/**") { |path| addon = File.basename(path) - next if $ignore_bindings.include?(addon) + next if $ignore_addons.include?(addon) puts " -> #{addon}" FileUtils.mkdir_p("addons/bindings/" + addon) process_file(".vuepress/openhab-docs/_addons_bindings", addon + "/readme.md", "addons/bindings", nil)