Skip to content

Commit

Permalink
docs: add multi-version support (#178)
Browse files Browse the repository at this point in the history
* docs: add mike support
* docs: update dev docs
* ci: build and deploy mike docs
* fix secret variable
  • Loading branch information
piksel authored Jul 3, 2021
1 parent 1e34cb3 commit a86ddc7
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 22 deletions.
35 changes: 24 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ name: Deploy Docs
on:
workflow_dispatch:
workflow_run:
workflows: ["Release Workflow"]
types: [completed]
workflows: [ "Release Workflow" ]
types: [ completed ]
push:
branches:
- main
- latest

jobs:
build:
Expand All @@ -20,20 +24,29 @@ jobs:
python-version: '3.x'

- name: Install mkdocs
env:
MKDOCSMAT_TOKEN: ${{ secrets.MKDOCSMAT_TOKEN }}
run: |
pip install \
mkdocs \
mkdocs-material \
md-toc
mike \
md-toc \
git+https://[email protected]/squidfunk/mkdocs-material-insiders.git
- name: Generate service config docs
run: bash generate-service-config-docs.sh

- name: Generate docs
run: mkdocs build
- name: Update env for docs (dev/main)
if: ${{ github.ref == 'refs/heads/main' }}
run: |
echo "DOCS_EDIT_URI=/edit/main/docs/" >> $GITHUB_ENV
echo "DOCS_VERSION=dev" >> $GITHUB_ENV
- name: Publish docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
- name: Update env (latest)
if: ${{ github.ref == 'refs/heads/latest' }}
run: |
echo "DOCS_EDIT_URI=/edit/latest/docs/" >> $GITHUB_ENV
echo "DOCS_VERSION=latest" >> $GITHUB_ENV
- name: Deploy docs
run: mike deploy --push $DOCS_VERSION
9 changes: 9 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{% extends "base.html" %}

{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">

<strong>Click here to go to latest.</strong>
</a>
{% endblock %}
5 changes: 5 additions & 0 deletions docs/services/generic.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Generic

## URL Format

--8<-- "docs/services/generic/config.md"
2 changes: 1 addition & 1 deletion docs/services/googlechat.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ room menu.
![Screenshot 2](googlechat/hangouts-2.png)

3. Name the webhook and save.
![Screenshot 3](googkechat/hangouts-3.png)
![Screenshot 3](googlechat/hangouts-3.png)

4. Copy the URL.
![Screenshot 4](googlechat/hangouts-4.png)
Expand Down
2 changes: 1 addition & 1 deletion docs/services/hangouts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Hangouts Chat

Google Chat was previously known as *Hangouts Chat*. See [Google
Chat](../googlechat.md).
Chat](googlechat.md).

Using `hangouts` in the service URL instead `googlechat` is still
supported, although deprecated.
6 changes: 6 additions & 0 deletions docs/services/logger.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Logger

No configuration options are available for this service.

It simply emits notifications to the Shoutrrr log which is
configured by the consumer.
12 changes: 3 additions & 9 deletions docs/services/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ Click on the service for a more thorough explanation. <!-- @formatter:off -->
| [Discord](./discord.md) | *discord://__`token`__@__`id`__* |
| [Email](./email.md) | *smtp://__`username`__:__`password`__@__`host`__:__`port`__/?fromAddress=__`fromAddress`__&toAddresses=__`recipient1`__[,__`recipient2`__,...]* |
| [Gotify](./gotify.md) | *gotify://__`gotify-host`__/__`token`__* |
| [Google Chat](./googlechat.md) | *googlechat://chat.googleapis.com/v1/spaces/FOO/messages?key=bar&token=baz* |
| [Google Chat](./googlechat.md) | *googlechat://chat.googleapis.com/v1/spaces/FOO/messages?key=bar&token=baz* |
| [IFTTT](./ifttt.md) | *ifttt://__`key`__/?events=__`event1`__[,__`event2`__,...]&value1=__`value1`__&value2=__`value2`__&value3=__`value3`__* |
| [Join](./join.md) | *join://shoutrrr:__`api-key`__@join/?devices=__`device1`__[,__`device2`__, ...][&icon=__`icon`__][&title=__`title`__]* |
| [Mattermost](./mattermost.md) | *mattermost://[__`username`__@]__`mattermost-host`__/__`token`__[/__`channel`__]* |
| [Matrix](./matrix.md) | *matrix://__`username`__:__`password`__@__`host`__:__`port`__/[?rooms=__`!roomID1`__[,__`roomAlias2`__]]* |
| [OpsGenie](./opsgenie.md) | *opsgenie://__`host`__/token?responders=__`responder1`__[,__`responder2`__]* |
| [Pushbullet](./pushbullet.md) | *pushbullet://__`api-token`__[/__`device`__/#__`channel`__/__`email`__]* |
| [Pushover](./pushover.md) | *pushover://shoutrrr:__`apiToken`__@__`userKey`__/?devices=__`device1`__[,__`device2`__, ...]* |
Expand All @@ -25,12 +26,5 @@ Click on the service for a more thorough explanation. <!-- @formatter:off -->
| Service | Description |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Logger](./logger.md) | Writes notification to a configured go `log.Logger` |

## Upcoming services

*Note that these are not available in the current release*

| Service | Description |
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| [Generic Webhook](./generic.md) | Sends notifications directly to a webhook |
| [Matrix](./matrix.md) | *matrix://__`username`__:__`password`__@__`host`__:__`port`__/[?rooms=__`!roomID1`__[,__`roomAlias2`__]]* |

6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ theme:
scheme: shoutrrr
logo: shoutrrr-180px.png
favicon: favicon.ico
custom_dir: docs/overrides
extra:
version:
provider: mike
generator: false
extra_css:
- stylesheets/theme.css
markdown_extensions:
Expand All @@ -34,6 +39,7 @@ nav:
- IFTTT: 'services/ifttt.md'
- Join: 'services/join.md'
- Mattermost: 'services/mattermost.md'
- Matrix: 'services/matrix.md'
- OpsGenie: 'services/opsgenie.md'
- Pushbullet: 'services/pushbullet.md'
- Pushover: 'services/pushover.md'
Expand Down

0 comments on commit a86ddc7

Please sign in to comment.