Skip to content

Commit

Permalink
Newww Docu ;) (Koenkk#967)
Browse files Browse the repository at this point in the history
* Update user extension.

* Availability refactor  (Koenkk#707)

* Availability refactor proposal. Koenkk/zigbee2mqtt#6281

* Update availability docs.

* Update availability

* Update docs

* Added TuYa TS011F_plug_3 (Koenkk#931)

* Added TuYa TS011F_plug_3

* Update TS011F_plug_3.md

* Docs update for exposing scenes and setting scene name. Koenkk/zigbee2mqtt#9056 (Koenkk#933)

* Add doc for options expose. Koenkk/zigbee2mqtt#9110

* added MIR-HE200-TY (Koenkk#943)

* TuYa Human Radar Motion-presence Sensor

Additional Konverter-Update is comming up

* Create MIR-HE200-TY.md

New TuYa Human Radar Sensor

* Update MIR-HE200-TY.md

including picture as *.jpg

* Update MIR-HE200-TY.md

picture will pushed seperately

* Picture for MIR-HE200-TY as jpg

* Delete MIR-HE200-TY.png

Co-authored-by: Koen Kanters <[email protected]>

* Update exposes (Koenkk#944)

* Add devices-overview page app (Koenkk#942)

* Use devices-overview-app

* Fix docker-compose.yml for local-run

* Add devices-overview vue app

* Add devices-overview app build

* Set theme jekyll-theme-cayman

* Remove CNAME

* Fix: devices-overview-app hardcoded image url

* Fix device-overview filters

* Make device-overview exposes filter AND

* Readd CNAME

* Read device-addedAt from git and use for sort and label

* Readd CNAME

* Remove old supported devices table view

* Fix docgen test

* Add whitelabel-device icon

* Fix: use original model for whitelabel devices

* Fix minor styles for small devices

* Fix whitelabel flag

* Fix sort by addedAt

* Add model to devices-overview

* Delete docgen.test.js

* Update .eslintignore

* Update .eslintignore

* Update package.json

* Update supported-devices.js

Co-authored-by: Koen Kanters <[email protected]>

* Add frontend url. Koenkk/zigbee2mqtt#9214

* Added description for Perenio PECLS01 water leak sensor (Koenkk#950)

* Refactor documentation and use VuePress as generator

* Regenerate device-pages

* Disable codeblock line-numbers on small devices

* 21 10 backdate (Koenkk#951)

* Add documentation and image for Philips Surimu Rectangle Panel

* Add documentation and image for Philips LTV001 White Ambiance E27 ST64 bulb

* Add documentation and image for Philips LTV001 White Ambiance E27 ST64 bulb

* Not sure what happened here, but it looks like I modified this file so, adding it back!

* Small cleanup

* Add addedAt to device frontmatter

* WIP: Quickstart

* Add more get started stuff

* WIP: quickstart guide

* WIP: quickstart guide

* Minor improvements; WIP getting started

* Edit supported-hardware.md

* Styles; try git-plugin

* Added image for IKEA LED1949C5 (Koenkk#954)

* add network_key:GENERATE to get-started

* Styles

* Add network_key converter

* disable contributors display

* Point to z2m main repo.

* Updates

* Add list expose (Koenkk#948)

* Initial

* variant 2

* u

* more variants

* Update exposes.md

* Update exposes.md

* Fix navbar Github link

* Move FAQ to direct child of Guide and fix some links

* Add dark class more early to avoid flickering on page load

* Fix fails to start link in sidebar.

* temporarily enable debug mode

* Invalidate cache

* Disable debug mode, update dependencies

* Refactor FAQ, Z2M fails to start

* Update z2m fails to start.

* try vue patch

* try disable webpack cache

* Remove vue patch; update quasar

* show hide back-to-top also on small devices

* Fix broken links

* change deploy

* Add robots.txt

* develop deploy; fix links

* Fix links

* add docsbranch develop switch

* Readd usb-cable hint

* Fix typo

* Content improvements

* More improvements

* add docsbranch develop switch

* Readd usb-cable hint

* Fix typo

* Disable deploy of develop branch

* WIP: Config refactor

* WIP: Config refactor

* Config refactor

* Config refactor

* Remove develop link from navbar guide

* Fix links

* Small updates to configuration

* Content improvements

* Add workflows

* Philips ltf (Koenkk#962)

* Added documentation for Philips Apogee devices

* Added images for Philips Apogee devices

* Add sitemap generation

* Add build.txt

* Integrate algolia

* Integrate algolia

* add docsearch plugin

* Fix workflow file

* ci fixes

* Try to better rank device-description search hits

* Wait 1min before first request to build.txt

* Remote start_urls from algolia index

* Update algolia section-selector

* Update navbar active-route links

* Better device-desc search, use @Koenkk's index

* Fix dropdown styles on mobile with dark mode

* Change algolia index

* Fixed Ubisys vendor name (Koenkk#963)

* Update device-availability.md

* Add images for Tuya TS000x_switch_module (Koenkk#964)

* Prepare for 1.22.0 release

* Remove unused images

* Use herdsman 14.0.301 and fix links

* Fix: image path, links

* Use www.zigbee2mqtt.io

* Add Notes-Comment test; remove "notes none" sections

* Add Notes-Comment test; remove "notes none" sections

* Change attention comments in device files

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Koen Kanters <[email protected]>
Co-authored-by: Robin Kolk <[email protected]>
Co-authored-by: Koen Kanters <[email protected]>
Co-authored-by: Burkhard Kneiseler <[email protected]>
Co-authored-by: Aleks <[email protected]>
Co-authored-by: danieledwardgeorgehitchcock <[email protected]>
Co-authored-by: Dirk van Donkelaar <[email protected]>
Co-authored-by: rodriguezst <[email protected]>
  • Loading branch information
10 people authored Oct 31, 2021
1 parent 426fd16 commit 00c0af2
Show file tree
Hide file tree
Showing 3,622 changed files with 71,117 additions and 42,181 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{*.md, *.pug}]
trim_trailing_whitespace = false
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

22 changes: 0 additions & 22 deletions .eslintrc.json

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build ⚙ and Deploy 🚀
on: push

jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🚚
uses: actions/checkout@v2

- name: Setup Node.js ⚗
uses: actions/[email protected]
with:
node-version: '16'

- name: Determine node version №
id: node-version
run: |
echo "::set-output name=version::$(node -v)"
- name: Restore Cache 📦
uses: actions/[email protected]
id: cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ steps.node-version.outputs.version }}-${{ hashFiles('package-lock.json') }}

- name: Install dependencies 🌐
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

# - name: Set DEVELOP_BRANCH env var
# if: github.ref == 'refs/heads/develop'
# run: |
# echo "DEVELOP_BRANCH=yes" >> $GITHUB_ENV

- name: Build 🛠
run: npm run build

- name: Run tests 🩺
run: npm run test

- name: Add build.txt 🗓
run: |
git log --pretty=format:'%h' -n 1 > dist/build.txt
echo >> dist/build.txt
date +%F_%T >> dist/build.txt
- name: Deploy 🚀
if: github.ref == 'refs/heads/master'
uses: JamesIves/[email protected]
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist # The folder the action should deploy.
single-commit: true
clean: true
# clean-exclude: |
# develop

# - name: Deploy to /develop 🚀
# if: github.ref == 'refs/heads/develop'
# uses: JamesIves/[email protected]
# with:
# branch: gh-pages
# folder: dist
# target-folder: develop
# single-commit: true
# clean: true
31 changes: 0 additions & 31 deletions .github/workflows/ci.yml

This file was deleted.

68 changes: 68 additions & 0 deletions .github/workflows/update-algolia-index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Update Algolia-Search index

# Only trigger, when the build workflow succeeded on branch master
on:
workflow_run:
workflows: [ "Build ⚙ and Deploy 🚀" ]
branches: [ master ]
types: [ completed ]

jobs:
update-algolia-index:
runs-on: ubuntu-latest
steps:
# Try to workaround time gap between newly gh-pages deployment is available (cache cleared?)
- name: Wait for deployment is published
run: |
CNT=1
echo Waiting for deployment ${GITHUB_SHA:0:7} is published
sleep 60
while ! curl -sS https://www.zigbee2mqtt.io/build.txt | grep -qF ${GITHUB_SHA:0:7} ; do
CNT=$((CNT+1))
sleep 1
if [ $CNT -gt 300 ]; then
>&2 echo "build.txt does not match current commit"
>&2 curl -sS https://www.zigbee2mqtt.io/build.txt
exit 1
fi
done
- name: Create algolia scraper config
run: |
cat << EOF > algolia.json
{
"index_name": "zigbee2mqtt.io",
"sitemap_urls": ["https://www.zigbee2mqtt.io/sitemap.xml"],
"stop_urls": [],
"selectors": {
"lvl0": {
"selector": "header .router-link-active",
"global": true,
"default_value": "Miscellaneous"
},
"lvl1": ".theme-default-content h1",
"lvl2": ".theme-default-content h2, .device-page h1 + table tbody tr:nth-child(3) td:nth-child(2)",
"lvl3": ".theme-default-content h3",
"lvl4": ".theme-default-content h4",
"lvl5": ".theme-default-content h5",
"text": ".theme-default-content p, .theme-default-content li, .theme-default-content code, .theme-default-content td",
"lang": {
"selector": "/html/@lang",
"type": "xpath",
"global": true
}
},
"custom_settings": {
"attributesForFaceting": ["lang"]
}
}
EOF
- run: curl -sSL https://www.zigbee2mqtt.io/build.txt

- name: Update algolia docsearch
uses: darrenjennings/algolia-docsearch-action@master
with:
algolia_application_id: K1BM3QYQ34
algolia_api_key: ${{ secrets.ALGOLIA_INDEX_APIKEY }}
file: 'algolia.json'
10 changes: 4 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
node_modules/
_site/
.sass-cache/
node_modules
.temp
.cache
dist
.idea
.DS_Store
.idea/
docs/.jekyll-metadata
Empty file modified LICENSE
100755 → 100644
Empty file.
119 changes: 85 additions & 34 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,34 +1,85 @@
# Zigbee2MQTT.io
This repository contains the Zigbee2MQTT documentation.

## Generated documentation

Due to the repetitive nature of zigbee devices, lots of documentation is auto-generated from source code or by particular directives for the `exposes` and `notes` section. For local development:

```bash
npm install
npm run docgen
```

## Running locally
To run locally, execute the following commands:

```bash
# Checkout the repository
git clone https://github.com/Koenkk/zigbee2mqtt.io.git
cd zigbee2mqtt.io/docs

# Make sure that you have at least Ruby 2.1.0 installed, if this fails, install at least Ruby 2.1.0
ruby --version

# Install bundler
sudo gem install bundler

# Install dependencies
bundle install

# Start local server
bundle exec jekyll serve --incremental
```

You can now find the local instance under: http://127.0.0.1:4000
# Zigbee2MQTT.io

[![Build ⚙ and Deploy 🚀 ](https://github.com/Koenkk/zigbee2mqtt.io/actions/workflows/build-deploy.yml/badge.svg)](https://github.com/Koenkk/zigbee2mqtt.io/actions/workflows/build-deploy.yml)

This repository contains the [Zigbee2MQTT](https://zigbee2mqtt.io) documentation.

It is based on [VuePress v2](https://v2.vuepress.vuejs.org/).

## Architecture

**Directory-Structure:**

* `docgen`: Some scripts to test and generate the Device-Pages.
* `docs`: The actual documentation.
* `docs/.vuepress`: Some VuePress enhancements like Stylesheets.
* `public`: Static assets.
* `supported-devices-component`: Vue.js component rendering the devices-overview page.
* `navbar.ts`: Configuration for the top navigation.
* `sidebar.ts`: Configuration for the sidebars by individual sections (like _Guide_).
* `vuepress.config.ts`: The [VuePress config file](https://v2.vuepress.vuejs.org/reference/config.html).

## Docgen

The docgen-scripts helps to generate and update the individual device-pages (`/docs/devices/*.md`).
[zigbee-herdsman-converters](https://github.com/Koenkk/zigbee-herdsman-converters) exposes a list with supported devices which is used for generation. It also updates the Devices-List used by the _Supported-Devices_ overview page.

The `## Notes` section of each page is writte by hand and does not come from `zigbee-herdsman-converters`. This section gets preserved and can be edited.

Docgen is written in Typescript, so you need a recent version of Node.js and NPM.

```bash
# Install dependencies
npm ci

# Run docgen
npm run docgen
```

### Docgen Tests

Docgen includes some scripts to help testing the page.

* `check-device-images`: Checks for missing device images
* `check-links`: Checks for broken internal links

**Attention**: `check-links` iterates over the generated VuePress files, so you have to build the page first!


## VuePress

```bash
# Install dependencies
npm ci
```

### Building

```bash
# Run vuepress build
npm run build
```

The build-artifact gets written to `dist` directory.

### Development

```bash
# Run vuepress in dev mode with hot-reloading
npm run dev
```

The `dev`-Mode **excludes** the huge amount device-pages which slows down the build process drastically.
If you are interested in the device-pages you could include them by using the `npm run dev:devices` npm-run script.


## Docker

You can also just use a docker-image include Node.js.

```bash
$ docker run --rm -v $PWD:/app -u $UID -ti node:16 bash
node@87e1438ef553:/$ cd /app
node@87e1438ef553:/app$ npm ci
node@87e1438ef553:/app$ npm run dev
```
3 changes: 0 additions & 3 deletions devices-overview/.browserslistrc

This file was deleted.

18 changes: 0 additions & 18 deletions devices-overview/.eslintrc.js

This file was deleted.

23 changes: 0 additions & 23 deletions devices-overview/.gitignore

This file was deleted.

Loading

0 comments on commit 00c0af2

Please sign in to comment.