forked from openhab/openhab-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prepare-docs.rb
47 lines (36 loc) · 1.39 KB
/
prepare-docs.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# This will clone https://github.com/openhab/openhab-docs
# and migrate content into the website with some changes
require "fileutils"
require "net/http"
require "uri"
require "rexml/document"
# require "nokogiri"
$docs_repo = "https://github.com/openhab/openhab-docs"
$docs_repo_root = $docs_repo + "/blob/main"
$docs_repo_branch = "final"
$esh_repo = "https://github.com/eclipse/smarthome"
$esh_repo_root = $esh_repo + "/blob/master/docs/documentation"
$version = nil
require_relative "./.vuepress/process_file.rb"
require_relative "./.vuepress/process_main_docs.rb"
require_relative "./.vuepress/add_placeholders.rb"
if (Dir.exists?("docs")) then
puts ">>> Removing processed docs"
FileUtils.rm_rf("docs")
end
if (Dir.exists?("addons/integrations")) then
puts ">>> Removing processed addons"
FileUtils.rm_rf("docs")
end
process_main_docs(".")
add_placeholder_pages()
if (ARGV[0] && ARGV[0] == "--delete-sources") then
puts ">>> !!! Deleting source files - for ephemeral clones only!"
FileUtils.rm_rf(Dir.glob("addons/*.md"))
["administration", "appendix", "community", "configuration", "developers", "installation", "tutorials"].each { |d|
FileUtils.rm_rf(d)
}
end
# Regenerate the classic iconset docs
#puts ">>> Generating iconset"
#system("ruby generate_iconset_doc.rb #{docs_source_dir}/_addons_iconsets classic #{docs_source_dir}/_data docs/configuration/iconsets")