Skip to content

Commit 82a24a4

Browse files
Update doc preview infrastructure (#2444)
* Update doc preview infrastructure Align the used NodeJS and Ruby versions and scripts with the website build. Also upgrade caniuse-lite DB. Signed-off-by: Florian Hotze <[email protected]> * Add NodeJS/Ruby install instructions Signed-off-by: Florian Hotze <[email protected]> * switch sentence with local preview sentence Signed-off-by: Stefan Höhn <[email protected]> --------- Signed-off-by: Florian Hotze <[email protected]> Signed-off-by: Stefan Höhn <[email protected]> Co-authored-by: Stefan Höhn <[email protected]>
1 parent a27d468 commit 82a24a4

9 files changed

+509
-537
lines changed

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16.20.1

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.3.2

.vuepress/add_placeholders.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This function will add placeholders for pages that are out of scope of the docs preview
22

33
def add_placeholder_pages()
4-
puts ">>> Adding placeholder pages for preview"
4+
puts "➡️ Adding placeholder pages for preview"
55
[
66
"addons/integrations/homekit",
77
"addons/integrations/openhabcloud",
@@ -19,7 +19,7 @@ def add_placeholder_pages()
1919
"docs/ecosystem/mycroft",
2020
"docs/installation/openhabian.md"
2121
].each { |path|
22-
puts " -> #{path}"
22+
puts " ➡️ #{path}"
2323
page = path
2424
if (!(path =~ /\.md/)) then
2525
FileUtils.mkdir_p(path)

.vuepress/process_file.rb

+163-201
Large diffs are not rendered by default.

.vuepress/process_main_docs.rb

-157
This file was deleted.

README.md

+32-26
Original file line numberDiff line numberDiff line change
@@ -81,37 +81,43 @@ The new build will include all the latest changes in the code repository and in
8181

8282
### How to build the documentation locally
8383

84-
It is possible to build a preview version of the documentation on your local machine. The following software is required:
85-
86-
- [`node =16.20.1`](https://nodejs.org/en)
87-
- [`ruby >=3.0.2`](https://www.ruby-lang.org/en/)
88-
- [`Python >= 3.10.12`](https://www.python.org)
89-
90-
If you work on multiple node projects [Node Version Manager](https://github.com/nvm-sh/nvm) is recommended in case they use a different version of node.
91-
92-
Example:
93-
94-
```bash
95-
$ nvm install 16
96-
# ...
97-
$ nvm use 16
98-
Now using node v16.20.2 (npm v8.19.4)
99-
$ npm install
100-
# ...
101-
$ npm run serve
102-
# ...
103-
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)
84+
It is possible to build a preview version of the documentation on your local machine.
85+
The following software is required:
86+
87+
- [`NodeJS = 16.20.1`](https://nodejs.org/en)
88+
- [`Ruby >= 3.3.2`](https://www.ruby-lang.org/en/)
89+
90+
We recommend to use [Node Version Manager](https://github.com/nvm-sh/nvm) as well as [Ruby Version Manager](https://rvm.io/) to easily allow using multiple versions of NodeJS and Ruby for multiple projects.
91+
If you don't do that, you can simply start by only installing the above mentioned versions.
92+
93+
When using `nvm` and/or `rvm`, setup the NodeJS and/or Ruby version:
94+
95+
```shell script
96+
nvm use
97+
rvm use
10498
```
10599

106-
The local preview is available under the following options
100+
If `nvm` and/or `rvm` complain about the required versions not being installed, you can install them as following:
107101

108-
- [http://0.0.0.0:8000/docs](http://0.0.0.0:8000/docs)
109-
- [http://localhost:8000/docs](http://localhost:8000/docs)
110-
- [http://[::]/:8000/docs](http://[::]:8000/docs)
102+
```shell script
103+
nvm install 16.20.1
104+
rvm install ruby-3.3.2
105+
```
111106

112-
![local preview](images/local-docu-preview.png)
107+
Next, you can build & serve the documentation preview:
113108

114-
This will also allow you to preview how the page renders on different devices using the respective browser tools.
109+
```shell script
110+
npm run serve-preview
111+
```
112+
113+
The local preview is available under the following URLs:
114+
115+
- <http://0.0.0.0:8080/docs>
116+
- <http://localhost:8080/docs>
117+
118+
This will also allow you to preview how the page renders on different devices using the respective browser tools:
119+
120+
![local preview](images/local-docu-preview.png)
115121

116122
## Documentation Versioning
117123

0 commit comments

Comments
 (0)