mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
docs: Update API and contributor documentation for new macro.
Updates API and contributor documentation for writing integrations for the new `generate-integration-url.md` macro. Removes all refrences to `create-bot-construct-url.md`, which was removed in the previous commit.
This commit is contained in:
committed by
Tim Abbott
parent
0d525cf644
commit
e72a9fb814
@@ -429,8 +429,9 @@ Learn how Zulip integrations work with this simple Hello World example!
|
||||
by default in the Zulip development environment. If you are running
|
||||
Zulip in production, you should make sure that this stream exists.
|
||||
|
||||
1. {!create-bot-construct-url.md!}
|
||||
1. {!create-an-incoming-webhook.md!}
|
||||
|
||||
1. {!generate-integration-url.md!}
|
||||
|
||||
1. To trigger a notification using this example webhook, you can use
|
||||
`send_webhook_fixture_message` from a [Zulip development
|
||||
@@ -455,7 +456,7 @@ Learn how Zulip integrations work with this simple Hello World example!
|
||||
|
||||
```
|
||||
|
||||
`{!create-bot-construct-url.md!}` and `{!congrats.md!}` are examples of
|
||||
`{!create-an-incoming-webhook.md!}` and `{!congrats.md!}` are examples of
|
||||
a Markdown macro. Zulip has a macro-based Markdown/Jinja2 framework that
|
||||
includes macros for common instructions in Zulip's webhooks/integrations
|
||||
documentation.
|
||||
|
@@ -85,10 +85,8 @@ Here are a few common macros used to document Zulip's integrations:
|
||||
for a given integration and select **Generic bot** as the **Bot type**. For an
|
||||
example rendering, see [the docs for Zulip's Matrix integration][matrix].
|
||||
|
||||
- `{!create-bot-construct-url.md!}` macro - Instructs users to create a bot
|
||||
- `{!create-an-incoming-webhook.md!}` macro - Instructs users to create a bot
|
||||
for a given integration and select **Incoming webhook** as the **Bot type**.
|
||||
The URL is generated automatically for every incoming webhook by using
|
||||
attributes in the `WebhookIntegration` class in [zerver/lib/integrations.py][integrations-file].
|
||||
This macro is usually used right after `{!create-stream!}`. For an example
|
||||
rendering, see **Step 2** of [the docs for Zulip's GitHub integration][github-integration].
|
||||
|
||||
@@ -99,15 +97,20 @@ Here are a few common macros used to document Zulip's integrations:
|
||||
deployed on. If special configuration is required to set the `SITE`
|
||||
variable, you should document that too.
|
||||
|
||||
- `{!generate-integration-url.md!}` - Instructs user how to get the URL for a
|
||||
bot for a given integration. An example URL is generated automatically for
|
||||
every incoming webhook by using attributes in the `WebhookIntegration` class
|
||||
in [zerver/lib/integrations.py][integrations-file].
|
||||
|
||||
- `{!append-stream-name.md!}` macro - Recommends appending `&stream=stream_name`
|
||||
to a URL in cases where supplying a stream name in the URL is optional.
|
||||
Supplying a stream name is optional for most Zulip integrations. If you use
|
||||
`{!create-bot-construct-url.md!}`, this macro need not be used.
|
||||
`{!generate-integration-url.md!}`, this macro need not be used.
|
||||
|
||||
- `{!append-topic.md!}` macro - Recommends appending `&topic=my_topic` to a URL
|
||||
to supply a custom topic for webhook notification messages. Supplying a custom
|
||||
topic is optional for most Zulip integrations. If you use
|
||||
`{!create-bot-construct-url.md!}`, this macro need not be used.
|
||||
`{!generate-integration-url.md!}`, this macro need not be used.
|
||||
|
||||
- `{!congrats.md!}` macro - Inserts congratulatory lines signifying the
|
||||
successful setup of a given integration. This macro is usually used at
|
||||
@@ -135,7 +138,7 @@ Here are a few common macros used to document Zulip's integrations:
|
||||
see the last paragraph of **Step 2** in
|
||||
[the docs for Zulip's GitHub integration][github-integration].
|
||||
|
||||
- `{!webhook-url.md!}` - Used internally by `{!create-bot-construct-url.md!}`
|
||||
- `{!webhook-url.md!}` - Used internally by `{!generate-integration-url.md!}`
|
||||
to generate the webhook URL.
|
||||
|
||||
- `{!webhook-url-with-bot-email.md!}` - Used in certain non-webhook integrations
|
||||
@@ -215,10 +218,12 @@ A typical doc will then have the following steps.
|
||||
|
||||
##### "Create the bot" step
|
||||
|
||||
- Typically, use the `create-bot-construct-url` macro.
|
||||
- [Existing macros](#markdown-macros) should be used for this if they exist, but if the macro
|
||||
defaults don’t work, it may make sense to write something custom for the
|
||||
integration in question. This step is mandatory for all integrations.
|
||||
- Typically, use the `create-an-incoming-webhook` and
|
||||
`generate-integration-url` macros.
|
||||
- [Existing macros](#markdown-macros) should be used for this if they exist,
|
||||
but if the macro defaults don’t work, it may make sense to write something
|
||||
custom for the integration in question. This step is mandatory for all
|
||||
integrations.
|
||||
|
||||
##### "Navigate to this screen" step
|
||||
|
||||
|
Reference in New Issue
Block a user