Commit Graph

550 Commits

Author SHA1 Message Date
Robert Hönig bdf79f271d Implement and document new Botserver setup routine.
Previously, the Botserver determined which bot to run for an
outgoing webhook by dispatching on a different URL endpoint
for each bot. Now, instead, the Botserver determines which bot
to run by the section header of the bot in the flaskbotrc.
This commit makes the frontend provide the new flaskbotrc
and updates the setup steps for the Botserver in the docs.
2018-05-25 10:33:40 -07:00
vaibhav cc0d0b55f1 docs: Add documentation for outgoing webhooks.
Rewritten by some combination of @rheaparekh and @timabbott to more
clearly discuss what's actually important to users.
2018-05-25 10:30:53 -07:00
Eeshan Garg 3ed20589f2 webhooks: Add generic exception for unexpected webhook events.
UnexpectedWebhookEventType is a generic exception that we may
now raise when we encounter a webhook event that is new or one
that we simply aren't aware of.
2018-05-22 08:30:19 -07:00
Tim Abbott 9de80990ea api: Update links for new /deploying-bots page.
Also caught by test-help-documentation.
2018-05-18 16:31:52 -07:00
Tim Abbott 847fc69c79 api: Fix a badly line-wrapped link.
Caught by test-help-documentation.
2018-05-18 16:31:36 -07:00
Tim Abbott dd7507c88a docs: Add a page on deploying bots in production. 2018-05-18 16:13:17 -07:00
Yago González f0fa550001 docs: Rename rest_endpoints with dashes. 2018-05-15 09:06:56 -07:00
Eeshan Garg 3a68f998a7 integration-docs-guide: Add a more detailed writing style guide.
Most of the recommendations in this guide were written by Rishi
Gupta (rishig), with a few contributions from Eeshan Garg.
2018-05-15 10:06:08 -04:00
Eeshan Garg fa28ccb952 integration-docs-guide: Trim text documenting Markdown macros.
We were devoting too much space/text to documenting our Markdown
macro. It is much more concise to just have a description and a
link to an example doc for each major macro.
2018-05-14 20:14:08 -02:30
Tim Abbott 1f837340d1 api: Fix confusing documentation about services for botserver.
This fixes several super-confusing things in these docs.  Bot services
aren't a user-facing concept, and also, you need the URL before
creating the bot users.
2018-05-14 09:21:45 -07:00
Tim Abbott 485d5b6335 api: Fix incorrectly coded bullet for zulip_botserver config. 2018-05-14 09:21:45 -07:00
Joshua Pan e591668d60 bot-docs: Rewrite last section of "Running bots". 2018-05-14 04:27:36 -07:00
Joshua Pan 3952f94157 minor: Add missing period to bot-docs. 2018-05-14 04:27:36 -07:00
Joshua Pan 128aa8b7ee bot-docs: Remove hint on "Running bots" doc.
We already explain testing bot output in
"Writing bots" doc, and the placement of
the hint itself doesn't make sense.
2018-05-14 04:27:36 -07:00
Joshua Pan 0b112cf5e9 bot-docs: Streamline introduction to 'Running a bot'. 2018-05-14 04:27:36 -07:00
Joshua Pan 2b06e1cec7 bot-docs: Renumber list to use all 1's. 2018-05-14 04:27:36 -07:00
Aditya Bansal a00f3b5843 docs: Update for change from typing.Text to str. 2018-05-14 05:23:36 +05:30
Yago González 610f48dcbc docs: Explain how to configure the Python bindings.
The Python bindings (which are used for bots, amongst other things) can
be configured either with a .zuliprc file or with environment variables
in the host machine.

This new page in the user docs explains how to set the bindings up using
both techniques, and is a good reference on the setup required by Zulip
bots.
2018-05-13 15:09:23 -07:00
Yago González c6eee1c9da docs: Rename rest_error_handling with dashes. 2018-05-13 15:02:48 -07:00
Yago González 7ae51a4ec6 docs: Update API key-related screenshots. 2018-05-13 15:02:48 -07:00
Eeshan Garg 34d1b0ebf1 webhooks: Add helper to extract and validate HTTP event headers.
This is a part of our efforts to close #6213.
2018-05-05 15:48:37 -07:00
Eeshan Garg 7e379bbb76 writing-bots: Recommend using Python 3 to run tools/provision. 2018-05-03 10:11:49 -07:00
Tim Abbott 6cca334271 api: Document the /register API with a lot more detail. 2018-04-27 17:01:41 -07:00
Tim Abbott 9fc1458924 api: Improve documentation for real-time-events API. 2018-04-27 16:36:54 -07:00
Tim Abbott be3804f505 api: Fix incorrectly documented event types.
It's actually "subscription" and "message" (neither is plural).

While we're at it, we should also remove the "pointer" event type,
since that's of generally low interest.
2018-04-27 15:16:24 -07:00
Eeshan Garg 7d14ce2cb6 pypi packaging: Upgrade to release 0.4.6.
As a part of the upgrade, we had to update our API tests in
zerver/lib/api_test_helpers.
2018-04-27 14:50:25 -07:00
Preston Hansen e168f9938c tests: Refactor use of test and webhook data fixtures. 2018-04-19 21:50:29 -07:00
Preston Hansen 76d6c71595 tests: Move zerver/fixtures to zerver/tests/fixtures for clarity.
Fixes #9153.
2018-04-19 21:50:17 -07:00
Tim Abbott c224114287 /api: Clean up the API documentation homepage. 2018-04-16 15:54:39 -07:00
Tim Abbott d09071bbc9 /api: Add an overview doc for the REST API. 2018-04-16 15:51:13 -07:00
Tim Abbott 89704df167 /api: Move list of REST endpoints to a template. 2018-04-16 15:50:53 -07:00
Tim Abbott ea266f1b80 /api: Expand "common errors" page to more generally cover error handling. 2018-04-16 15:50:52 -07:00
Tim Abbott 57ca19392e help: Make API context available to sidebars.
I am not a fan of this API (where we need to pass context into
`render_markdown_path` directly), but it seems more robust to pass
this in directly.
2018-04-05 12:22:41 -07:00
Eeshan Garg 538746fc65 webhooks: Stop raising an exception if stream does not exist.
webhook-errors.log file is cluttered with Stream.DoesNotExist
errors, which hides the errors that we actually need to see. So,
since check_message already sends the bot_owner a PM if the webhook
bot tries to send a message to a non-existent stream, we can ignore
such exceptions.
2018-03-24 13:50:17 -07:00
Eeshan Garg af56df7723 webhooks: Enable custom topics and default PM notifications.
This commit adds a generic function called check_send_webhook_message
that does the following:
* If a stream is specified in the webhook URL, it sends a stream
  message, otherwise sends a PM to the owner of the bot.
* In the case of a stream message, if a custom topic is specified
  in the webhook URL, it uses that topic as the subject of the
  stream message.

Also, note that we need not test this anywhere except for the
helloworld webhook. Since helloworld is our default example for
webhooks, it is here to stay and it made sense that tests for a
generic function such as check_send_webhook_message be tested
with an actual generic webhook!

Fixes #8607.
2018-03-16 11:34:20 -07:00
Eeshan Garg 50a66725a1 json: Ensure consistent formatting in api/fixtures.json.
Now, the fixtures.json file:
* Has all keys sorted alphabetically.
* Has a space after every `:`.

The file was generated using json.dumps with the appropriate
formatting parameters.
2018-03-02 14:10:53 -08:00
Eeshan Garg 393b9eec99 api_docs: Move get-events-from-queue fixture to fixtures.json.
Note that this is one of the few fixtures that isn't tested against
a running server. But it still makes sense to move it to fixtures.json so
that it is rendered with indenting and a space after every `:` by
the api_code_example extension.
2018-03-02 14:10:53 -08:00
Eeshan Garg ea7ce7e0da api docs: Ensure consistent formatting for arguments.json.
Ideally, there should be a space after every `:`.

Note that the JSON isn't displayed as is but is formatted as an
HTML table.
2018-03-02 09:44:17 -08:00
Eeshan Garg ce56ee80e7 api_docs: Document the `POST /api/v1/user_uploads` endpoint.
Fixes #1353.
2018-03-02 09:44:17 -08:00
Tim Abbott fd4aa88046 api: Do paragraphs within bullets with better indentation.
This is necessary to ensure the "Hint" appears indented as part of the
bullet.
2018-03-01 08:21:53 -08:00
Viraat Chandra 9284d32837 docs: Improve consistency and quality of API Documentation. 2018-03-01 08:21:53 -08:00
Eeshan Garg e80609a3e9 api docs: Test sample fixture for invalid stream name error.
This commit adds a test for the sample fixture for when an invalid
stream name is passed to a query that expects a valid stream name
as an argument. This is the case with almost all of our queries
documented under the sidebar heading "Streams".

EDIT: Actually, I was wrong. This payload is highly specific to
get-stream-id, so it shouldn't be a part of common-error-payloads
at all.
2018-02-20 20:03:55 -03:30
Eeshan Garg 9add5bf6a7 api/delete-queue: Test fixture for BAD_EVENT_QUEUE_ID error.
In templates/zerver/api/delete-queue.md, we have a sample fixture
for when the queue_id passed to client.deregister_queue is not
valid or the event queue in question has already been deleted.
This commit tests that fixture.

Note that this error payload is specific to client.deregister_queue.
2018-02-20 14:54:12 -08:00
Eeshan Garg a0818975fb api/create-user: Test fixture for "email already in use" error.
In templates/zerver/api/create-user.md, we have a sample fixture
for when a client attempts to create a user with the same email
as an existing user. This commit adds a test for that fixture.

Note that this error payload is specific to client.create_user
and this error payload isn't generated anywhere else.
2018-02-20 14:54:12 -08:00
Eeshan Garg be0a04f33e api docs: Test sample fixtures for unauthorized_errors_fatal.
This commit adds tests for the sample fixtures for when
unauthorized_errors_fatal is passed to client.add_subscriptions.
2018-02-20 14:54:12 -08:00
Eeshan Garg 806476173f api/add-subscriptions: Test fixture for "already_subscribed".
In templates/zerver/api/add-subscriptions, we have a sample fixture
for when the user being subscribed is already subscribed to a
stream. This commit tests that fixture against a running server.
2018-02-20 14:54:12 -08:00
Eeshan Garg 06bf47d2f5 api docs: Test sample fixture for user not authorized error.
This commit adds tests for the fixture for when a user is not
authorized (perhaps because the query requires the use of admin
privileges) for a particular query.
2018-02-20 14:52:09 -08:00
Eeshan Garg 124c672a7c api docs: Test sample fixture for message edit permission error.
In templates/zerver/api/update-message.md, we have a sample fixture
for when a zulip.Client does not have the permission to update/edit
a particular message. This commit adds a test for that fixture.
Also, tools/test-api now also uses a non-admin client for this test,
which might come in handy in the future.
2018-02-20 14:52:09 -08:00
Eeshan Garg 1c32163bb9 api docs: Test sample fixture for missing request args error.
This commit adds tests for the sample fixture for when a required
request argument is missing. Also, it moves the sample fixture
to common-error-payloads.md, since this is an error payload that
is common to most requests (except the ones that don't take any
arguments).
2018-02-20 14:52:09 -08:00
Eeshan Garg d1a5bbc2a5 api docs: Test sample fixture for invalid PM recipient error.
In templates/zerver/api/private-message.md, we have a sample fixture
for when the email address of the PM's recipient is invalid. This
commit makes sure that fixture is tested against a running server.
2018-02-20 14:52:09 -08:00
Eeshan Garg 93b44a41c5 api docs: Test sample fixture for nonexistent stream error.
In templates/zerver/api/stream-message.md, we have a sample fixture
for when the target stream does not exist. This commit adds a test
for that sample fixture.
2018-02-20 14:52:09 -08:00
Eeshan Garg 6206647641 bugdown/api_code_examples: Add support for multiple languages.
This commit modifies the Markdown extension in bugdown/api_code_examples.py
to support rendering code examples in multiple languages by specifying
the language like so:

{generate_code_example(python)|doc.md|example}

This makes us one step closer towards adding support for testable
JavaScript code examples.
2018-02-16 10:07:13 -08:00
Eeshan Garg ac5c355a60 api/delete-queue: Make fixtures/examples testable.
api/delete-queue now uses the Markdown extension in
bugdown/api_code_examples to generate code examples and fixtures
from tests.
2018-02-08 17:58:41 -08:00
Eeshan Garg 344cf2c8ee api_tests: Add tests for client.register_queue. 2018-02-08 17:58:41 -08:00
Eeshan Garg 66ca0c725f api/get-all-users: Make fixtures/examples testable.
api/get-all-users now uses the Markdown extension in
bugdown/api_code_examples to generate code examples and fixtures
from tests.
2018-02-08 17:58:41 -08:00
Eeshan Garg 929724e5e7 api docs: Add page for common error payloads.
We now have a separate page for common error payloads, for example,
the payload for when the client's API key is invalid. All error
payloads that are presented on this page will be tested similarly
to our other non-error sample fixtures.
2018-02-08 17:58:41 -08:00
Robert Hönig 537203102a api tests: Update remove-subscriptions fixture.
The remove-subscriptions API client response
changed with python-zulip-api:67cdb6f
2018-02-08 09:37:41 -08:00
Eeshan Garg 61e4fc3b74 api/remove-subscriptions: Make fixtures/examples testable.
api/remove-subscriptions now uses the Markdown extension in
bugdown/api_code_examples to generate code example and fixtures
from tests.
2018-02-07 15:58:57 -08:00
Eeshan Garg f4cb5e70ed api/add-subscriptions: Make fixtures/examples testable.
api/add-subscriptions now uses the Markdown extension in
bugdown/api_code_examples to generate code example and fixtures
from tests.
2018-02-07 15:58:57 -08:00
Eeshan Garg ffe930d50d bugdown/api_generate_examples: Replace 'method' with 'example'.
To generate a code exammple,

{generate_code_example|<api_doc_md>|example} sounds better and
more intuitive than,

{generate_code_example|<api_doc_md>|method}
2018-02-07 15:58:57 -08:00
rht 4e0fc593cf docs: Remove u prefix from strings. 2018-02-05 12:11:33 -08:00
Robert Hönig 12e7e2557e writing-bots.md: Add fixture JSON skeleton. 2018-02-05 10:19:32 -08:00
Robert Hönig 7d977dd059 writing-bots.md: Remove obsolete bot_handler.storage disclaimer.
Permanent storage is now supported for external bots.
2018-02-05 10:19:32 -08:00
Eeshan Garg 162f34f0d0 api/get-profile: Make code examples/fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the
example fixture and code example, so that both are tested
in zerver/lib/api_test_helpers.
2018-01-31 07:30:54 -05:00
Eeshan Garg 2bea4b70de api/create-user: Make code examples/fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the
example fixture and code example, so that both are tested
in zerver/lib/api_test_helpers.
2018-01-31 07:30:54 -05:00
Eeshan Garg 73a3755120 api/get-all-streams: Make code examples/fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the
example fixture and code example, so that both are tested
in zerver/lib/api_test_helpers.
2018-01-31 07:30:54 -05:00
Eeshan Garg dcf3a9cd18 api/get-subscribed-streams: Make code examples/fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the
example fixture and code example, so that both are tested
in tools/lib/api_tests.
2018-01-31 07:30:54 -05:00
Eeshan Garg 6c634d6847 api/get-stream-id: Make code examples and fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the
example fixture and code example, so that both are tested
in tools/lib/api_tests.
2018-01-31 07:30:54 -05:00
Eeshan Garg b1878f14a2 api/update-message: Make code examples and fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the
example fixture and code example, so that both are tested in
tools/lib/api_tests.
2018-01-31 07:30:54 -05:00
Eeshan Garg cf80587f47 api/private-message: Make code examples and fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the example
fixture and code example, so that both are tested in
tools/lib/api_tests.
2018-01-31 07:30:54 -05:00
Eeshan Garg f58ecee2d8 api/stream-message: Make code examples and fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_examples to generate the example
fixture and code example, so that both are tested in
tools/lib/api_tests.
2018-01-31 07:30:54 -05:00
Eeshan Garg a1a69a0ac2 api/render-message: Make code examples and fixtures testable.
This commit uses the Markdown extension defined in
zerver/lib/bugdown/api_generate_example to generate the example
fixture and code example, so that both are tested in
tools/lib/api_tests.
2018-01-31 07:30:54 -05:00
Eeshan Garg 3189388258 api docs: Show Python and JavaScript examples first.
It makes sense to make our Python and JS API examples more visible
than our curl examples, since Python is what most people will tend
to use.

Also, from a design perspective, an API documentation page that
starts off with a shiny Python example with syntax highlighting
looked much better than having a bland curl example be the first
thing readers see.
2018-01-22 18:10:29 -05:00
Eeshan Garg 96362e8e60 api docs: Move code examples farther up. 2018-01-22 18:10:29 -05:00
Eeshan Garg 668ac28b85 api/sidebar.md: Move "REST API" to the bottom. 2018-01-22 18:10:29 -05:00
Balaji2198 41685105db api/update-message: Make it render correctly in Github. 2018-01-22 15:35:49 -05:00
Balaji2198 992b416802 api/delete-queue: Add Python syntax highlighting. 2018-01-22 15:35:49 -05:00
Steve Howell a5e55cee9b bot docs: Clean up "Testing a bot's output".
The main cleanup here is to move the examples out of the bulleted
list, which was getting rendered in an ugly/confusing way.

I also removed some redundant text, fixed some typos, and changed
the wording a bit.
2018-01-18 16:09:24 -05:00
Eeshan Garg a0526206f9 api/delete-queue: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg af1290fde7 api/get-events-from-queue: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg 8ed0a0950e api/register-queue: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg df00e6a45f api/create-user: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg 0e778e152d api/get-profile: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg dd88cfac16 api/get-all-users: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg e18b9ae1c1 api/remove-subscriptions: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg 6d92c88997 api/add-subscriptions: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg 4d8c20b773 api/get-subscribed-streams: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg b32bb7d5f4 api/get-stream-id: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg 370d2c6bab api/get-all-streams: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg e781a57ca2 api/private-message: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg e36d61f216 api/update-message: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Eeshan Garg ba98451928 api/stream-message: Recommend using zuliprc.
Recommend using a zuliprc file instead of hardcoding the API
credentials in a config object.
2018-01-17 09:27:35 -05:00
Eeshan Garg 360885fb12 api/render-message: Add JavaScript example. 2018-01-17 09:27:35 -05:00
Robert Hönig 93f47fa700 outgoing webhooks: Rename "Base URL" to "Endpoint URL".
Based on user feedback. "Endpoint URL" gives a clearer
idea of the field's purpose.
2018-01-16 08:11:51 -05:00
Eeshan Garg a14b52ef1d api docs: Document the `DELETE /users/me/subscriptions` endpoint.
Note that there is currently no JavaScript method in zulip-js
to call this endpoint.
2018-01-12 07:30:38 -05:00
Eeshan Garg 1b3b907694 delete-queue.md: Specify queue_id as a required argument.
Specifying it as an optional one was a mistake.
2018-01-12 07:30:38 -05:00
Eeshan Garg 8c723e8c27 api docs: Document the POST /api/v1/users endpoint.
Note that there is no JavaScript equivalent for requesting this
endpoint in zulip-js yet.
2018-01-12 07:30:38 -05:00
Eeshan Garg a01f8c088a api docs: Document the POST /api/v1/users/me/subscriptions endpoint.
There is a JavaScript equivalent for this endpoint but the npm
package has not yet been released.
2018-01-07 15:19:51 -05:00
Eeshan Garg ae59b08316 api docs: Document the GET /api/v1/users/me endpoint.
Note that there is no JavaScript equivalent for requesting this
endpoint in zulip-js yet.
2018-01-07 15:19:51 -05:00
Eeshan Garg 045aacbc67 api docs: Document the PATCH /api/v1/messages/<msg_id> endpoint.
Note that there is no JavaScript equivalent for requesting this
endpoint in zulip-js yet.
2018-01-07 15:19:51 -05:00
Eeshan Garg 6f01b042a1 api docs: Document the DELETE /api/v1/events endpoint.
Note that there is no JavaScript equivalent for requesting this
endpoint in zulip-js yet.
2018-01-07 15:19:51 -05:00
Eeshan Garg 479bc41ca5 api docs: Remove old and outdated endpoint docs. 2018-01-04 10:17:29 -05:00
Eeshan Garg 1fd71287d6 api docs: Document the GET /api/v1/events endpoint. 2018-01-04 10:17:29 -05:00
Eeshan Garg d235a6c0c4 api docs: Remove superfluous sys imports in Python examples.
These are remnants from old code examples that I forgot to
remove.
2018-01-04 10:17:29 -05:00
Eeshan Garg c616d7869b api docs: Recommend using zuliprc file for configuration.
In our code examples, we now recommend using a zuliprc file
instead of passing in the config info directly.
2018-01-04 10:17:29 -05:00
Eeshan Garg f620525373 api docs: Document the POST /api/v1/register endpoint. 2018-01-03 12:23:30 -05:00
Cynthia Lin c31e148ea8 user docs: Add links back to homepage to the bottom of the sidebars. 2017-12-31 08:08:25 -05:00
Eeshan Garg b73c60a135 api docs: Document the GET /api/v1/users endpoint. 2017-12-30 11:03:23 -05:00
Eeshan Garg b31bdf23ca api docs: Document the POST /api/v1/messages/render endpoint.
Note that currently, there is no way to interface with this
endpoint using zulip-js.
2017-12-30 11:03:23 -05:00
Eeshan Garg 0458faf2f9 api docs: Document the GET /users/me/subscriptions endpoint. 2017-12-30 11:03:23 -05:00
Eeshan Garg cf8a8c8811 api docs: Document the GET /api/v1/get_stream_id endpoint.
This commit documents the /api/v1/get_stream_id endpoint.

Note that there is currently no way to interface with this
endpoint with zulip-js.
2017-12-30 11:03:23 -05:00
Eeshan Garg e769a7eed2 api docs: Document the get-streams endpoint.
This commit documents the get-streams endpoint, which can be
by making a GET request to /api/v1/streams.

Note that in the code examples, JavaScript is missing an example
for how to pass in the `include_` query parameters. That is
because zulip-js's client.streams.retrieve function doesn't take
any arguments and zulip-js does not export any function equivalent
to client.call_endpoint in python-zulip-api/zulip.
2017-12-29 17:03:36 -05:00
Eeshan Garg 3003d3d927 api examples: Change required JS module from `zulip` to `zulip-js`.
The JS module we ask our users to install in the installation
instructions is zulip-js, not zulip. These examples would fail
with the latter. This commit updates the examples to use the
name zulip-js.
2017-12-29 17:03:36 -05:00
Eeshan Garg 89f622937d api docs: Generate Arguments table from JSON.
This commit does the following:
* Move the Arguments table data from stream-message.md and
  private-message.md to a JSON file.
* Add a Markdown extension that allows one to include and render
  a table from a JSON file like so:
    {generate_arguments_table|arguments.json|private-stream.md}
* Use Bootstrap's .table class to format the table instead of
  relying on custom CSS.
2017-12-29 17:03:36 -05:00
Eeshan Garg 229cdfce90 markdown: Add a macro for invalid API key JSON response.
The JSON response for when an invalid API key is used to initiate
an API call seems to be identical in every case, so this macro
can be reused all the time.
2017-12-29 17:03:36 -05:00
Eeshan Garg 3a90a6be5e markdown: Add macro for successful send message JSON response.
The JSON response for when an API call to send a message is
successful is the same for both private and stream messages, so
these macros may be used again.
2017-12-29 17:03:36 -05:00
Eeshan Garg b093a861e0 api/private-message: Document arguments and examples responses.
This commit adds the following:

* A table specifying the arguments that are required for this API
  call.
* Examples of JSON responses.

This will help us in obsoleting api_endpoints.html.
2017-12-29 17:03:36 -05:00
Eeshan Garg cdcaf1374e api/stream-message: Document arguments and examples responses.
This commit adds the following:

* A table specifying the arguments that are required for this API
  call.
* Examples of JSON responses.

This will help us in obsoleting api_endpoints.html.
2017-12-29 17:03:36 -05:00
Eeshan Garg 94bc9d52d1 api docs: Split usage.md into two separate docs.
This commit splits usage.md into two separate docs,
stream-message.md and private-message.md. The arguments and return
values for sending a stream message are somewhat different from
those of sending a private message, so it made sense to split the
two up for clarity.
2017-12-29 17:03:36 -05:00
akashnimare db7943478e api: Align code blocks properly in /api page.
Fixes #7395.
2017-12-29 08:45:37 -05:00
Steve Howell 7b8cc396b5 bot docs: Simplify docs on writing bot tests.
These changes catch up to some recent improvements in the
test system, plus I eliminate some unnecessary sections.
2017-12-14 07:07:18 -05:00
YJDave e4bf3d6907 api: Fix typo in interactive bots doc. 2017-12-14 00:53:23 -08:00
Greg Price ca09c1e0fd templates: Revert change to Python 3 typing syntax in examples.
This reverts commit 5a1869901.  I reviewed this change and decided not
to merge it yet, but then I did anyway <_< >_>, along with some others
in the same PR.
2017-12-12 17:45:43 -08:00
rht 5a1869901d templates: Use Python 3 syntax for typing. 2017-12-12 17:42:54 -08:00
Nikhil Kumar Mishra 799bf58463 bot docs: Change zulip-bot-output to zulip-terminal.
Fixes #7734 .
2017-12-12 16:43:23 -06:00
Tim Abbott 6f53d65e56 docs: Update a few broken links to the Git guide. 2017-11-23 16:24:00 -08:00
Tim Abbott 9074b9f2fa docs: Do a few more tweaks to the webhook walkthrough formatting. 2017-11-22 10:29:07 -08:00
derAnfaenger a1d255471c docs: Fix formatting of integration-docs-guide.md 2017-11-22 10:29:07 -08:00
derAnfaenger 41a2032d71 docs: Add 'requirements.txt' to bot structure outline. 2017-11-21 09:08:48 -08:00
Steve Howell 4a6c3eeb98 Use realistic filepaths in zuliprc docs and hints.
The first part of this change is to have the "Your bots"
tooltip not lie about creating `.zuliprc`, because it
doesn't put a dot in front of the file.

And then the more significant change here is to make
the "Running a bot" documentation use realistic filepaths,
both in terms of where the download typically puts the file,
and where you want to move it to.
2017-11-21 07:32:24 -08:00
Tim Abbott 94d188fd7d docs: Fix broken anchor links after API docs migration. 2017-11-17 15:56:05 -08:00
derAnfaenger 73915a9631 docs: Move integration docs to /api. 2017-11-17 11:58:54 -08:00
Tim Abbott 026410dd1b api: Fix a typo in an anchor tag URL. 2017-11-17 11:03:08 -08:00
Mohd Ali Rizwi 2b858ab47b api: Fix code blocks in headings.
These didn't look good, and were unnecessary.

Fixes part of #7395.

Commit message tweaked by tabbott.
2017-11-17 11:03:08 -08:00
Tim Abbott bf77ad3a6e docs: Clean a few files of too-long lines.
We also document why the rest of them are still on the list.
2017-11-16 11:49:00 -08:00
Tim Abbott 07c2b205a4 docs: Update absolute links to point to new URLs.
This should get test-documentation and test-help-documentation passing
again after we moved everything around in the last commit.

There are a lot more absolute links (generally in code comments) to
update, but they are lower-priority and can be done in a follow-up
pass.
2017-11-16 10:08:22 -08:00
Tim Abbott 9dd5d6e999 api: Fix broken links detected by new tests. 2017-11-15 10:12:59 -08:00
derAnfaenger 5ef09bfcd4 docs: Move bot docs to /api.
With a few fixes for rendering bugs.  The rest will be in a follow-up
issue.
2017-11-15 09:58:29 -08:00
Tim Abbott 54aa87fba3 api: Migrate to using the new version of the API site. 2017-11-10 17:56:22 -08:00
Tim Abbott 0386c674cb api: Fill out the sidebar with sections.
Most of these should be migrated from ReadTheDocs to this new site.
2017-11-08 13:15:41 -08:00
Tim Abbott a8c735e1d2 /api/: Fix some headings. 2017-11-08 13:08:23 -08:00
Brock Whittaker d2e55fa5c8 /api/ & /help/: Change index to <h1>.
The Index should be presented as an <h1> section and to the far left.
2017-11-08 13:01:33 -08:00
Tim Abbott 5703b38ffb api: Move usage instructions to their own page. 2017-11-08 10:29:24 -08:00
Tim Abbott c869ed2c3b api-docs: Extract installation instructions to their own section. 2017-11-08 10:01:48 -08:00
Tim Abbott 67d85caf34 api-docs: Clean up reference to bin/ in the tarball. 2017-11-08 09:44:55 -08:00
Tim Abbott ac63be7a0c api-docs: Fix space in zulip-send instructions. 2017-11-08 09:43:41 -08:00
Eeshan Garg 7c113f0447 api-docs: Render api_url in /api docs.
In templates/zerver/api/main.html, since the current context isn't
passed to render_markdown_path when rendering an article,
render_markdown_path doesn't have the context to render values such
as api_url. This commit makes sure that it does by passing a dict
called api_uri_context to render_markdown_path when rendering an
article.
2017-11-08 01:29:49 -03:30
Eeshan Garg 6d48601f40 api-docs: Use proper indentation for code blocks. 2017-11-08 01:13:19 -03:30
Tim Abbott f01f596138 help: Merge api.js and help.js bundles to fix code blocks.
In addition to decreasing the excessive number of bundles we had, this
will set us up to fix rendering of code blocks when clicking the
sidebar links in the /api-new site.
2017-10-30 22:53:17 -07:00
Brock Whittaker e86e259cb1 /api/: Add Markdown-based /api-new documentation.
This commit allows for the /api-new/ page to rendered similarly to our
/help pages.  It's based on the old content for /api, but we're not
replacing the old content yet, to give a bit of time to restructure
things reasonably.

Tweaked by eeshangarg and tabbott.
2017-10-30 22:32:43 -07:00