mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
docs: Add syntax highlighting languages to code blocks.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
(cherry picked from commit b29b6f6526)
This commit is contained in:
@@ -101,7 +101,7 @@ defined using a special Markdown extension
|
||||
(`zerver/openapi/markdown_extension.py`). To use this extension, one
|
||||
writes a Markdown file block that looks something like this:
|
||||
|
||||
```
|
||||
```md
|
||||
{start_tabs}
|
||||
{tab|python}
|
||||
|
||||
@@ -169,7 +169,7 @@ an API endpoint supports. You'll see this in files like
|
||||
directive (implemented in
|
||||
`zerver/lib/markdown/api_arguments_table_generator.py`):
|
||||
|
||||
```
|
||||
```md
|
||||
{generate_api_arguments_table|zulip.yaml|/messages/render:post}
|
||||
```
|
||||
|
||||
@@ -186,7 +186,7 @@ You can use the following Markdown directive to render the fixtures
|
||||
defined in the OpenAPI `zulip.yaml` for a given endpoint and status
|
||||
code:
|
||||
|
||||
```
|
||||
```md
|
||||
{generate_code_example|/messages/render:post|fixture(200)}
|
||||
```
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ Usually, this involves a few steps:
|
||||
If your new integration is an incoming webhook integration, you can generate
|
||||
the screenshot using `tools/generate-integration-docs-screenshot`:
|
||||
|
||||
```sh
|
||||
```bash
|
||||
./tools/generate-integration-docs-screenshot --integration integrationname
|
||||
```
|
||||
|
||||
@@ -136,7 +136,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
|
||||
to generate URLs of the form:
|
||||
|
||||
```
|
||||
```text
|
||||
https://bot_email:bot_api_key@yourZulipDomain.zulipchat.com/api/v1/external/beanstalk
|
||||
```
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ types of authentication, and configure other settings. Once defined,
|
||||
information in this section rarely changes.
|
||||
|
||||
For example, the `swagger` and `info` objects look like this:
|
||||
```
|
||||
```yaml
|
||||
# Basic Swagger UI info
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
@@ -79,7 +79,7 @@ expects a GET request with one
|
||||
Basic authentication, and returns a JSON response containing `msg`,
|
||||
`result`, and `presence` values.
|
||||
|
||||
```
|
||||
```yaml
|
||||
/users/{user}/presence:
|
||||
get:
|
||||
description: Get presence data for another user.
|
||||
@@ -119,7 +119,7 @@ contains schemas referenced by other objects. For example,
|
||||
contains three required parameters. Two are strings, and one is an
|
||||
integer.
|
||||
|
||||
```
|
||||
```yaml
|
||||
MessageResponse:
|
||||
type: object
|
||||
required:
|
||||
@@ -183,7 +183,7 @@ correct.
|
||||
|
||||
### Examples:
|
||||
|
||||
```
|
||||
```yaml
|
||||
Description: |
|
||||
This description has multiple lines.
|
||||
Sometimes descriptions can go on for
|
||||
|
||||
@@ -43,7 +43,7 @@ your changes), the dependencies are automatically installed as part of
|
||||
Zulip development environment provisioning, and you can build the
|
||||
documentation using:
|
||||
|
||||
```
|
||||
```bash
|
||||
./tools/build-docs
|
||||
```
|
||||
|
||||
|
||||
@@ -210,7 +210,7 @@ instructions. For instance, it may address a common problem users may
|
||||
encounter while following the instructions, or point to an option for power
|
||||
users.
|
||||
|
||||
```
|
||||
```md
|
||||
!!! tip ""
|
||||
If you've forgotten your password, see the
|
||||
[Change your password](/help/change-your-password) page for
|
||||
@@ -220,7 +220,7 @@ users.
|
||||
A **warning** is a note on what happens when there is some kind of problem.
|
||||
Tips are more common than warnings.
|
||||
|
||||
```
|
||||
```md
|
||||
!!! warn ""
|
||||
**Note:** If you attempt to input a nonexistent stream name, an error
|
||||
message will appear.
|
||||
@@ -237,14 +237,16 @@ design to easily show the instructions for different
|
||||
[platforms](https://zulip.com/help/logging-out) in user docs,
|
||||
languages in API docs, etc. To create a tab switcher, write:
|
||||
|
||||
{start_tabs}
|
||||
{tab|desktop-web}
|
||||
# First tab's content
|
||||
{tab|ios}
|
||||
# Second tab's content
|
||||
{tab|android}
|
||||
# Third tab's content
|
||||
{end_tabs}
|
||||
```md
|
||||
{start_tabs}
|
||||
{tab|desktop-web}
|
||||
# First tab's content
|
||||
{tab|ios}
|
||||
# Second tab's content
|
||||
{tab|android}
|
||||
# Third tab's content
|
||||
{end_tabs}
|
||||
```
|
||||
|
||||
The tab identifiers (e.g. `desktop-web` above) and their mappings to
|
||||
the tabs' labels are declared in
|
||||
|
||||
Reference in New Issue
Block a user