Skip to content

Commit

Permalink
Add new externals, rename addons plural
Browse files Browse the repository at this point in the history
* openHABian USAGE
* alexa-skill USAGE
* mycroft-skill USAGE
* HABPanel config article

persistence -> persistences
io -> ios

Many minor changes to articles

Signed-off-by: Thomas Dietrich <[email protected]>
  • Loading branch information
Thomas Dietrich authored and kaikreuzer committed Oct 18, 2017
1 parent 91ee75d commit f0487de
Show file tree
Hide file tree
Showing 8 changed files with 119 additions and 35 deletions.
12 changes: 6 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ twitter_username: openhab
github_username: openhab
# Build settings
markdown: kramdown
exclude: ["CNAME", "pom.xml", "README.md", "CONTRIBUTING.md", "process_addons.groovy", "update.sh", "Vagrantfile"]
exclude: ["CNAME", "pom.xml", "README.md", "CONTRIBUTING.md", "process_addons.groovy", "update-external-resources.sh", "Vagrantfile"]
# Additional gems for sitemap generation
plugins:
- jekyll-sitemap
Expand All @@ -21,10 +21,10 @@ collections:
addons_iconsets:
output: true
permalink: /addons/iconsets/:path:output_ext
addons_io:
addons_ios:
output: true
permalink: /addons/io/:path:output_ext
addons_persistence:
permalink: /addons/ios/:path:output_ext
addons_persistences:
output: true
permalink: /addons/persistence/:path:output_ext
addons_transformations:
Expand Down Expand Up @@ -58,13 +58,13 @@ defaults:
-
scope:
path: ""
type: addons_io
type: addons_ios
values:
layout: addon
-
scope:
path: ""
type: addons_persistence
type: addons_persistences
values:
layout: addon
-
Expand Down
5 changes: 3 additions & 2 deletions _includes/user-menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<li><a href="{{docu}}/configuration/packages.html">Initial Setup Packages</a></li>
<li><a href="{{docu}}/configuration/paperui.html">Paper UI</a></li>
<li><a href="{{docu}}/configuration/habmin.html">HABmin</a></li>
<li><a href="{{docu}}/configuration/habpanel.html">HABPanel</a></li>
<li><a href="{{docu}}/configuration/rules-ng.html">Rules (Experimental)</a></li>
<li><a href="{{docu}}/configuration/editors.html">Editors</a></li>
<hr />
Expand Down Expand Up @@ -95,7 +96,7 @@
<ul>
<li><a href="{{docu}}/addons/persistence.html">Overview</a></li>
<hr />
{% for persistence in site.addons_persistence %}
{% for persistence in site.addons_persistences %}
{% if persistence.install == "auto" or persistence.id == page.id and page.install == "manual" %}
<li><a href="{{ persistence.url }}">{{ persistence.label }}</a></li>
{% endif %}
Expand Down Expand Up @@ -136,7 +137,7 @@
<ul>
<li><a href="{{docu}}/addons/io.html">Overview</a></li>
<hr />
{% for io in site.addons_io %}
{% for io in site.addons_ios %}
<li><a href="{{ io.url }}">{{ io.label }}</a></li>
{% endfor %}
<hr />
Expand Down
9 changes: 5 additions & 4 deletions addons/io.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
layout: documentation
title: System Integration
title: System Integrations
---

{% include base.html %}

# System Integration
# System Integrations

openHAB supports services that enable integration with various technologies that don't fall into other add-on categories.

Expand Down Expand Up @@ -39,8 +39,9 @@ openHAB supports services that enable integration with various technologies that
</tr>
</thead>
<tbody>
{% for io in site.addons_io %}
<tr class="install-{{io.install}} since-{{io.since}}">
{% for io in site.addons_ios %}
<!-- <tr class="install-{{io.install}} since-{{io.since}}"> -->
<tr>
<td>
<h4><a href="{{io.url}}">{% if io.logo %}<img class="logo" src="{{base}}/{{io.logo}}" title="{{ io.label }}" alt="{{ io.label }}" />{% else %}{{ io.label }}{% endif %}</a></h4>
<img src="{{base}}/images/tag-install-{{io.install}}.svg">
Expand Down
6 changes: 3 additions & 3 deletions addons/persistence.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
layout: documentation
title: Persistence
title: Persistence Services
---

{% include base.html %}

# Persistence
# Persistence Services

Persistence services enable the storage of item states over time.

Expand Down Expand Up @@ -39,7 +39,7 @@ Persistence services enable the storage of item states over time.
</tr>
</thead>
<tbody>
{% for persistence in site.addons_persistence %}
{% for persistence in site.addons_persistences %}
<tr class="install-{{persistence.install}} since-{{persistence.since}}">
<td>
<h4><a href="{{persistence.url}}">{% if persistence.logo %}<img class="logo" src="{{base}}/{{persistence.logo}}" title="{{ persistence.label }}" alt="{{ persistence.label }}" />{% else %}{{ persistence.label }}{% endif %}</a></h4>
Expand Down
2 changes: 1 addition & 1 deletion configuration/habmin.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Configuration though HABmin

{% include base.html %}

# Configuration though HABmin
# Configuration through HABmin

HABmin is a modern, professional and portable user interface for openHAB,
providing both user and administrative functions (eg sitemaps for users, and configuration utilities
Expand Down
84 changes: 79 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
<version>2.0.0-SNAPSHOT</version>
<name>openHAB Documentation</name>
<packaging>pom</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -20,7 +23,7 @@
<directory>${basedir}/_addons_bindings/</directory>
</fileset>
<fileset>
<directory>${basedir}/_addons_persistence/</directory>
<directory>${basedir}/_addons_persistences/</directory>
</fileset>
<fileset>
<directory>${basedir}/_addons_transformations/</directory>
Expand All @@ -32,7 +35,7 @@
<directory>${basedir}/_addons_uis/</directory>
</fileset>
<fileset>
<directory>${basedir}/_addons_io/</directory>
<directory>${basedir}/_addons_ios/</directory>
</fileset>
<fileset>
<directory>${basedir}/_addons_iconsets/</directory>
Expand Down Expand Up @@ -137,7 +140,7 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/_addons_persistence/oh1</outputDirectory>
<outputDirectory>${basedir}/_addons_persistences/oh1</outputDirectory>
<resources>
<resource>
<directory>${basedir}/.external-resources/openhab1-addons/bundles/persistence</directory>
Expand Down Expand Up @@ -264,6 +267,10 @@
<include>**/doc/**</include>
<include>**/cfg/**</include>
</includes>
<excludes>
<exclude>**/cordova/**</exclude>
<exclude>**/src/**</exclude>
</excludes>
</resource>
</resources>
</configuration>
Expand Down Expand Up @@ -303,7 +310,7 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/_addons_io/oh1</outputDirectory>
<outputDirectory>${basedir}/_addons_ios/oh1</outputDirectory>
<resources>
<resource>
<directory>${basedir}/.external-resources/openhab1-addons/bundles/io</directory>
Expand All @@ -326,7 +333,7 @@
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/_addons_io/oh2</outputDirectory>
<outputDirectory>${basedir}/_addons_ios/oh2</outputDirectory>
<resources>
<resource>
<directory>${basedir}/.external-resources/openhab2-addons/addons/io</directory>
Expand All @@ -339,6 +346,73 @@
</resources>
</configuration>
</execution>
<execution>
<id>copy-openhabian-install-docs</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/installation</outputDirectory>
<resources>
<resource>
<directory>${basedir}/.external-resources/openhabian/docs</directory>
<includes>
<include>openhabian.md</include>
<include>images/*.png</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-habpanel-config-docs</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/configuration</outputDirectory>
<resources>
<resource>
<directory>${basedir}/.external-resources/openhab-bundles/uis/org.openhab.ui.habpanel/docs</directory>
<includes>
<include>habpanel.md</include>
<include>images/*.png</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.coderplus.maven.plugins</groupId>
<artifactId>copy-rename-maven-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<id>copy-oh-mycroft-docs</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${basedir}/.external-resources/openhab-mycroft/USAGE.md</sourceFile>
<destinationFile>${basedir}/_addons_ios/ext/mycroft-skill/readme.md</destinationFile>
</configuration>
</execution>
<execution>
<id>copy-oh-alexa-docs</id>
<phase>process-resources</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<sourceFile>${basedir}/.external-resources/openhab-alexa/USAGE.md</sourceFile>
<destinationFile>${basedir}/_addons_ios/ext/alexa-skill/readme.md</destinationFile>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
Expand Down
31 changes: 18 additions & 13 deletions process_addons.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def collect_features = { features ->
def process_addon_type = { features, sources, type, collection, suffix, lblremoves, pkgremoves ->
sources.each { source ->
println "--------------------------------------------------"
println "Processing: " + collection + "/" + source + "\n"
println "Processing: _" + collection + "/" + source + "\n"
def files = new File(project.basedir, "_${collection}/".concat(source))
if (! files.exists()) {
println "No resources found."
Expand All @@ -27,7 +27,8 @@ def process_addon_type = { features, sources, type, collection, suffix, lblremov
files.eachFile {
def name = it.name
println name
if (! name.contains(type) || name.endsWith('.test')) {
if (! name.contains(type)) println "[WARN] Addon package name doesn't contain '${type}'."
if (name.endsWith('.test')) {
println "[INFO] Skip."
it.deleteDir()
} else {
Expand All @@ -43,7 +44,7 @@ def process_addon_type = { features, sources, type, collection, suffix, lblremov
println "[WARNING] No README.md found."
} else {
readme.renameTo(new File(simpleNameDir.path, 'readme.md'))
println readme
//println readme
def label = readme.readLines().find{it.startsWith('#')}
if (label == null) {
println "[WARNING] No level 1 header found."
Expand Down Expand Up @@ -95,7 +96,7 @@ def process_addon_type = { features, sources, type, collection, suffix, lblremov
readme.write(toYaml(front) + '<!-- Attention authors: Do not edit directly. Please add your changes to the appropriate source repository -->\n\n{% include base.html %}\n\n' + readme.text)
}
}
println "\n"
print "\n"
}
def temp_folder = new File(project.basedir, "_${collection}/".concat(source))
if (temp_folder.list().length > 0) {
Expand All @@ -106,17 +107,21 @@ def process_addon_type = { features, sources, type, collection, suffix, lblremov
}

def process_addon_files = { features ->
// features, sources, type, collection, suffix, lblremoves, pkgremoves
process_addon_type(features, ['oh1', 'oh2'], 'binding', 'addons_bindings', ' - Bindings', [' Binding'], ['org.openhab.binding.','org.eclipse.smarthome.binding.'])
process_addon_type(features, ['oh1'], 'action', 'addons_actions', ' - Actions', [' Actions', ' Action'], ['org.openhab.action.'] )
process_addon_type(features, ['oh1'], 'persistence', 'addons_persistence', ' - Persistence', ['\\s*Persistence\\s*$'], ['org.openhab.persistence.'] )
process_addon_type(features, ['oh1', 'oh2'], 'io', 'addons_io', ' - Services', [' Service'], ['org.openhab.io.','org.eclipse.smarthome.io'] )
process_addon_type(features, ['oh2'], 'transform', 'addons_transformations', ' - Transformations', [' Transformation Service'], ['org.eclipse.smarthome.transform.'] )
process_addon_type(features, ['oh2'], 'voice', 'addons_voices', ' - Voices', [:], ['org.openhab.voice.','org.eclipse.smarthome.voice.'] )
process_addon_type(features, ['oh2'], 'iconset', 'addons_iconsets', ' - Icon Sets', [:], ['org.eclipse.smarthome.ui.iconset.'] )
process_addon_type(features, ['oh2'], 'ui', 'addons_uis', ' - UI', [:], ['org.openhab.ui.','org.eclipse.smarthome.ui.'] )
// features, sources, type, collection, suffix, lblremoves, pkgremoves
process_addon_type(features, ['oh1'], 'action', 'addons_actions', ' - Actions', [' Actions', ' Action'], ['org.openhab.action.'] )
process_addon_type(features, ['oh1', 'oh2'], 'binding', 'addons_bindings', ' - Bindings', [' Binding'], ['org.openhab.binding.','org.eclipse.smarthome.binding.'])
process_addon_type(features, ['oh2'], 'iconset', 'addons_iconsets', ' - Icon Sets', [:], ['org.eclipse.smarthome.ui.iconset.'] )
process_addon_type(features, ['oh1', 'oh2', 'ext'], 'io', 'addons_ios', ' - System Integrations', [' Service'], ['org.openhab.io.','org.eclipse.smarthome.io'] )
process_addon_type(features, ['oh1'], 'persistence', 'addons_persistences', ' - Persistence Services', ['\\s*Persistence\\s*$'], ['org.openhab.persistence.'] )
process_addon_type(features, ['oh2'], 'transform', 'addons_transformations', ' - Transformation Services', [' Transformation Service'], ['org.eclipse.smarthome.transform.'] )
process_addon_type(features, ['oh2'], 'ui', 'addons_uis', ' - UIs', [:], ['org.openhab.ui.','org.eclipse.smarthome.ui.'] )
process_addon_type(features, ['oh2'], 'voice', 'addons_voices', ' - Voices', [:], ['org.openhab.voice.','org.eclipse.smarthome.voice.'] )
}

if (! new File(project.basedir, ".external-resources").exists()) {
println "\n\n[WARNING] Folder '.external-resources' missing. Please use the update script to run all steps in order. Exiting.\n\n"
return
}
def features = [:]
collect_features(features)
process_addon_files(features)
5 changes: 4 additions & 1 deletion update-external-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ ! -f "$(dirname $0)/CNAME" ]; then
fi
resourcefolder=$(dirname $0)/.external-resources
mkdir -p "$resourcefolder"
echo -e "# About\n\nUsed to temporarly store repository clones from related openHAB projects for `update-external-resources.sh`." > "$resourcefolder"/README.md
echo -e "# About\n\nUsed to temporarily store repository clones from related openHAB projects for 'update-external-resources.sh'." > "$resourcefolder/README.md"

# Prerequisites
if ! command -v git &>/dev/null || ! command -v mvn &>/dev/null; then
Expand Down Expand Up @@ -48,6 +48,9 @@ pull_or_clone_repo "openhab-distro" "openhab/openhab-distro.git"
pull_or_clone_repo "openhab1-addons" "openhab/openhab1-addons.git"
pull_or_clone_repo "openhab2-addons" "openhab/openhab2-addons.git"
pull_or_clone_repo "openhab-bundles" "openhab/openhab-bundles.git"
pull_or_clone_repo "openhabian" "openhab/openhabian.git"
pull_or_clone_repo "openhab-alexa" "openhab/openhab-alexa.git"
pull_or_clone_repo "openhab-mycroft" "openhab/openhab-mycroft.git"

echo_process "Updating submodules of the 'openhab-bundles' repo... "
git -C "$resourcefolder/openhab-bundles" submodule update --recursive --remote --init
Expand Down

0 comments on commit f0487de

Please sign in to comment.