Skip to content

Commit a98fd9e

Browse files
committed
docs: autoformat the document being changed before making edits
1 parent 3ab4638 commit a98fd9e

1 file changed

Lines changed: 14 additions & 15 deletions

File tree

docs/content/installation.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
This package supports Python 3.6 and higher. We recommend using [PyPI](https://pypi.python.org/pypi) to install. Run the following command:
44

5-
``` bash
5+
```bash
66
pip install slack_sdk
77
```
88

99
Alternatively, you can always pull the source code directly into your
1010
project:
1111

12-
``` bash
12+
```bash
1313
git clone https://github.com/slackapi/python-slack-sdk.git
1414
cd python-slack-sdk
1515
python3 -m venv .venv
@@ -20,7 +20,7 @@ pip install -e . # install the SDK project into the virtual env
2020

2121
Create a `./test.py` file with the following:
2222

23-
``` python title="test.py"
23+
```python title="test.py"
2424
# test.py
2525
import sys
2626
# Enable debug logging
@@ -34,7 +34,7 @@ api_response = client.api_test()
3434

3535
Then, run the script:
3636

37-
``` bash
37+
```bash
3838
python test.py
3939
```
4040

@@ -52,12 +52,11 @@ ability to read and write data. Treat these tokens just as you would a
5252
password — don't publish them, don't check them into source code, and
5353
don't share them with others.
5454

55-
5655
:::danger
5756

5857
Never do the following:
5958

60-
``` python
59+
```python
6160
token = 'xoxb-111-222-xxxxx'
6261
```
6362

@@ -67,13 +66,13 @@ We recommend you pass tokens in as environment variables, or persist
6766
them in a database that is accessed at runtime. You can add a token to
6867
the environment by starting your app as:
6968

70-
``` python
69+
```python
7170
SLACK_BOT_TOKEN="xoxb-111-222-xxxxx" python myapp.py
7271
```
7372

7473
Then retrieve the key with:
7574

76-
``` python
75+
```python
7776
import os
7877
SLACK_BOT_TOKEN = os.environ["SLACK_BOT_TOKEN"]
7978
```
@@ -111,7 +110,7 @@ scopes are determined by the functionality of the app — every method
111110
you wish to access has a corresponding scope and your app will need to
112111
request that scope in order to be able to access the method. Review the [full list of Slack OAuth scopes](https://api.slack.com/scopes).
113112

114-
``` python
113+
```python
115114
import os
116115
from slack_sdk import WebClient
117116
from flask import Flask, request
@@ -136,7 +135,7 @@ This link directs the user to the Slack OAuth acceptance page, where the
136135
user will review and accept or refuse the permissions your app is
137136
requesting as defined by the scope(s).
138137

139-
``` python
138+
```python
140139
@app.route("/slack/install", methods=["GET"])
141140
def pre_install():
142141
state = "randomly-generated-one-time-value"
@@ -154,7 +153,7 @@ will redirect the user to your auth completion page, which includes a
154153
[endpoint](https://api.slack.com/methods/oauth.v2.access) that will
155154
finally grant you the token.
156155

157-
``` python
156+
```python
158157
@app.route("/slack/oauth_redirect", methods=["GET"])
159158
def post_install():
160159
# Verify the "state" parameter
@@ -176,7 +175,7 @@ def post_install():
176175
A successful request to `oauth.v2.access` will yield a JSON payload with
177176
at least one token, a bot token that begins with `xoxb`.
178177

179-
``` python
178+
```python
180179
@app.route("/slack/oauth_redirect", methods=["GET"])
181180
def post_install():
182181
# Verify the "state" parameter
@@ -216,7 +215,7 @@ We recommend using [virtualenv
216215
(venv)](https://docs.python.org/3/tutorial/venv.html) to set up your
217216
Python runtime.
218217

219-
``` bash
218+
```bash
220219
# Create a dedicated virtual env for running your Python scripts
221220
python -m venv .venv
222221

@@ -233,7 +232,7 @@ export SLACK_BOT_TOKEN=xoxb-***
233232
Then, verify the following code works on the Python REPL (you can start
234233
it by just `python`).
235234

236-
``` python
235+
```python
237236
import os
238237
import logging
239238
from slack_sdk import WebClient
@@ -247,4 +246,4 @@ package. That being said, the code you're working on may be still using
247246
the old package. If you encounter an error saying
248247
`AttributeError: module 'slack' has no attribute 'WebClient'`, run
249248
`pip list`. If you find both `slack_sdk` and `slack` in the output, try
250-
removing `slack` by `pip uninstall slack` and reinstalling `slack_sdk`.
249+
removing `slack` by `pip uninstall slack` and reinstalling `slack_sdk`.

0 commit comments

Comments
 (0)