Skip to content

Commit

Permalink
Add a more generic add-on ignore list (#160)
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.

- Temporarily ignore the jinja transformation until https://github.com/openhab/openhab2-addons/pull/5022 is merged

Signed-off-by: Yannick Schaus <github@schaus.net>
  • Loading branch information
ghys authored Mar 2, 2019
1 parent 560b791 commit c170502
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 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', 'jinja']


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 @@ -441,6 +441,7 @@ def process_file(indir, file, outdir, source)

Dir.glob(".vuepress/openhab-docs/_addons_actions/**") { |path|
addon = File.basename(path)
next if $ignore_addons.include?(addon)
puts " -> #{addon}"
FileUtils.mkdir_p("addons/actions/" + addon)
process_file(".vuepress/openhab-docs/_addons_actions", addon + "/readme.md", "addons/actions", nil)
Expand All @@ -453,6 +454,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 +467,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 +480,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 @@ -493,6 +497,7 @@ def process_file(indir, file, outdir, source)
next if path =~ /mycroft-skill/
next if path =~ /google-assistant/
addon = File.basename(path)
next if $ignore_addons.include?(addon)
puts " -> #{addon}"
FileUtils.mkdir_p("addons/integrations/" + addon)
process_file(".vuepress/openhab-docs/_addons_ios", addon + "/readme.md", "addons/integrations", nil)
Expand All @@ -518,7 +523,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 c170502

Please sign in to comment.