Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/opsdroid/opsdroid into fi…
Browse files Browse the repository at this point in the history
…x_matrix_docs
  • Loading branch information
jacobtomlinson committed Apr 25, 2024
2 parents fbdbd84 + 3fff308 commit baf9fed
Show file tree
Hide file tree
Showing 98 changed files with 2,066 additions and 1,506 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/deploy-docker-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repos
uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
id: builder
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
Expand All @@ -20,22 +28,21 @@ jobs:
ghcr.io/${{ github.repository_owner }}/opsdroid
tags: |
type=raw,value=dev
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Dockerhub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm
labels: ${{ steps.docker_meta.outputs.labels }}
28 changes: 17 additions & 11 deletions .github/workflows/deploy-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: 'arm64,arm'
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v3
Expand All @@ -18,22 +25,21 @@ jobs:
ghcr.io/${{ github.repository_owner }}/opsdroid
tags: |
type=semver,pattern={{raw}}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Dockerhub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: linux/amd64,linux/arm64,linux/arm
labels: ${{ steps.docker_meta.outputs.labels }}
11 changes: 5 additions & 6 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: "Pull Request Labeler"
on:
pull_request_target:
types:
- opened
- pull_request_target

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@main
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
- uses: actions/labeler@v4
6 changes: 5 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
version: 2

build:
os: ubuntu-20.04
tools:
python: "3.8"

python:
version: 3.8
install:
- method: pip
path: .
Expand Down
2 changes: 1 addition & 1 deletion docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $ opsdroid start

## Reference

```eval_rst
```{eval-rst}
.. click:: opsdroid.cli:cli
:prog: opsdroid
:show-nested:
Expand Down
40 changes: 19 additions & 21 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

from recommonmark.parser import CommonMarkParser
from recommonmark.transform import AutoStructify

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -37,6 +34,25 @@
"sphinx.ext.intersphinx",
"sphinx_click.ext",
"sphinx_autodoc_typehints",
"myst_parser",
]

myst_enable_extensions = [
"amsmath",
"attrs_inline",
"attrs_block",
"colon_fence",
"deflist",
"dollarmath",
"fieldlist",
"html_admonition",
"html_image",
"linkify",
"replacements",
"smartquotes",
"strikethrough",
"substitution",
"tasklist",
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -73,21 +89,3 @@
}

autodoc_mock_imports = ["jwt", "motor"]

# -- Recommonmark ------------------------------------------------------------

github_doc_root = "https://github.com/readthedocs/recommonmark/tree/master/docs"


def setup(app):
app.add_config_value(
"recommonmark_config",
{
"url_resolver": lambda url: github_doc_root + url,
"auto_toc_tree_section": "Contents",
},
True,
)
app.add_transform(AutoStructify)
app.add_source_suffix(".md", "markdown")
app.add_source_parser(CommonMarkParser)
19 changes: 8 additions & 11 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Configuration

```eval_rst
.. contents::
```{contents}
```

## Config file
Expand Down Expand Up @@ -74,11 +73,10 @@ Opsdroid comes with some built-in connectors out of the box. A connector is a mo

The built-in connectors are:

```eval_rst
.. toctree::
:maxdepth: 2
```{toctree}
:maxdepth: 2
connectors/index
connectors/index
```

_Note: More connectors will be added as built-in connectors into the opsdroid core over time._
Expand Down Expand Up @@ -122,11 +120,10 @@ Skills can store data in opsdroid's "memory", this is a dictionary which can be

The built-in databases are:

```eval_rst
.. toctree::
:maxdepth: 2
```{toctree}
:maxdepth: 2
databases/index
databases/index
```

_Config options of the databases themselves differ between databases. See the database documentation for details._
Expand Down Expand Up @@ -493,7 +490,7 @@ web:
allow-headers:
- X-Token
```

(module-options)=
## Module options

### Install Location
Expand Down
23 changes: 13 additions & 10 deletions docs/connectors/custom.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
## Creating a custom connector
# Creating a custom connector

## Connectors
Connectors are a class which extends the base opsdroid Connector. The class has three mandatory methods, `connect`, `listen` and `respond`. There are also some default values you can override with the `__init__` function, just be sure you are setting everything that the default init sets.

#### configuration (property)
(configuration)=
### configuration (property)
*configuration* is a class property of Connector. It's used to access the config parameters of a Connector. This can be used to retrieve specific parameters of a connector from `configuration.yaml`.

#### connect
connect is a method which connects to a specific chat service

### Methods
## Methods

### connect
connect is a method which connects to a specific chat service

#### listen
### listen
*listen* uses the open connection to the chat service and retrieves messages from it. Each message is formatted into an opsdroid Message object and then parsed. This method should block the thread with an infinite loop but use `await` commands when getting new messages and parsing with opsdroid. This allows the [event loop](https://docs.python.org/3/library/asyncio-eventloop.html) to hand control of the thread to a different function while we are waiting.

#### user_typing
### user_typing
*user_typing* triggers the event message *user is typing* if the connector allows it. This method uses a parameter `trigger` that takes in a boolean value to trigger the event on/off.

#### disconnect
### disconnect
*disconnect* there is also an optional disconnect method that will be called upon shutdown of opsdroid. This can be used to perform any disconnect operations for the connector.


### Handling Events
## Handling Events

Opsdroid supports different types of events, which can both be sent and received via connectors, for more information on the different types of events see the [events documentation](../skills/events.md).

Expand Down Expand Up @@ -93,5 +96,5 @@ class MyConnector(Connector):
```

---
You might also be interested in reading the [configuration reference - Connector Modules](../configuration.md#connector-modules) in the documentation.
You might also be interested in reading the [configuration reference - Connector Modules](../configuration.md "Connector Modules") in the documentation.
*If you need help or if you are unsure about something join our* [matrix channel](https://app.element.io/#/room/#opsdroid-general:matrix.org) *and ask away! We are more than happy to help you.*
Loading

0 comments on commit baf9fed

Please sign in to comment.