From b4fd83501e07d8e32cc017dde88aa5ccf059a6df Mon Sep 17 00:00:00 2001 From: Florian Hotze Date: Fri, 9 Feb 2024 18:48:07 +0100 Subject: [PATCH] Minor enhancements (#2230) * Minor doc enhancements Some findings from Vuepress compilation warnings while working on the website build. Signed-off-by: Florian Hotze * Improve Ruby build script See https://github.com/openhab/website/pull/445. Signed-off-by: Florian Hotze --------- Signed-off-by: Florian Hotze --- .vuepress/process_main_docs.rb | 36 +++++++++++++++------------------- configuration/jsr223.md | 4 ++-- configuration/multimedia.md | 6 +++--- configuration/rules-dsl.md | 8 ++++---- 4 files changed, 25 insertions(+), 29 deletions(-) diff --git a/.vuepress/process_main_docs.rb b/.vuepress/process_main_docs.rb index cde2202e5..36c2600c8 100644 --- a/.vuepress/process_main_docs.rb +++ b/.vuepress/process_main_docs.rb @@ -25,8 +25,8 @@ def process_main_docs(docs_source_dir) process_file("#{docs_source_dir}/concepts", file, "docs/concepts", "#{$esh_repo_root}/concepts/#{file}") } puts " -> images and diagrams" - FileUtils.cp_r("#{docs_source_dir}/concepts/images", "docs/concepts/images") - FileUtils.cp_r("#{docs_source_dir}/concepts/diagrams", "docs/concepts/diagrams") + FileUtils.cp_r("#{docs_source_dir}/concepts/images", "docs/concepts") + FileUtils.cp_r("#{docs_source_dir}/concepts/diagrams", "docs/concepts") else puts " Skipping non-existing section!" end @@ -40,7 +40,7 @@ def process_main_docs(docs_source_dir) process_file("#{docs_source_dir}/installation", file, "docs/installation", "#{$docs_repo_root}/installation/#{file}") } puts " -> images" - FileUtils.cp_r("#{docs_source_dir}/installation/images", "docs/installation/images") + FileUtils.cp_r("#{docs_source_dir}/installation/images", "docs/installation") puts ">>> Migrating the Tutorial section" @@ -50,11 +50,10 @@ def process_main_docs(docs_source_dir) process_file("#{docs_source_dir}/tutorials/getting_started", file, "docs/tutorial", "#{$docs_repo_root}/tutorials/getting_started/#{file}") } puts " -> images" - FileUtils.cp_r("#{docs_source_dir}/tutorials/getting_started/images", "docs/tutorial/images") + FileUtils.cp_r("#{docs_source_dir}/tutorials/getting_started/images", "docs/tutorial") # FileUtils.cp_r("#{docs_source_dir}/tutorials/images/*", "docs/tutorial/images") - puts ">>> Migrating the Configuration section" Dir.glob("#{docs_source_dir}/configuration/*.md") { |path| file = File.basename(path) @@ -77,18 +76,15 @@ def process_main_docs(docs_source_dir) puts " -> #{file}" process_file("#{docs_source_dir}/mainui", file, "docs/mainui", "#{$docs_repo_root}/mainui/#{file}") } - Dir.glob("#{docs_source_dir}/mainui/developer/*.md") { |path| - file = File.basename(path) - puts " -> #{file}" - process_file("#{docs_source_dir}/mainui/developer", file, "docs/mainui/developer", "#{$docs_repo_root}/mainui/developer/#{file}") - } - Dir.glob("#{docs_source_dir}/mainui/settings/*.md") { |path| - file = File.basename(path) - puts " -> #{file}" - process_file("#{docs_source_dir}/mainui/settings", file, "docs/mainui/settings", "#{$docs_repo_root}/mainui/settings/#{file}") + ["developer", "settings"].each { |subsection| + Dir.glob("#{docs_source_dir}/mainui/#{subsection}/*.md") { |path| + file = File.basename(path) + puts " -> #{subsection}/#{file}" + process_file("#{docs_source_dir}/mainui/#{subsection}", file, "docs/mainui/#{subsection}", "#{$docs_repo_root}/mainui/#{subsection}/#{file}") + } } puts " -> images" - FileUtils.cp_r("#{docs_source_dir}/mainui/images", "docs/mainui/images") + FileUtils.cp_r("#{docs_source_dir}/mainui/images", "docs/mainui") puts ">>> Migrating the Migration Tutorial section" @@ -118,7 +114,7 @@ def process_main_docs(docs_source_dir) process_file("#{docs_source_dir}/ui", file, "docs/ui", "#{$docs_repo_root}/ui/#{file}") } puts " -> images" - FileUtils.cp_r("#{docs_source_dir}/ui/images", "docs/ui/images") + FileUtils.cp_r("#{docs_source_dir}/ui/images", "docs/ui") puts ">>> Migrating the Apps section" @@ -138,7 +134,7 @@ def process_main_docs(docs_source_dir) process_file("#{docs_source_dir}/administration", file, "docs/administration", "#{$docs_repo_root}/administration/#{file}") } puts " -> images" - FileUtils.cp_r("#{docs_source_dir}/administration/images", "docs/administration/images") + FileUtils.cp_r("#{docs_source_dir}/administration/images", "docs/administration") puts ">>> Migrating the Developer section" @@ -156,8 +152,8 @@ def process_main_docs(docs_source_dir) } puts " -> images" - FileUtils.cp_r("#{docs_source_dir}/developers/bindings/images", "docs/developer/bindings/images") - FileUtils.cp_r("#{docs_source_dir}/developers/osgi/images", "docs/developer/osgi/images") - FileUtils.cp_r("#{docs_source_dir}/developers/ide/images", "docs/developer/ide/images") + FileUtils.cp_r("#{docs_source_dir}/developers/bindings/images", "docs/developer/bindings") + FileUtils.cp_r("#{docs_source_dir}/developers/osgi/images", "docs/developer/osgi") + FileUtils.cp_r("#{docs_source_dir}/developers/ide/images", "docs/developer/ide") end diff --git a/configuration/jsr223.md b/configuration/jsr223.md index 8ee754afb..8d9b08da1 100644 --- a/configuration/jsr223.md +++ b/configuration/jsr223.md @@ -382,7 +382,7 @@ sharedCache.put("x", "y") ::: -::: tab Nashorn JS +::: tab Nashorn JS ```js scriptExtension.importPreset("cache") @@ -392,7 +392,7 @@ var valueX = sharedCache.get("x") ::: -::: tab JSScripting +::: tab JS Scripting ```js var { sharedCache, privateCache } = require('@runtime/cache') diff --git a/configuration/multimedia.md b/configuration/multimedia.md index 12e284c46..36e6faeed 100644 --- a/configuration/multimedia.md +++ b/configuration/multimedia.md @@ -370,9 +370,9 @@ Using the 'Listening Melody' in the voice settings, you can configure an acousti Other interesting options for the dialog initialization are: -- --dialog-group : You can prevent simultaneous execution of dialogs by assigning them to same group, by default they are assigned the 'default' group. -- --location-item : You can provide an Item as location context for the dialogs, the interpreters can take advantage of these. -- --listening-item : You can configure an Item to be "ON"/"OFF" on recognition start/stop, useful for example to trigger a rule that mutes the surrounding devices. +- --dialog-group ``: You can prevent simultaneous execution of dialogs by assigning them to same group, by default they are assigned the 'default' group. +- --location-item ``: You can provide an Item as location context for the dialogs, the interpreters can take advantage of these. +- --listening-item ``: You can configure an Item to be "ON"/"OFF" on recognition start/stop, useful for example to trigger a rule that mutes the surrounding devices. #### Actions diff --git a/configuration/rules-dsl.md b/configuration/rules-dsl.md index 4c6564bb3..f328bbc7c 100644 --- a/configuration/rules-dsl.md +++ b/configuration/rules-dsl.md @@ -194,10 +194,10 @@ When using an item and you want to ignore the date-portion of that item the `tim System-based triggers are provided as described in the table below: -| Trigger | Description | -| ---------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| System started | `System started` is triggered upon openHAB startup. In openHAB version 2, `System started` is also triggered after the rule file containing the System started trigger is modified, or after item(s) are modified in a .items file. | -| System reached start level | `System reached start level ` is triggered when openHAB reaches a specific start level. A list of possible start levels is available below. Please note that only levels 40 and higher are useful as the rule engine needs to be ready first. | +| Trigger | Description | +|--------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| System started | `System started` is triggered upon openHAB startup. In openHAB version 2, `System started` is also triggered after the rule file containing the System started trigger is modified, or after item(s) are modified in a .items file. | +| System reached start level `` | `System reached start level ` is triggered when openHAB reaches a specific start level. A list of possible start levels is available below. Please note that only levels 40 and higher are useful as the rule engine needs to be ready first. | You may wish to use the 'System started' trigger to initialize values at startup if they are not already set.