Skip to content

Commit cda5790

Browse files
committed
fetch-external-docs: Fix HABPanel docs migration & Adjust HABot sidebar entry to reference to add-on docs
Signed-off-by: Florian Hotze <dev@florianhotze.com>
1 parent cb7320a commit cda5790

4 files changed

Lines changed: 6 additions & 14 deletions

File tree

scripts/fetch-external-content.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ def main
134134
# HABPanel Config Docs
135135
copy_file_safe(
136136
File.join(RESOURCE_FOLDER, "openhab-webui/bundles/org.openhab.ui.habpanel/doc/habpanel.md"),
137-
File.join(BASE_DIR, "docs/configuration/habpanel.md"),
137+
File.join(BASE_DIR, "docs/ui/habpanel/habpanel.md"),
138138
"https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui.habpanel/doc/habpanel.md"
139139
)
140140
copy_dir_safe(
141141
File.join(RESOURCE_FOLDER, "openhab-webui/bundles/org.openhab.ui.habpanel/doc/images"),
142-
File.join(BASE_DIR, "docs/configuration/images")
142+
File.join(BASE_DIR, "docs/ui/habpanel/images")
143143
)
144144

145145
# openHABian Install Docs (excluding NEWSLOG.md)
@@ -219,10 +219,10 @@ def main
219219
process_directory(
220220
src: ui_components_src,
221221
dst: ui_components_dst,
222-
source_root: "https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui/doc/components"
222+
source_root: "https://github.com/openhab/openhab-webui/blob/main/bundles/org.openhab.ui/doc/components",
223223
) { |path| !path.to_s.split(File::SEPARATOR).include?("src") }
224224

225-
puts " ✔ Copied and processed UI components reference documentation"
225+
puts " ✔ Copied UI components reference documentation"
226226
else
227227
warn " ⚠️ UI components source directory does not exist: #{ui_components_src}"
228228
end

scripts/lib/add_placeholders.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ def add_placeholder_pages
1313
"docs/apps/android.md",
1414
"docs/apps/garmin",
1515
"docs/apps/sailfishos",
16-
"docs/configuration/habpanel",
1716
"docs/configuration/iconsets/classic",
1817
"docs/ui/components/index.md",
19-
"docs/ui/habpanel",
2018
"docs/ui/habpanel/habpanel.md",
21-
"docs/ui/habot",
2219
"docs/ui/basic",
2320
"docs/ecosystem/alexa",
2421
"docs/ecosystem/google-assistant",

scripts/lib/process_utils.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def process_markdown(indir, file, outdir, source, outfile = nil)
154154
line.gsub!(%r{https?://(?:www\.)?openhab\.org/docs/}, "/docs/")
155155

156156
# Log these replacements as they indicate issues in the source that should be fixed
157-
log_replace.call(%r{https?://docs\.openhab\.org/addons/uis/habpanel/readme\.html}, "/docs/configuration/habpanel.html")
157+
log_replace.call(%r{https?://docs\.openhab\.org/addons/uis/habpanel/readme\.html}, "/docs/ui/habpanel/habpanel.html")
158158
log_replace.call(%r{https?://docs\.openhab\.org/addons/uis/basic/readme\.html}, "/addons/ui/basic/")
159159
log_replace.call(%r{https?://docs\.openhab\.org/addons/(.*)/(.*)/readme\.html}, '/addons/\1/\2/')
160160
log_replace.call(%r{https?://docs\.openhab\.org/}, "/docs/")
@@ -204,6 +204,7 @@ def process_markdown(indir, file, outdir, source, outfile = nil)
204204
# @param src [String, Pathname] the source directory to copy from
205205
# @param dst [String, Pathname] the destination directory to copy to
206206
# @param source_root [String, nil] the GitHub URL prefix used for edit links
207+
# @param process_md [Boolean] whether to process markdown files (true) or just copy them directly (false)
207208
# @yield [Pathname] an optional block to filter which files to process (receives the Pathname of each file)
208209
# @yieldreturn [Boolean] whether to process the file (true) or skip it (false)
209210
#

scripts/prepare-docs.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@
88
SRC_ROOT = "src"
99
DST_ROOT = "docs"
1010

11-
clean = !ARGV.include?("--no-clean")
1211
placeholders = !ARGV.include?("--no-placeholders")
1312

14-
if clean
15-
puts "🧹 Cleaning destination directory: #{DST_ROOT}"
16-
FileUtils.rm_rf(DST_ROOT)
17-
end
18-
1913
puts "➡️ Deploying the main documentation pages"
2014
process_directory src: SRC_ROOT, dst: DST_ROOT, source_root: "https://github.com/openhab/openhab-docs/blob/main/src"
2115

0 commit comments

Comments
 (0)