Documenting an integration

In order for a Zulip integration to be useful to users, it must be documented. Zulip's common system for documenting integrations involves writing Markdown files, either at zerver/webhooks/{webhook_name}/doc.md (for webhook integrations) or templates/zerver/integrations/{integration_name}.md (for other integrations).

Usually, this involves a few steps:

Zulip's pre-defined Markdown macros can be used for some of these steps. See Markdown macros for further details.

If you cannot find an SVG graphic of the logo, please find and include a PNG image of the logo instead.

If your new integration is an incoming webhook integration, you can generate the screenshot using tools/generate-integration-docs-screenshot:

bash ./tools/generate-integration-docs-screenshot --integration integrationname

If you have trouble using this tool, you can also manually generate the screenshot using manage.py send_webhook_fixture_message. When generating the screenshot of a sample message using this method, give your test bot a nice name like "GitHub Bot", use the project's logo as the bot's avatar, and take the screenshot showing the stream/topic bar for the message, not just the message body.

Markdown macros

Macros are elements in the format of {!macro.md!} that insert common phrases and steps at the location of the macros. Macros help eliminate repeated content in our documentation.

The source for macros is the Markdown files under templates/zerver/help/include in the main Zulip server repository. If you find multiple instances of particular content in the documentation, you can always create a new macro by adding a new file to that folder.

Here are a few common macros used to document Zulip's integrations:

Writing guidelines

For the vast majority of integrations, you should just copy the docs for a similar integration and edit it. Basecamp is a good one to copy.

General writing guidelines

At a high level, the goals are for the instructions to feel simple, be easy to follow, and be easy to maintain. Easier said than done, but here are a few concrete guidelines.

Feel simple
Be easy to follow
Be easy to maintain

Guidelines for specific steps

Most doc files should start with a generic sentence about the integration, for example, "Get webhook name notifications in Zulip!" A typical doc will then have the following steps.

"Create the stream" step
"Create the bot" step
"Fill out form and save" step

Lastly, end with the congrats.md macro and a screenshot of a sample message within Zulip.

Screenshots

Screenshots are hard to maintain, so we generally err on the side of not including screenshots. That being said, screenshots may be used to aid the process if the third-party UI is confusing or a specific UI element is hard to find. A few things to keep in mind: