Skip to content

Commit

Permalink
Add a more generic add-on ignore list
Browse files Browse the repository at this point in the history
Put bundles which are not add-ons but now have READMEs on the ignore list.
Workaround for #159.

Signed-off-by: Yannick Schaus <[email protected]>
  • Loading branch information
ghys authored Mar 2, 2019
1 parent 560b791 commit 5e39381
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions prepare-docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand All @@ -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/
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5e39381

Please sign in to comment.