docs: Fix formatting of integration-docs-guide.md

This commit is contained in:
derAnfaenger 2017-11-22 17:33:52 +01:00 committed by Tim Abbott
parent 43484ad494
commit a1d255471c
1 changed files with 98 additions and 79 deletions

View File

@ -70,25 +70,28 @@ Here are a few common macros used to document Zulip's integrations:
* **Contents:** * **Contents:**
See [source][1]. See [source][1].
**Note:** `{{ integration_display_name }}` is replaced by **Note:** `{{ integration_display_name }}` is replaced by
[Integration.display_name][2] and `{{ recommended_stream_name }}` [Integration.display_name][2] and `{{ recommended_stream_name }}`
is replaced by [Integration.stream_name][3]. is replaced by [Integration.stream_name][3].
* **Example usage:** * **Example usage:**
``` ```
{!create-stream.md!} {!create-stream.md!}
``` ```
* **Example rendering:** * **Example rendering:**
``` text
First, create the stream you would like to use for GitLab notifications,
and subscribe all interested parties to this stream. We recommend the
name gitlab.
The integration will use the default stream gitlab if no stream is ```text
supplied in the URL; you still need to create the stream even if you First, create the stream you would like to use for GitLab notifications,
are using this default. and subscribe all interested parties to this stream. We recommend the
``` name gitlab.
The integration will use the default stream gitlab if no stream is
supplied in the URL; you still need to create the stream even if you
are using this default.
```
### `{!create-bot-construct-url.md!}` macro ### `{!create-bot-construct-url.md!}` macro
@ -97,7 +100,9 @@ Here are a few common macros used to document Zulip's integrations:
generated automatically for every webhook by using attributes in the generated automatically for every webhook by using attributes in the
[WebhookIntegration][4] class. [WebhookIntegration][4] class.
* **Contents:** See [source][5]. **Note:** If special configuration is * **Contents:** See [source][5].
**Note:** If special configuration is
required to set up the URL and you can't use this macro, be sure to use the required to set up the URL and you can't use this macro, be sure to use the
`{{ api_url }}` template variable, so that your integration `{{ api_url }}` template variable, so that your integration
documentation will provide the correct URL for whatever server it is documentation will provide the correct URL for whatever server it is
@ -105,22 +110,24 @@ Here are a few common macros used to document Zulip's integrations:
variable, you should document that too. variable, you should document that too.
* **Example usage:** * **Example usage:**
``` ```
{!create-bot-construct-url.md!} {!create-bot-construct-url.md!}
``` ```
Usually used right after `{!create-stream!}`. Usually used right after `{!create-stream!}`.
* **Example rendering:** * **Example rendering:**
```
Next, on your Zulip settings page, create a bot for GitLab. Construct
the URL for the GitLab bot using the bot API key and stream name:
https://yourZulipDomain.zulipchat.com/api/v1/external/gitlab?api_key=abcdefgh&stream=gitlab ```text
Next, on your Zulip settings page, create a bot for GitLab. Construct
the URL for the GitLab bot using the bot API key and stream name:
Modify the parameters of the URL above, where api_key is the API key of https://yourZulipDomain.zulipchat.com/api/v1/external/gitlab?api_key=abcdefgh&stream=gitlab
your Zulip bot, and stream is the stream name you want the notifications
sent to. Modify the parameters of the URL above, where api_key is the API key of
``` your Zulip bot, and stream is the stream name you want the notifications
sent to.
```
### `{!append-stream-name.md!}` macro ### `{!append-stream-name.md!}` macro
@ -130,16 +137,18 @@ Here are a few common macros used to document Zulip's integrations:
* **Contents:** See [source][6]. * **Contents:** See [source][6].
* **Example usage:** Usually used right after `{!create-bot-construct-url.md!}`. * **Example usage:** Usually used right after `{!create-bot-construct-url.md!}`.
``` ```
{!append-stream-name.md!} {!append-stream-name.md!}
``` ```
* **Example rendering:** * **Example rendering:**
```
To specify the stream, you must explicitly append ```
`&stream=stream_name` to the end of the above URL, where To specify the stream, you must explicitly append
`stream_name` is the stream you want the notifications sent to. `&stream=stream_name` to the end of the above URL, where
``` `stream_name` is the stream you want the notifications sent to.
```
### `{!append-topic.md!}` macro ### `{!append-topic.md!}` macro
@ -149,15 +158,17 @@ Here are a few common macros used to document Zulip's integrations:
* **Contents:** See [source][7]. * **Contents:** See [source][7].
* **Example usage:** Usually used right after `{!create-bot-construct-url.md!}`. * **Example usage:** Usually used right after `{!create-bot-construct-url.md!}`.
``` ```
{!append-topic.md!} {!append-topic.md!}
``` ```
* **Example rendering:** * **Example rendering:**
```
To change the topic used by the bot, simply append `&topic=name` ```
to the end of the above URL, where `name` is your topic. To change the topic used by the bot, simply append `&topic=name`
``` to the end of the above URL, where `name` is your topic.
```
### `{!congrats.md!}` macro ### `{!congrats.md!}` macro
@ -168,16 +179,18 @@ Here are a few common macros used to document Zulip's integrations:
* **Example usage:** Usually used at the end of the documentation, right * **Example usage:** Usually used at the end of the documentation, right
before the sample message screenshot. before the sample message screenshot.
``` ```
{!congrats.md!} {!congrats.md!}
``` ```
* **Example rendering:** * **Example rendering:**
```
**Congratulations! You're done!**
Your WebhookName notifications may look like: ```
``` **Congratulations! You're done!**
Your WebhookName notifications may look like:
```
### `{!download-python-bindings.md!}` macro ### `{!download-python-bindings.md!}` macro
@ -188,15 +201,17 @@ Here are a few common macros used to document Zulip's integrations:
* **Example usage:** Currently mostly used in non-webhook integrations docs * **Example usage:** Currently mostly used in non-webhook integrations docs
under `templates/zerver/integrations/<integration_name>.md`. under `templates/zerver/integrations/<integration_name>.md`.
``` ```
{!download-python-bindings.md!} {!download-python-bindings.md!}
``` ```
* **Example rendering:** * **Example rendering:**
``` text
Download and install our [Python bindings and example scripts](/api) ``` text
on the server where the IntegrationName bot will live. Download and install our [Python bindings and example scripts](/api)
``` on the server where the IntegrationName bot will live.
```
### `{!change-zulip-config-file.md!}` macro ### `{!change-zulip-config-file.md!}` macro
@ -207,22 +222,24 @@ Here are a few common macros used to document Zulip's integrations:
* **Example usage:** Usually used in non-webhook integration docs under * **Example usage:** Usually used in non-webhook integration docs under
`templates/zerver/integrations/<integration_name>.md`. `templates/zerver/integrations/<integration_name>.md`.
``` ```
{!change-zulip-config-file.md!} {!change-zulip-config-file.md!}
``` ```
* **Example rendering:** * **Example rendering:**
```
On your Zulip settings page, create a bot for Codebase.
Next, open `integrations/codebase/zulip_codebase_config.py` with your ```
favorite editor, and change the following lines to specify the email On your Zulip settings page, create a bot for Codebase.
address and API key for your Codebase bot:
Next, open `integrations/codebase/zulip_codebase_config.py` with your
favorite editor, and change the following lines to specify the email
address and API key for your Codebase bot:
ZULIP_USER = "codebase-bot@example.com" ZULIP_USER = "codebase-bot@example.com"
ZULIP_API_KEY = "0123456789abcdef0123456789abcdef" ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
ZULIP_SITE = "http://localhost:9991/api" ZULIP_SITE = "http://localhost:9991/api"
``` ```
### `{!git-append-branches.md!}` and `{!git-webhook-url-with-branches.md!}` ### `{!git-append-branches.md!}` and `{!git-webhook-url-with-branches.md!}`
@ -233,6 +250,7 @@ Here are a few common macros used to document Zulip's integrations:
[git-webhook-url-with-branches][13]. [git-webhook-url-with-branches][13].
* **Example usage:** Used exclusively in Git integrations. * **Example usage:** Used exclusively in Git integrations.
``` ```
{!git-append-branches.md!} {!git-append-branches.md!}
{!git-webhook-url-with-branches.md!} {!git-webhook-url-with-branches.md!}
@ -249,6 +267,7 @@ Here are a few common macros used to document Zulip's integrations:
* `{!webhook-url-with-bot-email.md!}` - Used in certain non-webhook integrations * `{!webhook-url-with-bot-email.md!}` - Used in certain non-webhook integrations
to generate URLs of the form (see [source][14]): to generate URLs of the form (see [source][14]):
``` ```
https://bot_email:bot_api_key@yourZulipDomain.zulipchat.com/api/v1/external/beanstalk https://bot_email:bot_api_key@yourZulipDomain.zulipchat.com/api/v1/external/beanstalk
``` ```