api docs: Replace most markdown files with a common template.

This PR adds a basic .md template that is followed by lot of /api
pages. Since we have recently done the migration work to ensure that
our REST API documentation pages for individual endpoints are almost
all identical files following a common pattern, we can now get the
payoff of deleting them all in favor of a shared template.

This removes 2000 lines of somewhat finicky configuration from the
codebase, and thus should save significant effort when documenting new
API endpoints in the future.

The markdown files for endpoints or other pages which deviate from the
standard template remain, and the docs are instead generated from
those files using the existing system.
This commit is contained in:
Suyash Vardhan Mathur 2021-05-23 16:57:41 +05:30 committed by Tim Abbott
parent 15123bca68
commit 23b991a801
62 changed files with 70 additions and 2010 deletions

View File

@ -1,35 +0,0 @@
{generate_api_title(/realm/playgrounds:post)}
{generate_api_description(/realm/playgrounds:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/playgrounds:post|example}
{generate_code_example(javascript)|/realm/playgrounds:post|example}
{tab|curl}
{generate_code_example(curl)|/realm/playgrounds:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/playgrounds:post}
{generate_parameter_description(/realm/playgrounds:post)}
## Response
{generate_return_values_table|zulip.yaml|/realm/playgrounds:post}
{generate_response_description(/realm/playgrounds:post)}
#### Example response
{generate_code_example|/realm/playgrounds:post|fixture(200)}
{generate_code_example|/realm/playgrounds:post|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/realm/filters:post)}
{generate_api_description(/realm/filters:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/filters:post|example}
{generate_code_example(javascript)|/realm/filters:post|example}
{tab|curl}
{generate_code_example(curl)|/realm/filters:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/filters:post}
{generate_parameter_description(/realm/filters:post)}
## Response
{generate_return_values_table|zulip.yaml|/realm/filters:post}
{generate_response_description(/realm/filters:post)}
#### Example response
{generate_code_example|/realm/filters:post|fixture(200)}
{generate_code_example|/realm/filters:post|fixture(400)}

View File

@ -1,34 +0,0 @@
{generate_api_title(/messages/{message_id}/reactions:post)}
{generate_api_description(/messages/{message_id}/reactions:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/{message_id}/reactions:post|example}
{generate_code_example(javascript)|/messages/{message_id}/reactions:post|example}
{tab|curl}
{generate_code_example(curl)|/messages/{message_id}/reactions:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}/reactions:post}
{generate_parameter_description(/messages/{message_id}/reactions:post)}
## Response
{generate_response_description(/messages/{message_id}/reactions:post)}
#### Example response
{generate_code_example|/messages/{message_id}/reactions:post|fixture(200)}
{generate_code_example|/messages/{message_id}/reactions:post|fixture(400)}

View File

@ -0,0 +1,35 @@
{generate_api_title(API_ENDPOINT_NAME)}
{generate_api_description(API_ENDPOINT_NAME)}
## Usage examples
{start_tabs}
{generate_code_example(python)|API_ENDPOINT_NAME|example}
{generate_code_example(javascript)|API_ENDPOINT_NAME|example}
{tab|curl}
{generate_code_example(curl)|API_ENDPOINT_NAME|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|API_ENDPOINT_NAME}
{generate_parameter_description(API_ENDPOINT_NAME)}
## Response
{generate_return_values_table|zulip.yaml|API_ENDPOINT_NAME}
{generate_response_description(API_ENDPOINT_NAME)}
#### Example response
{generate_code_example|API_ENDPOINT_NAME|fixture(200)}
{generate_code_example|API_ENDPOINT_NAME|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/streams/{stream_id}:delete)}
{generate_api_description(/streams/{stream_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/streams/{stream_id}:delete|example}
{generate_code_example(javascript)|/streams/{stream_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/streams/{stream_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/streams/{stream_id}:delete}
{generate_parameter_description(/streams/{stream_id}:delete)}
## Response
{generate_response_description(/streams/{stream_id}:delete)}
#### Example response
{generate_code_example|/streams/{stream_id}:delete|fixture(200)}
{generate_code_example|/streams/{stream_id}:delete|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages/matches_narrow:get)}
{generate_api_description(/messages/matches_narrow:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/matches_narrow:get|example}
{generate_code_example(javascript)|/messages/matches_narrow:get|example}
{tab|curl}
{generate_code_example(curl)|/messages/matches_narrow:get|example}
{end_tabs}
## Arguments
{generate_api_arguments_table|zulip.yaml|/messages/matches_narrow:get}
{generate_parameter_description(/messages/matches_narrow:get)}
## Response
{generate_return_values_table|zulip.yaml|/messages/matches_narrow:get}
{generate_response_description(/messages/matches_narrow:get)}
#### Example response
{generate_code_example|/messages/matches_narrow:get|fixture(200)}
{generate_code_example|/messages/matches_narrow:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/realm/profile_fields:post)}
{generate_api_description(/realm/profile_fields:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/profile_fields:post|example}
{generate_code_example(javascript)|/realm/profile_fields:post|example}
{tab|curl}
{generate_code_example(curl)|/realm/profile_fields:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/profile_fields:post}
{generate_parameter_description(/realm/profile_fields:post)}
## Response
{generate_return_values_table|zulip.yaml|/realm/profile_fields:post}
{generate_response_description(/realm/profile_fields:post)}
#### Example response
{generate_code_example|/realm/profile_fields:post|fixture(200)}
{generate_code_example|/realm/profile_fields:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/user_groups/create:post)}
{generate_api_description(/user_groups/create:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/user_groups/create:post|example}
{generate_code_example(javascript)|/user_groups/create:post|example}
{tab|curl}
{generate_code_example(curl)|/user_groups/create:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/user_groups/create:post}
{generate_parameter_description(/user_groups/create:post)}
## Response
{generate_response_description(/user_groups/create:post)}
#### Example response
{generate_code_example|/user_groups/create:post|fixture(200)}
{generate_code_example|/user_groups/create:post|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users:post)}
{generate_api_description(/users:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users:post|example}
{generate_code_example(javascript)|/users:post|example}
{tab|curl}
{generate_code_example(curl)|/users:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users:post}
{generate_parameter_description(/users:post)}
## Response
{generate_return_values_table|zulip.yaml|/users:post}
{generate_response_description(/users:post)}
#### Example response
{generate_code_example|/users:post|fixture(200)}
{generate_code_example|/users:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/me:delete)}
{generate_api_description(/users/me:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me:delete|example}
{generate_code_example(javascript)|/users/me:delete|example}
{tab|curl}
{generate_code_example(curl)|/users/me:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me:delete}
{generate_parameter_description(/users/me:delete)}
## Response
{generate_response_description(/users/me:delete)}
#### Example response
{generate_code_example|/users/me:delete|fixture(200)}
{generate_code_example|/users/me:delete|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/{user_id}:delete)}
{generate_api_description(/users/{user_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{user_id}:delete|example}
{generate_code_example(javascript)|/users/{user_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/users/{user_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:delete}
{generate_parameter_description(/users/{user_id}:delete)}
## Response
{generate_response_description(/users/{user_id}:delete)}
#### Example response
{generate_code_example|/users/{user_id}:delete|fixture(200)}
{generate_code_example|/users/{user_id}:delete|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/messages/{message_id}:delete)}
{generate_api_description(/messages/{message_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/{message_id}:delete|example}
{generate_code_example(javascript)|/messages/{message_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/messages/{message_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:delete}
{generate_parameter_description(/messages/{message_id}:delete)}
## Response
{generate_response_description(/messages/{message_id}:delete)}
#### Example response
{generate_code_example|/messages/{message_id}:delete|fixture(200)}
{generate_code_example|/messages/{message_id}:delete|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/events:delete)}
{generate_api_description(/events:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/events:delete|example}
{generate_code_example(javascript)|/events:delete|example}
{tab|curl}
{generate_code_example(curl)|/events:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/events:delete}
{generate_parameter_description(/events:delete)}
## Response
{generate_response_description(/events:delete)}
#### Example response
{generate_code_example|/events:delete|fixture(200)}
{generate_code_example|/events:delete|fixture(400)}

View File

@ -1,30 +0,0 @@
{generate_api_title(/dev_fetch_api_key:post)}
{generate_api_description(/dev_fetch_api_key:post)}
## Usage examples
{start_tabs}
{tab|curl}
{generate_code_example(curl)|/dev_fetch_api_key:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/dev_fetch_api_key:post}
{generate_parameter_description(/dev_fetch_api_key:post)}
## Response
{generate_return_values_table|zulip.yaml|/dev_fetch_api_key:post}
{generate_response_description(/dev_fetch_api_key:post)}
#### Example response
{generate_code_example|/dev_fetch_api_key:post|fixture(200)}
{generate_code_example|/dev_fetch_api_key:post|fixture(400)}

View File

@ -1,26 +0,0 @@
{generate_api_title(/fetch_api_key:post)}
{generate_api_description(/fetch_api_key:post)}
## Usage examples
{start_tabs}
{tab|curl}
{generate_code_example(curl)|/fetch_api_key:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/fetch_api_key:post}
{generate_parameter_description(/fetch_api_key:post)}
## Response
{generate_return_values_table|zulip.yaml|/fetch_api_key:post}
### Example response
{generate_code_example|/fetch_api_key:post|fixture(200)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/attachments:get)}
{generate_api_description(/attachments:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/attachments:get|example}
{generate_code_example(javascript)|/attachments:get|example}
{tab|curl}
{generate_code_example(curl)|/attachments:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/attachments:get}
{generate_parameter_description(/attachments:get)}
## Response
{generate_return_values_table|zulip.yaml|/attachments:get}
{generate_response_description(/attachments:get)}
#### Example response
{generate_code_example|/attachments:get|fixture(200)}
{generate_code_example|/attachments:get|fixture(400)}

View File

@ -1,36 +0,0 @@
{generate_api_title(/realm/emoji:get)}
{generate_api_description(/realm/emoji:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/emoji:get|example}
{generate_code_example(javascript)|/realm/emoji:get|example}
{tab|curl}
{generate_code_example(curl)|/realm/emoji:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/emoji:get}
{generate_parameter_description(/realm/emoji:get)}
## Response
{generate_return_values_table|zulip.yaml|/realm/emoji:get}
{generate_response_description(/realm/emoji:get)}
#### Example response
{generate_code_example|/realm/emoji:get|fixture(200)}
{generate_code_example|/realm/emoji:get|fixture(400)}

View File

@ -1,36 +0,0 @@
{generate_api_title(/realm/profile_fields:get)}
{generate_api_description(/realm/profile_fields:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/profile_fields:get|example}
{generate_code_example(javascript)|/realm/profile_fields:get|example}
{tab|curl}
{generate_code_example(curl)|/realm/profile_fields:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/profile_fields:get}
{generate_parameter_description(/realm/profile_fields:get)}
## Response
{generate_return_values_table|zulip.yaml|/realm/profile_fields:get}
{generate_response_description(/realm/profile_fields:get)}
#### Example response
{generate_code_example|/realm/profile_fields:get|fixture(200)}
{generate_code_example|/realm/profile_fields:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/realm/linkifiers:get)}
{generate_api_description(/realm/linkifiers:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/linkifiers:get|example}
{generate_code_example(javascript)|/realm/linkifiers:get|example}
{tab|curl}
{generate_code_example(curl)|/realm/linkifiers:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/linkifiers:get}
{generate_parameter_description(/realm/linkifiers:get)}
## Response
{generate_return_values_table|zulip.yaml|/realm/linkifiers:get}
{generate_response_description(/realm/linkifiers:get)}
#### Example response
{generate_code_example|/realm/linkifiers:get|fixture(200)}
{generate_code_example|/realm/linkifiers:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages/{message_id}/history:get)}
{generate_api_description(/messages/{message_id}/history:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/{message_id}/history:get|example}
{generate_code_example(javascript)|/messages/{message_id}/history:get|example}
{tab|curl}
{generate_code_example(curl)|/messages/{message_id}/history:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}/history:get}
{generate_parameter_description(/messages/{message_id}/history:get)}
## Response
{generate_return_values_table|zulip.yaml|/messages/{message_id}/history:get}
{generate_response_description(/messages/{message_id}/history:get)}
#### Example response
{generate_code_example|/messages/{message_id}/history:get|fixture(200)}
{generate_code_example|/messages/{message_id}/history:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages:get)}
{generate_api_description(/messages:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages:get|example}
{generate_code_example(javascript)|/messages:get|example}
{tab|curl}
{generate_code_example(curl)|/messages:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages:get}
{generate_parameter_description(/messages:get)}
## Response
{generate_return_values_table|zulip.yaml|/messages:get}
{generate_response_description(/messages:get)}
#### Example response
{generate_code_example|/messages:get|fixture(200)}
{generate_code_example|/messages:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/me:get)}
{generate_api_description(/users/me:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me:get|example}
{generate_code_example(javascript)|/users/me:get|example}
{tab|curl}
{generate_code_example(curl)|/users/me:get|example}
{end_tabs}
## Parameters
This endpoint does not accept any parameters.
{generate_parameter_description(/users/me:get)}
## Response
{generate_return_values_table|zulip.yaml|/users/me:get}
{generate_response_description(/users/me:get)}
#### Example response
{generate_code_example|/users/me:get|fixture(200)}
{generate_code_example|/users/me:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages/{message_id}:get)}
{generate_api_description(/messages/{message_id}:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/{message_id}:get|example}
{generate_code_example(javascript)|/messages/{message_id}:get|example}
{tab|curl}
{generate_code_example(curl)|/messages/{message_id}:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:get}
{generate_parameter_description(/messages/{message_id}:get)}
## Response
{generate_return_values_table|zulip.yaml|/messages/{message_id}:get}
{generate_response_description(/messages/{message_id}:get)}
#### Example response
{generate_code_example|/messages/{message_id}:get|fixture(200)}
{generate_code_example|/messages/{message_id}:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/server_settings:get)}
{generate_api_description(/server_settings:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/server_settings:get|example}
{generate_code_example(javascript)|/server_settings:get|example}
{tab|curl}
{generate_code_example(curl)|/server_settings:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/server_settings:get}
{generate_parameter_description(/server_settings:get)}
## Response
{generate_return_values_table|zulip.yaml|/server_settings:get}
{generate_response_description(/server_settings:get)}
#### Example response
{generate_code_example|/server_settings:get|fixture(200)}
{generate_code_example|/server_settings:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/get_stream_id:get)}
{generate_api_description(/get_stream_id:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/get_stream_id:get|example}
{generate_code_example(javascript)|/get_stream_id:get|example}
{tab|curl}
{generate_code_example(curl)|/get_stream_id:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/get_stream_id:get}
{generate_parameter_description(/get_stream_id:get)}
## Response
{generate_return_values_table|zulip.yaml|/get_stream_id:get}
{generate_response_description(/get_stream_id:get)}
#### Example response
{generate_code_example|/get_stream_id:get|fixture(200)}
{generate_code_example|/get_stream_id:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/me/{stream_id}/topics:get)}
{generate_api_description(/users/me/{stream_id}/topics:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/{stream_id}/topics:get|example}
{generate_code_example(javascript)|/users/me/{stream_id}/topics:get|example}
{tab|curl}
{generate_code_example(curl)|/users/me/{stream_id}/topics:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/{stream_id}/topics:get}
{generate_parameter_description(/users/me/{stream_id}/topics:get)}
## Response
{generate_return_values_table|zulip.yaml|/users/me/{stream_id}/topics:get}
{generate_response_description(/users/me/{stream_id}/topics:get)}
#### Example response
{generate_code_example|/users/me/{stream_id}/topics:get|fixture(200)}
{generate_code_example|/users/me/{stream_id}/topics:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/streams:get)}
{generate_api_description(/streams:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/streams:get|example}
{generate_code_example(javascript)|/streams:get|example}
{tab|curl}
{generate_code_example(curl)|/streams:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/streams:get}
{generate_parameter_description(/streams:get)}
## Response
{generate_return_values_table|zulip.yaml|/streams:get}
{generate_response_description(/streams:get)}
#### Example response
{generate_code_example|/streams:get|fixture(200)}
{generate_code_example|/streams:get|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/{user_id}/subscriptions/{stream_id}:get)}
{generate_api_description(/users/{user_id}/subscriptions/{stream_id}:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{user_id}/subscriptions/{stream_id}:get|example}
{generate_code_example(javascript)|/users/{user_id}/subscriptions/{stream_id}:get|example}
{tab|curl}
{generate_code_example(curl)|/users/{user_id}/subscriptions/{stream_id}:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{user_id}/subscriptions/{stream_id}:get}
{generate_parameter_description(/users/{user_id}/subscriptions/{stream_id}:get)}
## Response
{generate_response_description(/users/{user_id}/subscriptions/{stream_id}:get)}
#### Example response
{generate_code_example|/users/{user_id}/subscriptions/{stream_id}:get|fixture(200)}
{generate_code_example|/users/{user_id}/subscriptions/{stream_id}:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/me/subscriptions:get)}
{generate_api_description(/users/me/subscriptions:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/subscriptions:get|example}
{generate_code_example(javascript)|/users/me/subscriptions:get|example}
{tab|curl}
{generate_code_example(curl)|/users/me/subscriptions:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:get}
{generate_parameter_description(/users/me/subscriptions:get)}
## Response
{generate_return_values_table|zulip.yaml|/users/me/subscriptions:get}
{generate_response_description(/users/me/subscriptions:get)}
#### Example response
{generate_code_example|/users/me/subscriptions:get|fixture(200)}
{generate_code_example|/users/me/subscriptions:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/{email}:get)}
{generate_api_description(/users/{email}:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{email}:get|example}
{generate_code_example(javascript)|/users/{email}:get|example}
{tab|curl}
{generate_code_example(curl)|/users/{email}:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{email}:get}
{generate_parameter_description(/users/{email}:get)}
## Response
{generate_return_values_table|zulip.yaml}|/users/{email}:get}
{generate_response_description(/users/{email}:get)}
#### Example response
{generate_code_example|/users/{email}:get|fixture(200)}
{generate_code_example|/users/{email}:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/user_groups:get)}
{generate_api_description(/user_groups:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/user_groups:get|example}
{generate_code_example(javascript)|/user_groups:get|example}
{tab|curl}
{generate_code_example(curl)|/user_groups:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/user_groups:get}
{generate_parameter_description(/user_groups:get)}
## Response
{generate_return_values_table|zulip.yaml|/user_groups:get}
{generate_response_description(/user_groups:get)}
#### Example response
{generate_code_example|/user_groups:get|fixture(200)}
{generate_code_example|/user_groups:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/{user_id_or_email}/presence:get)}
{generate_api_description(/users/{user_id_or_email}/presence:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{user_id_or_email}/presence:get|example}
{generate_code_example(javascript)|/users/{user_id_or_email}/presence:get|example}
{tab|curl}
{generate_code_example(curl)|/users/{user_id_or_email}/presence:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{user_id_or_email}/presence:get}
{generate_parameter_description(/users/{user_id_or_email}/presence:get)}
## Response
{generate_return_values_table|zulip.yaml|/users/{user_id_or_email}/presence:get}
{generate_response_description(/users/{user_id_or_email}/presence:get)}
#### Example response
{generate_code_example|/users/{user_id_or_email}/presence:get|fixture(200)}
{generate_code_example|/users/{user_id_or_email}/presence:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/{user_id}:get)}
{generate_api_description(/users/{user_id}:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{user_id}:get|example}
{generate_code_example(javascript)|/users/{user_id}:get|example}
{tab|curl}
{generate_code_example(curl)|/users/{user_id}:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:get}
{generate_parameter_description(/users/{user_id}:get)}
## Response
{generate_return_values_table|zulip.yaml}|/users/{user_id}:get}
{generate_response_description(/users/{user_id}:get)}
#### Example response
{generate_code_example|/users/{user_id}:get|fixture(200)}
{generate_code_example|/users/{user_id}:get|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users:get)}
{generate_api_description(/users:get)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users:get|example}
{generate_code_example(javascript)|/users:get|example}
{tab|curl}
{generate_code_example(curl)|/users:get|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users:get}
{generate_parameter_description(/users:get)}
## Response
{generate_return_values_table|zulip.yaml|/users:get}
{generate_response_description(/users:get)}
#### Example response
{generate_code_example|/users:get|fixture(200)}
{generate_code_example|/users:get|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/me/subscriptions/muted_topics:patch)}
{generate_api_description(/users/me/subscriptions/muted_topics:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/subscriptions/muted_topics:patch|example}
{generate_code_example(javascript)|/users/me/subscriptions/muted_topics:patch|example}
{tab|curl}
{generate_code_example(curl)|/users/me/subscriptions/muted_topics:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions/muted_topics:patch}
{generate_parameter_description(/users/me/subscriptions/muted_topics:patch)}
## Response
{generate_response_description(/users/me/subscriptions/muted_topics:patch)}
#### Example response
{generate_code_example|/users/me/subscriptions/muted_topics:patch|fixture(200)}
{generate_code_example|/users/me/subscriptions/muted_topics:patch|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/me/muted_users/{muted_user_id}:post)}
{generate_api_description(/users/me/muted_users/{muted_user_id}:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/muted_users/{muted_user_id}:post|example}
{generate_code_example(javascript)|/users/me/muted_users/{muted_user_id}:post|example}
{tab|curl}
{generate_code_example(curl)|/users/me/muted_users/{muted_user_id}:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/muted_users/{muted_user_id}:post}
{generate_parameter_description(/users/me/muted_users/{muted_user_id}:post)}
## Response
{generate_response_description(/users/me/muted_users/{muted_user_id}:post)}
#### Example response
{generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(200)}
{generate_code_example|/users/me/muted_users/{muted_user_id}:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/{user_id}/reactivate:post)}
{generate_api_description(/users/{user_id}/reactivate:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{user_id}/reactivate:post|example}
{generate_code_example(javascript)|/users/{user_id}/reactivate:post|example}
{tab|curl}
{generate_code_example(curl)|/users/{user_id}/reactivate:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{user_id}/reactivate:post}
{generate_parameter_description(/users/{user_id}/reactivate:post)}
## Response
{generate_response_description(/users/{user_id}/reactivate:post)}
#### Example response
{generate_code_example|/users/{user_id}/reactivate:post|fixture(200)}
{generate_code_example|/users/{user_id}/reactivate:post|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/register:post)}
{generate_api_description(/register:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/register:post|example}
{generate_code_example(javascript)|/register:post|example}
{tab|curl}
{generate_code_example(curl)|/register:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/register:post}
{generate_parameter_description(/register:post)}
## Response
{generate_return_values_table|zulip.yaml|/register:post}
{generate_response_description(/register:post)}
#### Example response
{generate_code_example|/register:post|fixture(200)}
{generate_code_example|/register:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/realm/playgrounds/{playground_id}:delete)}
{generate_api_description(/realm/playgrounds/{playground_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/playgrounds/{playground_id}:delete|example}
{generate_code_example(javascript)|/realm/playgrounds/{playground_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/realm/playgrounds/{playground_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/playgrounds/{playground_id}:delete}
{generate_parameter_description(/realm/playgrounds/{playground_id}:delete)}
## Response
{generate_response_description(/realm/playgrounds/{playground_id}:delete)}
#### Example response
{generate_code_example|/realm/playgrounds/{playground_id}:delete|fixture(200)}
{generate_code_example|/realm/playgrounds/{playground_id}:delete|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/realm/filters/{filter_id}:delete)}
{generate_api_description(/realm/filters/{filter_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/filters/{filter_id}:delete|example}
{generate_code_example(javascript)|/realm/filters/{filter_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/realm/filters/{filter_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/filters/{filter_id}:delete}
{generate_parameter_description(/realm/filters/{filter_id}:delete)}
## Response
{generate_response_description(/realm/filters/{filter_id}:delete)}
#### Example response
{generate_code_example|/realm/filters/{filter_id}:delete|fixture(200)}
{generate_code_example|/realm/filters/{filter_id}:delete|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages/{message_id}/reactions:delete)}
{generate_api_description(/messages/{message_id}/reactions:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/{message_id}/reactions:delete|example}
{generate_code_example(javascript)|/messages/{message_id}/reactions:delete|example}
{tab|curl}
{generate_code_example(curl)|/messages/{message_id}/reactions:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}/reactions:delete}
{generate_parameter_description(/messages/{message_id}/reactions:delete)}
## Response
{generate_response_description(/messages/{message_id}/reactions:delete)}
#### Example response
{generate_code_example|/messages/{message_id}/reactions:delete|fixture(200)}
{generate_code_example|/messages/{message_id}/reactions:delete|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/user_groups/{user_group_id}:delete)}
{generate_api_description(/user_groups/{user_group_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/user_groups/{user_group_id}:delete|example}
{generate_code_example(javascript)|/user_groups/{user_group_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/user_groups/{user_group_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}:delete}
{generate_parameter_description(/user_groups/{user_group_id}:delete)}
## Response
{generate_response_description(/user_groups/{user_group_id}:delete)}
#### Example response
{generate_code_example|/user_groups/{user_group_id}:delete|fixture(200)}
{generate_code_example|/user_groups/{user_group_id}:delete|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages/render:post)}
{generate_api_description(/messages/render:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/render:post|example}
{generate_code_example(javascript)|/messages/render:post|example}
{tab|curl}
{generate_code_example(curl)|/messages/render:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/render:post}
{generate_parameter_description(/messages/render:post)}
## Response
{generate_return_values_table|zulip.yaml|/messages/render:post}
{generate_response_description(/messages/render:post)}
#### Example response
{generate_code_example|/messages/render:post|fixture(200)}
{generate_code_example|/messages/render:post|fixture(400)}

View File

@ -1,36 +0,0 @@
{generate_api_title(/realm/profile_fields:patch)}
{generate_api_description(/realm/profile_fields:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/profile_fields:patch|example}
{generate_code_example(javascript)|/realm/profile_fields:patch|example}
{tab|curl}
{generate_code_example(curl)|/realm/profile_fields:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/profile_fields:patch}
{generate_parameter_description(/realm/profile_fields:patch)}
## Response
{generate_return_values_table|zulip.yaml|/realm/profile_fields:patch}
{generate_response_description(/realm/profile_fields:patch)}
#### Example response
{generate_code_example|/realm/profile_fields:patch|fixture(200)}
{generate_code_example|/realm/profile_fields:patch|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/typing:post)}
{generate_api_description(/typing:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/typing:post|example}
{generate_code_example(javascript)|/typing:post|example}
{tab|curl}
{generate_code_example(curl)|/typing:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/typing:post}
{generate_parameter_description(/typing:post)}
## Response
{generate_response_description(/typing:post)}
#### Example response
{generate_code_example|/typing:post|fixture(200)}
{generate_code_example|/typing:post|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/me/subscriptions:post)}
{generate_api_description(/users/me/subscriptions:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/subscriptions:post|example}
{generate_code_example(javascript)|/users/me/subscriptions:post|example}
{tab|curl}
{generate_code_example(curl)|/users/me/subscriptions:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:post}
{generate_parameter_description(/users/me/subscriptions:post)}
## Response
{generate_return_values_table|zulip.yaml|/users/me/subscriptions:post}
{generate_response_description(/users/me/subscriptions:post)}
#### Example response
{generate_code_example|/users/me/subscriptions:post|fixture(200)}
{generate_code_example|/users/me/subscriptions:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/me/muted_users/{muted_user_id}:delete)}
{generate_api_description(/users/me/muted_users/{muted_user_id}:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/muted_users/{muted_user_id}:delete|example}
{generate_code_example(javascript)|/users/me/muted_users/{muted_user_id}:delete|example}
{tab|curl}
{generate_code_example(curl)|/users/me/muted_users/{muted_user_id}:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/muted_users/{muted_user_id}:delete}
{generate_parameter_description(/users/me/muted_users/{muted_user_id}:delete)}
## Response
{generate_response_description(/users/me/muted_users/{muted_user_id}:delete)}
#### Example response
{generate_code_example|/users/me/muted_users/{muted_user_id}:delete|fixture(200)}
{generate_code_example|/users/me/muted_users/{muted_user_id}:delete|fixture(400)}

View File

@ -1,31 +0,0 @@
{generate_api_title(/users/me/subscriptions:delete)}
{generate_api_description(/users/me/subscriptions:delete)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/subscriptions:delete|example}
{generate_code_example(javascript)|/users/me/subscriptions:delete|example}
{tab|curl}
{generate_code_example(curl)|/users/me/subscriptions:delete|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions:delete}
{generate_return_values_table|zulip.yaml|/users/me/subscriptions:delete}
{generate_response_description(/users/me/subscriptions:delete)}
#### Example response
{generate_code_example|/users/me/subscriptions:delete|fixture(200)}
{generate_code_example|/users/me/subscriptions:delete|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/settings/display:patch)}
{generate_api_description(/settings/display:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/settings/display:patch|example}
{generate_code_example(javascript)|/settings/display:patch|example}
{tab|curl}
{generate_code_example(curl)|/settings/display:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/settings/display:patch}
{generate_parameter_description(/settings/display:patch)}
## Response
{generate_response_description(/settings/display:patch)}
#### Example response
{generate_code_example|/settings/display:patch|fixture(200)}
{generate_code_example|/settings/display:patch|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/realm/filters/{filter_id}:patch)}
{generate_api_description(/realm/filters/{filter_id}:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/filters/{filter_id}:patch|example}
{generate_code_example(javascript)|/realm/filters/{filter_id}:patch|example}
{tab|curl}
{generate_code_example(curl)|/realm/filters/{filter_id}:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/filters/{filter_id}:patch}
{generate_parameter_description(/realm/filters/{filter_id}:patch)}
## Response
{generate_return_values_table|zulip.yaml|/realm/filters/{filter_id}:patch}
{generate_response_description(/realm/filters/{filter_id}:patch)}
#### Example response
{generate_code_example|/realm/filters/{filter_id}:patch|fixture(200)}
{generate_code_example|/realm/filters/{filter_id}:patch|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/messages/flags:post)}
{generate_api_description(/messages/flags:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/flags:post|example}
{generate_code_example(javascript)|/messages/flags:post|example}
{tab|curl}
{generate_code_example(curl)|/messages/flags:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/flags:post}
{generate_parameter_description(/messages/flags:post)}
## Response
{generate_return_values_table|zulip.yaml|/messages/flags:post}
{generate_response_description(/messages/flags:post)}
#### Example response
{generate_code_example|/messages/flags:post|fixture(200)}
{generate_code_example|/messages/flags:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/messages/{message_id}:patch)}
{generate_api_description(/messages/{message_id}:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/messages/{message_id}:patch|example}
{generate_code_example(javascript)|/messages/{message_id}:patch|example}
{tab|curl}
{generate_code_example(curl)|/messages/{message_id}:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/messages/{message_id}:patch}
{generate_parameter_description(/messages/{message_id}:patch)}
## Response
{generate_response_description(/messages/{message_id}:patch)}
#### Example response
{generate_code_example|/messages/{message_id}:patch|fixture(200)}
{generate_code_example|/messages/{message_id}:patch|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/settings/notifications:patch)}
{generate_api_description(/settings/notifications:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/settings/notifications:patch|example}
{generate_code_example(javascript)|/settings/notifications:patch|example}
{tab|curl}
{generate_code_example(curl)|/settings/notifications:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/settings/notifications:patch}
{generate_parameter_description(/settings/notifications:patch)}
## Response
{generate_response_description(/settings/notifications:patch)}
#### Example response
{generate_code_example|/settings/notifications:patch|fixture(200)}
{generate_code_example|/settings/notifications:patch|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/streams/{stream_id}:patch)}
{generate_api_description(/streams/{stream_id}:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/streams/{stream_id}:patch|example}
{generate_code_example(javascript)|/streams/{stream_id}:patch|example}
{tab|curl}
{generate_code_example(curl)|/streams/{stream_id}:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/streams/{stream_id}:patch}
{generate_parameter_description(/streams/{stream_id}:patch)}
## Response
{generate_response_description(/streams/{stream_id}:patch)}
#### Example response
{generate_code_example|/streams/{stream_id}:patch|fixture(200)}
{generate_code_example|/streams/{stream_id}:patch|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/users/me/subscriptions/properties:post)}
{generate_api_description(/users/me/subscriptions/properties:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/me/subscriptions/properties:post|example}
{generate_code_example(javascript)|/users/me/subscriptions/properties:post|example}
{tab|curl}
{generate_code_example(curl)|/users/me/subscriptions/properties:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/me/subscriptions/properties:post}
{generate_parameter_description(/users/me/subscriptions/properties:post)}
## Response
{generate_return_values_table|zulip.yaml|/users/me/subscriptions/properties:post}
{generate_response_description(/users/me/subscriptions/properties:post)}
#### Example response
{generate_code_example|/users/me/subscriptions/properties:post|fixture(200)}
{generate_code_example|/users/me/subscriptions/properties:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/user_groups/{user_group_id}/members:post)}
{generate_api_description(/user_groups/{user_group_id}/members:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/user_groups/{user_group_id}/members:post|example}
{generate_code_example(javascript)|/user_groups/{user_group_id}/members:post|example}
{tab|curl}
{generate_code_example(curl)|/user_groups/{user_group_id}/members:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}/members:post}
{generate_parameter_description(/user_groups/{user_group_id}/members:post)}
## Response
{generate_response_description(/user_groups/{user_group_id}/members:post)}
#### Example response
{generate_code_example|/user_groups/{user_group_id}/members:post|fixture(200)}
{generate_code_example|/user_groups/{user_group_id}/members:post|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/user_groups/{user_group_id}:patch)}
{generate_api_description(/user_groups/{user_group_id}:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/user_groups/{user_group_id}:patch|example}
{generate_code_example(javascript)|/user_groups/{user_group_id}:patch|example}
{tab|curl}
{generate_code_example(curl)|/user_groups/{user_group_id}:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/user_groups/{user_group_id}:patch}
{generate_parameter_description(/user_groups/{user_group_id}:patch)}
## Response
{generate_response_description(/user_groups/{user_group_id}:patch)}
#### Example response
{generate_code_example|/user_groups/{user_group_id}:patch|fixture(200)}
{generate_code_example|/user_groups/{user_group_id}:patch|fixture(400)}

View File

@ -1,33 +0,0 @@
{generate_api_title(/users/{user_id}:patch)}
{generate_api_description(/users/{user_id}:patch)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/users/{user_id}:patch|example}
{generate_code_example(javascript)|/users/{user_id}:patch|example}
{tab|curl}
{generate_code_example(curl)|/users/{user_id}:patch|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/users/{user_id}:patch}
{generate_parameter_description(/users/{user_id}:patch)}
## Response
{generate_response_description(/users/{user_id}:patch)}
#### Example response
{generate_code_example|/users/{user_id}:patch|fixture(200)}
{generate_code_example|/users/{user_id}:patch|fixture(400)}

View File

@ -1,35 +0,0 @@
{generate_api_title(/realm/emoji/{emoji_name}:post)}
{generate_api_description(/realm/emoji/{emoji_name}:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/realm/emoji/{emoji_name}:post|example}
{generate_code_example(javascript)|/realm/emoji/{emoji_name}:post|example}
{tab|curl}
{generate_code_example(curl)|/realm/emoji/{emoji_name}:post|example}
{end_tabs}
## Parameters
{generate_api_arguments_table|zulip.yaml|/realm/emoji/{emoji_name}:post}
{generate_parameter_description(/realm/emoji/{emoji_name}:post)}
## Response
{generate_response_description(/realm/emoji/{emoji_name}:post)}
#### Example response
{generate_code_example|/realm/emoji/{emoji_name}:post|fixture(200)}
{generate_code_example|/realm/emoji/{emoji_name}:post|fixture(400)}

View File

@ -1,34 +0,0 @@
{generate_api_title(/user_uploads:post)}
{generate_api_description(/user_uploads:post)}
## Usage examples
{start_tabs}
{generate_code_example(python)|/user_uploads:post|example}
{generate_code_example(javascript)|/user_uploads:post|example}
{tab|curl}
{generate_code_example(curl)|/user_uploads:post|example}
{end_tabs}
## Parameters
{generate_parameter_description(/user_uploads:post)}
## Response
{generate_return_values_table|zulip.yaml|/user_uploads:post}
{generate_response_description(/user_uploads:post)}
#### Example response
{generate_code_example|/user_uploads:post|fixture(200)}
{generate_code_example|/user_uploads:post|fixture(400)}

View File

@ -150,7 +150,6 @@ def render_markdown_path(
md_engine.reset()
jinja = engines["Jinja2"]
try:
# By default, we do both Jinja2 templating and Markdown
# processing on the file, to make it easy to use both Jinja2
@ -169,6 +168,8 @@ def render_markdown_path(
else:
raise e
API_ENDPOINT_NAME = context.get("API_ENDPOINT_NAME", "")
markdown_string = markdown_string.replace("API_ENDPOINT_NAME", API_ENDPOINT_NAME)
html = md_engine.convert(markdown_string)
rendered_html = jinja.from_string(html).render(context)

View File

@ -84,13 +84,32 @@ class MarkdownDirectoryView(ApiURLView):
http_status = 404
path = self.path_template % (article,)
endpoint_name = None
endpoint_method = None
# The following is a somewhat hacky approach to extract titles from articles.
# Hack: `context["article"] has a leading `/`, so we use + to add directories.
article_path = os.path.join(settings.DEPLOY_ROOT, "templates") + path
if (not os.path.exists(article_path)) and self.path_template == "/zerver/api/%s.md":
endpoint_path = article.replace("-", "_")
try:
endpoint_name, endpoint_method = get_endpoint_from_operationid(endpoint_path)
path = "/zerver/api/api-doc-template.md"
except AssertionError:
return DocumentationArticle(
article_path=self.path_template % ("missing",),
article_http_status=404,
endpoint_path=None,
endpoint_method=None,
)
try:
loader.get_template(path)
return DocumentationArticle(
article_path=path,
article_http_status=http_status,
endpoint_path=None,
endpoint_method=None,
endpoint_path=endpoint_name,
endpoint_method=endpoint_method,
)
except loader.TemplateDoesNotExist:
return DocumentationArticle(
@ -129,12 +148,19 @@ class MarkdownDirectoryView(ApiURLView):
with open(article_path) as article_file:
first_line = article_file.readlines()[0]
# Strip the header and then use the first line to get the article title
if self.path_template == "/zerver/api/%s.md" and "{generate_api_title(" in first_line:
if context["article"] == "/zerver/api/api-doc-template.md":
endpoint_name, endpoint_method = (
documentation_article.endpoint_path,
documentation_article.endpoint_method,
)
article_title = get_openapi_summary(endpoint_name, endpoint_method)
elif self.path_template == "/zerver/api/%s.md" and "{generate_api_title(" in first_line:
api_operation = context["OPEN_GRAPH_URL"].split("/api/")[1].replace("-", "_")
endpoint_path, endpoint_method = get_endpoint_from_operationid(api_operation)
article_title = get_openapi_summary(endpoint_path, endpoint_method)
endpoint_name, endpoint_method = get_endpoint_from_operationid(api_operation)
article_title = get_openapi_summary(endpoint_name, endpoint_method)
else:
article_title = first_line.lstrip("#").strip()
endpoint_name = endpoint_method = None
if context["not_index_page"]:
context["OPEN_GRAPH_TITLE"] = f"{article_title} ({title_base})"
else:
@ -150,6 +176,8 @@ class MarkdownDirectoryView(ApiURLView):
add_api_uri_context(api_uri_context, self.request)
api_uri_context["run_content_validators"] = True
context["api_uri_context"] = api_uri_context
if endpoint_name and endpoint_method:
context["api_uri_context"]["API_ENDPOINT_NAME"] = endpoint_name + ":" + endpoint_method
add_google_analytics_context(context)
return context