|
8 | 8 |
|
9 | 9 | This repository contains the documentation for openHAB.
|
10 | 10 |
|
11 |
| -The result is available at [http://docs.openhab.org/](http://docs.openhab.org/) |
| 11 | +The result is available at [https://www.openhab.org/docs/](https://www.openhab.org/docs/), [https://www.openhab.org/addons/](https://www.openhab.org/addons/) and [http://docs.openhab.org/](http://docs.openhab.org/) [Deprecated] |
12 | 12 |
|
13 |
| -## Contributing to the Documentation |
14 |
| - |
15 |
| -The documentation is a community effort, so everyone is welcome to suggest changes, add new sections and fix bugs. |
16 |
| -This is done exactly the same way as for the code repositories, simply through pull requests against this repo. |
17 |
| -Please read the [contribution guidelines](CONTRIBUTING.md) for details. |
| 13 | +## How it works |
18 | 14 |
|
19 |
| -### Prerequisites |
| 15 | +In this repo you can find and improve all *general* documentation contents. |
| 16 | +In fact that is all you can see in the `master` branch. |
| 17 | +There are also other *read-only* branches, which hold external content like the *add-ons* and *concepts* documentation. |
| 18 | +We will read about them later. |
20 | 19 |
|
21 |
| -Our documentation is built with Jekyll and served through Github Pages. |
| 20 | +### So I can't improve an add-on article here? |
22 | 21 |
|
23 |
| -In order to run Jekyll locally, you also need Ruby being installed. |
24 |
| -Please see the [Jekyll installation instructions](https://jekyllrb.com/docs/installation/) for details. |
| 22 | +Correct, this is done in the original repository of the add-on. |
| 23 | +You may want to know how to find the right file in all of those repos? |
| 24 | +This is fairly easy: |
| 25 | +on most of the documentation pages on https://www.openhab.org/, |
| 26 | +you will find the following link at the bottom, which will point you directly to the file you want to improve. |
25 | 27 |
|
26 |
| -An alternative for a local setup is a virtual machine provided by Vagrant. |
| 28 | + |
27 | 29 |
|
28 |
| -### Serving locally |
| 30 | +When your improvement has been made and merged, we will get the updated article automatically through our build mechanism. |
| 31 | +This happens mostly once a day. Afterwards your change is included in the next build of the openHAB website. |
29 | 32 |
|
30 |
| -Once you have Jekyll installed and the repository checked out, simply run |
| 33 | +## Contributing to the Documentation |
31 | 34 |
|
32 |
| -```shell |
33 |
| -jekyll serve |
34 |
| -``` |
| 35 | +The documentation is a community effort, so everyone is welcome to suggest changes, add new sections and fix bugs. |
| 36 | +This is done exactly the same way as for the code repositories, simply through pull requests against this repo. |
| 37 | +When editing a page through the _"Edit this page on GitHub"_ link on the website, you will be given the opportunity to |
| 38 | +create a pull request directly from GitHub. |
| 39 | +Please read our [contribution guidelines](CONTRIBUTING.md) and try to follow |
| 40 | +them as bext as you can before submitting a change for review - but don't worry if you don't understand all of them, we |
| 41 | +will help you to get it right. |
35 | 42 |
|
36 |
| -from within the repository root folder and point your browser to [`http://localhost:4000`](http://localhost:4000). |
37 |
| -This will give you a preview of the documentation in the same way as it will appear on docs.openhab.org once your PR is merged. |
38 |
| -Changes to the markdown files will automatically be taken into account as Jekyll re-generates the pages on the fly. |
| 43 | +## So what are the other branches for? |
39 | 44 |
|
40 |
| -### Serving via Vagrant VM |
| 45 | +We use them to bring together all relevant articles or to archive versioned content. |
| 46 | +Mostly those branches will get updated automatically through our continuous integration builds. |
| 47 | +You can read a bit more below about our external ressources and how we get them. |
41 | 48 |
|
42 |
| -You can also have a virtual machine serving a Jekyll and webserver instance for you, without changing your base system or being limited by it. |
43 |
| -The virtual machine will run in the background, process your changes to the source and presenting the results on your hosts [`http://localhost:4000`](http://localhost:4000). |
44 |
| -A [Vagrant](https://www.vagrantup.com) machine configured by a [`Vagrantfile`](Vagrantfile) file is provided for that purpose. |
| 49 | +### Automatically Generated Parts |
45 | 50 |
|
46 |
| -You need to have [VirtualBox](https://www.virtualbox.org) and [Vagrant](https://www.vagrantup.com/downloads.html) installed. |
47 |
| -After that, it's as easy as: |
| 51 | +Those parts include __all__ add-on documentation files, no matter if they are from the Eclipse SmartHome repo, the |
| 52 | +`openhab1-addons` repo, the `openhab2-addons` repo or any special binding repo like *habmin*, *zwave* or the *alexa skill*. |
| 53 | +The "Concepts" articles also come from Eclipse SmartHome and are maintained there. |
48 | 54 |
|
49 |
| -```shell |
50 |
| -/path-to/openhab-docs$ vagrant up |
51 |
| -``` |
| 55 | +We are keeping all those files at their original location, because it simply doesn't make sense to keep them here. |
| 56 | +Imagine you want to do an improvement of the zwave binding and have to update the readme file in a completely different place. |
| 57 | +That's twice the effort and also we would have to coordinate two Pull Requests. |
| 58 | +So we are saving time for everyone by keeping those files at their original location along with the code. |
52 | 59 |
|
53 |
| -## Automatically Generated Parts |
| 60 | +### How the documentation build works |
54 | 61 |
|
55 |
| -Please note that a few parts of this repository MUST NOT BE MANUALLY EDITED! |
56 |
| -These are copied from the source code repositories and some files are generated from them. These files/folders are: |
| 62 | +We have set up our [build server](https://openhab.ci.cloudbees.com/view/Documentation/) to do the magic automatically. |
| 63 | +There are several triggers (mostly time based), which will then *gather the external contents* and move them to our *final* branch. |
| 64 | +You can find this migrated external content in the *final* branch under: |
57 | 65 |
|
58 |
| -- `addons_*` |
| 66 | +- `_addons_*` |
59 | 67 | - `concepts`
|
60 | 68 |
|
61 |
| -The generation/update of these files can be triggered through `bash update-external-resources.sh` in the repo root. |
62 |
| -The process will create a temporary folder `.external-resources`, which is only used by the update script and can be ignored. |
63 |
| - |
64 |
| -## About the `_addons_*` Folders |
65 |
| - |
66 |
| -See [Jekyll Collections](https://jekyllrb.com/docs/collections/) for general details. |
67 |
| -The folders represent collections of the different Addons types. |
68 |
| - |
69 |
| -If you are here to help improve one of the contained READMEs, read carefully. |
70 |
| -These files are mere copies of files in other repositories and will be overwritten on a regular basis. |
71 |
| -Please find the original repository and add your contribution there. |
72 |
| - |
73 |
| -At the time of this writing, the folders are automatically created and updated by the toolchain |
| 69 | +You can even have a look at how this works in detail. |
| 70 | +The external content is updated by the following toolchain: |
74 | 71 |
|
75 | 72 | - `update-external-resources.sh` → `pom.xml` → `process_addons.groovy`
|
76 | 73 |
|
77 |
| -Configuration of the collections happens through `_config.yml`. |
78 |
| -The most important setting you need to be aware of, is, that all files in collections are mapped to certain paths: |
79 |
| - |
80 |
| -- e.g. `_addons_bindings\astro\readme.md` → [docs.openhab.org/addons/bindings/astro/readme.html](http://docs.openhab.org/addons/bindings/astro/readme.html) |
81 |
| - |
82 |
| -Check the mentioned files for more details. |
| 74 | +Everything that gets updated in the *master* branch will be also merged over to the *final* branch automatically. |
| 75 | +Afterwards we will redeploy the website with the latest content from the *final* branch at regular intervals. |
83 | 76 |
|
84 | 77 | ## Documentation Versioning
|
85 | 78 |
|
86 |
| -Just as openHAB is released in versions, the documentation website provides fixed versions of the documentation articles, e.g., [docs.openhab.org/v2.1/installation/linux.html](http://docs.openhab.org/v2.1/installation/linux.html) |
| 79 | +Just as openHAB is released in versions, the documentation website provides fixed versions of the documentation articles, e.g., [https://www.openhab.org/v2.2/installation/linux.html](https://www.openhab.org/v2.2/installation/linux.html) |
87 | 80 |
|
88 |
| -Please see [this issue](https://github.com/openhab/openhab-docs/issues/520#issuecomment-339741820) for all details regarding the current implementation. |
| 81 | +Please see [this issue](https://github.com/openhab/openhab-docs/issues/520#issuecomment-339741820) for all details regarding the tagging and branching approach. |
89 | 82 | In short, the following has to be considered:
|
90 | 83 |
|
91 | 84 | - Versions like "2.1.0" are marked by git tags.
|
92 | 85 | - Based on tags branches like "2.1-patch" are created, to include later discovered changes (like fixed links).
|
93 |
| -- The intended base folder for the version needs to be set in `_config.yml`, e.g. `baseurl: "/v2.1"`. |
94 |
| -- New versions have to be added to the dropdown menu shown on the resulting website, configured in `_includes/versioning.html`. |
95 |
| -- The version branch has to be generated with jekyll, the resulting content goes into the version folder identical to the above set baseurl. Execute e.g. `jekyll build -d path/to/checked-out/gh-pages-branch/v2.1/` |
96 |
| -- The generated static page files under, e.g., `v2.1/` need to be committed to `gh-pages` for GitHub Pages to pick them up and include in the generated page. |
| 86 | + |
| 87 | +When a version is tagged (or updated), a static version of the website has to be generated and copied into the correct sub-folder, this is currently a manual operation described succinctly here: https://github.com/openhab/website/issues/72 |
0 commit comments