webhooks/helloworld: Migrate docs to Markdown.

This commit is contained in:
Eeshan Garg
2017-06-01 23:28:33 -02:30
committed by Tim Abbott
parent 6defd7f36e
commit 5d868b1612
3 changed files with 35 additions and 31 deletions

View File

@@ -595,6 +595,7 @@ def build_custom_checkers(by_lang):
"docs/migration-renumbering.md",
"docs/readme-symlink.md",
"README.md",
"zerver/webhooks/helloworld/doc.md",
"zerver/webhooks/solano/doc.md",
"zerver/webhooks/trello/doc.md",
}

View File

@@ -1,31 +0,0 @@
<p>Learn how Zulip integrations work with this simple Hello World example!</p>
<p>
The Hello World webhook will use the <code>test</code> stream, which is
created by default in the Zulip dev environment. If you are running
Zulip in production, you should make sure this stream exists.
</p>
<p>
Next, on your {{ settings_html|safe }}, create a Hello World bot. Construct the URL for
the Hello World bot using the API key and stream name:
<code>{{ external_api_uri_subdomain }}/v1/external/helloworld?api_key=abcdefgh&amp;stream=test</code>
</p>
<p>To trigger a notication using this webhook, use `send_webhook_fixture_message` from the Zulip command line:</p>
<div class="codehilite">
<pre>(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:/srv/zulip$
./manage.py send_webhook_fixture_message \
> --fixture=zerver/fixtures/helloworld/hello.json \
> '--url=http://localhost:9991/api/v1/external/helloworld?api_key=&lt;api_key&gt;'
</pre>
</div>
<p>Or, use curl:</p>
<div class="codehilite">
<pre>curl -X POST -H "Content-Type: application/json" -d '{ "featured_title":"Marilyn Monroe", "featured_url":"https://en.wikipedia.org/wiki/Marilyn_Monroe" }' http://localhost:9991/api/v1/external/helloworld\?api_key\=&lt;api_key&gt;</pre>
</div>
<p><b>Congratulations! You're done!</b><br/> Your messages may look like:</p>
<img class="screenshot" src="/static/images/integrations/helloworld/001.png"/>

View File

@@ -0,0 +1,34 @@
Learn how Zulip integrations work with this simple Hello World example!
The Hello World webhook will use the `test` stream, which is
created by default in the Zulip dev environment. If you are running
Zulip in production, you should make sure that this stream exists.
Next, on your {{ settings_html|safe }}, create a Hello World bot.
Construct the URL for the Hello World bot using the API key and
stream name:
`{{ external_api_uri_subdomain }}/v1/external/helloworld?api_key=abcdefgh&stream=test`
To trigger a notification using this webhook, use
`send_webhook_fixture_message` from the Zulip command line:
```
(zulip-venv)vagrant@vagrant-ubuntu-trusty-64:/srv/zulip$
./manage.py send_webhook_fixture_message \
> --fixture=zerver/fixtures/helloworld/hello.json \
> '--url=http://localhost:9991/api/v1/external/helloworld?api_key=&lt;api_key&gt;'
```
Or, use curl:
```
curl -X POST -H "Content-Type: application/json" -d '{ "featured_title":"Marilyn Monroe", "featured_url":"https://en.wikipedia.org/wiki/Marilyn_Monroe" }' http://localhost:9991/api/v1/external/helloworld\?api_key\=&lt;api_key&gt;
```
{!congrats.md!}
![](/static/images/integrations/helloworld/001.png)