Skip to content

Commit d3058ca

Browse files
docs: audit and fix docs/english markdown files (#1883)
1 parent 2491a2d commit d3058ca

18 files changed

Lines changed: 146 additions & 150 deletions

.github/maintainers_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You can hook `pyenv` into your shell automatically by running `pyenv init` and f
1919

2020
Install necessary Python runtimes for development/testing. It is not necessary
2121
to install all the various Python versions we test in [continuous integration on
22-
GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/tests.yml),
22+
GitHub Actions](https://github.com/slackapi/python-slack-sdk/blob/main/.github/workflows/ci-build.yml),
2323
but make sure you are running at least one version that we execute our tests in
2424
locally so that you can run the tests yourself.
2525

docs/english/audit-logs.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ You'll need a valid token in order to use the Audit Logs API. In addition, the S
88

99
---
1010

11-
## AuditLogsClient {#auditlogsclient}
11+
## AuditLogsClient {/* #auditlogsclient */}
1212

1313
An OAuth token with [the admin scope](/reference/scopes/admin) is required to access this API.
1414

@@ -34,9 +34,9 @@ api_response = client.schemas()
3434
api_response = client.actions()
3535
```
3636

37-
## AsyncAuditLogsClient {#asyncauditlogsclient}
37+
## AsyncAuditLogsClient {/* #asyncauditlogsclient */}
3838

39-
If you are keen to use asyncio for SCIM API calls, we offer AsyncSCIMClient for it. This client relies on aiohttp library.
39+
If you are keen to use asyncio for Audit Logs API calls, we offer AsyncAuditLogsClient for it. This client relies on the aiohttp library.
4040

4141
``` python
4242
from slack_sdk.audit_logs.async_client import AsyncAuditLogsClient
@@ -48,7 +48,7 @@ api_response.typed_body # slack_sdk.audit_logs.v1.LogsResponse
4848

4949
---
5050

51-
## RetryHandler {#retryhandler}
51+
## RetryHandler {/* #retryhandler */}
5252

5353
With the default settings, only `ConnectionErrorRetryHandler` with its default configuration (=only one retry in the manner of [exponential backoff and jitter](https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/)) is enabled. The retry handler retries if an API client encounters a connectivity-related failure (e.g., connection reset by peer).
5454

@@ -67,7 +67,7 @@ rate_limit_handler = RateLimitErrorRetryHandler(max_retry_count=1)
6767
client.retry_handlers.append(rate_limit_handler)
6868
```
6969

70-
You can also create one on your own by defining a new class that inherits `slack_sdk.http_retry RetryHandler` (`AsyncRetryHandler` for asyncio apps) and implements required methods (internals of `can_retry` / `prepare_for_next_retry`). Check out the source code for the ones that are built in to learn how to properly implement them.
70+
You can also create one on your own by defining a new class that inherits `slack_sdk.http_retry.RetryHandler` (`AsyncRetryHandler` for asyncio apps) and implements required methods (internals of `can_retry` / `prepare_for_next_attempt`). Check out the source code for the ones that are built in to learn how to properly implement them.
7171

7272
``` python
7373
import socket
@@ -100,4 +100,4 @@ client = AuditLogsClient(
100100
)
101101
```
102102

103-
For asyncio apps, `Async` prefixed corresponding modules are available. All the methods in those methods are async/await compatible. Check [the source code](https://github.com/slackapi/python-slack-sdk/blob/main/slack_sdk/http_retry/async_handler.py) for more details.
103+
For asyncio apps, `Async` prefixed corresponding modules are available. All the methods in those modules are async/await compatible. Check [the source code](https://github.com/slackapi/python-slack-sdk/blob/main/slack_sdk/http_retry/async_handler.py) for more details.

docs/english/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ The Slack Python SDK has corresponding packages for Slack APIs. They are small a
44

55
The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you can pick just those that fit your needs.
66

7-
## Features {#features}
7+
## Features {/* #features */}
88

99
| Feature | Use | Package |
1010
|---|---|---|
@@ -20,7 +20,7 @@ The Slack platform offers several APIs to build apps. Each Slack API delivers pa
2020

2121
You can also view the [Python module documents](https://docs.slack.dev/tools/python-slack-sdk/reference)!
2222

23-
## Getting help {#getting-help}
23+
## Getting help {/* #getting-help */}
2424

2525
These docs have lots of information on the Python Slack SDK. There's also an in-depth Reference section. Please explore!
2626

@@ -29,7 +29,7 @@ If you get stuck, we're here to help. The following are the best ways to get ass
2929
* [Issue Tracker](http://github.com/slackapi/python-slack-sdk/issues) for questions, bug reports, feature requests, and general discussion related to the Python Slack SDK. Try searching for an existing issue before creating a new one.
3030
* [Email](mailto:support@slack.com) our developer support team: `support@slack.com`.
3131

32-
## Contributing {#contributing}
32+
## Contributing {/* #contributing */}
3333

3434
These docs live within the [Python Slack SDK](https://github.com/slackapi/python-slack-sdk) repository and are open source.
3535

docs/english/installation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ python test.py
3939

4040
It's also good to try on the Python REPL.
4141

42-
## Access tokens {#handling-tokens}
42+
## Access tokens {/* #handling-tokens */}
4343

4444
Making calls to the Slack API often requires a [token](/authentication/tokens) with associated scopes that grant access to resources. Collecting a token can be done from app settings or with an OAuth installation depending on your app's requirements.
4545

@@ -71,13 +71,13 @@ SLACK_BOT_TOKEN = os.environ["SLACK_BOT_TOKEN"]
7171

7272
Refer to our [best practices for security](/security) page for more information.
7373

74-
## Installing on a single workspace {#single-workspace}
74+
## Installing on a single workspace {/* #single-workspace */}
7575

7676
If you're building an application for a single Slack workspace, there's no need to build out the entire OAuth flow. Once you've set up your features, click the **Install App to Team** button on the **Install App** page. If you add new permission scopes or Slack app features after an app has been installed, you must reinstall the app to your workspace for the changes to take effect.
7777

7878
Refer to the [Slack quickstart](/quickstart) guide for more details.
7979

80-
## Installing on multiple workspaces {#multi-workspace}
80+
## Installing on multiple workspaces {/* #multi-workspace */}
8181

8282
If you intend for an app to be installed on multiple Slack workspaces, you will need to handle this installation via the industry-standard OAuth protocol. Read more about [installing with OAuth](/authentication/installing-with-oauth).
8383

@@ -97,7 +97,7 @@ oauth_scope = os.environ["SLACK_SCOPES"]
9797
app = Flask(__name__)
9898
```
9999

100-
### The OAuth initiation link {#oauth-link}
100+
### The OAuth initiation link {/* #oauth-link */}
101101

102102
To begin the OAuth flow that will install your app on a workspace, you'll need to provide the user with a link to the Slack OAuth page. This can be a simple link to `https://slack.com/oauth/v2/authorize` with the
103103
`scope` and `client_id` query parameters.
@@ -113,7 +113,7 @@ def pre_install():
113113
'Add to Slack</a>'
114114
```
115115

116-
### The OAuth completion page {#oauth-completion}
116+
### The OAuth completion page {/* #oauth-completion */}
117117

118118
Once the user has agreed to the permissions you've requested, Slack will redirect the user to your auth completion page, which includes a `code` query string parameter. You'll use the `code` parameter to call the [`oauth.v2.access`](/reference/methods/oauth.v2.access) API method that will grant you the token.
119119

@@ -172,7 +172,7 @@ Once your user has completed the OAuth flow, you'll be able to use the provided
172172

173173
Refer to the [basic usage](/tools/python-slack-sdk/legacy/basic_usage) page for more examples.
174174

175-
## Installation troubleshooting {#troubleshooting}
175+
## Installation troubleshooting {/* #troubleshooting */}
176176

177177
We recommend using [virtualenv (venv)](https://docs.python.org/3/tutorial/venv.html) to set up your
178178
Python runtime.

docs/english/legacy/auth.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The v3 SDK provides additional features such as Socket Mode, OAuth flow, SCIM AP
66

77
:::
88

9-
## Access tokens {#handling-tokens}
9+
## Access tokens {/* #handling-tokens */}
1010

1111
**Always keep your access tokens safe.**
1212

@@ -33,13 +33,13 @@ SLACK_BOT_TOKEN = os.environ["SLACK_BOT_TOKEN"]
3333

3434
Refer to our [best practices for security](/security) page for more information.
3535

36-
## Installing on a single workspace {#single-workspace}
36+
## Installing on a single workspace {/* #single-workspace */}
3737

3838
If you're building an application for a single Slack workspace, there's no need to build out the entire OAuth flow. Once you've set up your features, click the **Install App to Team** button on the **Install App** page. If you add new permission scopes or Slack app features after an app has been installed, you must reinstall the app to your workspace for the changes to take effect.
3939

4040
Refer to the [quickstart](/quickstart) guide for more details.
4141

42-
## Installing on multiple workspaces {#multi-workspace}
42+
## Installing on multiple workspaces {/* #multi-workspace */}
4343

4444
If you intend for an app to be installed on multiple Slack workspaces, you will need to handle this installation via the industry-standard OAuth protocol. Read more about [installing with OAuth](/authentication/installing-with-oauth).
4545

@@ -59,7 +59,7 @@ oauth_scope = os.environ["SLACK_SCOPES"]
5959
app = Flask(__name__)
6060
```
6161

62-
### The OAuth initiation link {#oauth-link}
62+
### The OAuth initiation link {/* #oauth-link */}
6363

6464
To begin the OAuth flow that will install your app on a workspace, you'll need to provide the user with a link to the Slack OAuth page. This can be a simple link to `https://slack.com/oauth/v2/authorize` with the
6565
`scope` and `client_id` query parameters.
@@ -75,7 +75,7 @@ def pre_install():
7575
'Add to Slack</a>'
7676
```
7777

78-
### The OAuth completion page {#oauth-completion}
78+
### The OAuth completion page {/* #oauth-completion */}
7979

8080
Once the user has agreed to the permissions you've requested, Slack will redirect the user to your auth completion page, which includes a `code` query string parameter. You'll use the `code` parameter to call the [`oauth.v2.access`](/reference/methods/oauth.v2.access) API method that will grant you the token.
8181

docs/english/legacy/basic_usage.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Accessing Slack API methods requires an OAuth token — read more about [install
1212

1313
Each of these [API methods](/reference/methods) is fully documented on our developer site at [docs.slack.dev](/).
1414

15-
## Sending a message {#sending-messages}
15+
## Sending a message {/* #sending-messages */}
1616

1717
One of the primary uses of Slack is posting messages to a channel using the channel ID, or as a DM to another person using their user ID. This method will handle either a channel ID or a user ID passed to the `channel` parameter.
1818

@@ -55,7 +55,7 @@ response = client.chat_postEphemeral(
5555

5656
See the [`chat.postEphemeral`](/reference/methods/chat.postEphemeral) API method for more details.
5757

58-
## Formatting messages with Block Kit {#block-kit}
58+
## Formatting messages with Block Kit {/* #block-kit */}
5959

6060
Messages posted from apps can contain more than just text; they can also include full user interfaces composed of blocks using [Block Kit](/block-kit).
6161

@@ -104,7 +104,7 @@ client.chat_postMessage(
104104

105105
:::
106106

107-
## Threading messages {#threading-messages}
107+
## Threading messages {/* #threading-messages */}
108108

109109
Threaded messages are a way of grouping messages together to provide greater context. You can reply to a thread or start a new threaded conversation by simply passing the original message's `ts` ID in the `thread_ts` attribute when posting a message. If you're replying to a threaded message, you'll pass the `thread_ts` ID of the message you're replying to.
110110

@@ -137,7 +137,7 @@ When appearing in the channel, it won't contain any attachments or message butto
137137

138138
Refer to the [threading messages](/messaging#threading) page for more information.
139139

140-
## Updating a message {#updating-messages}
140+
## Updating a message {/* #updating-messages */}
141141

142142
Let's say you have a bot that posts the status of a request. When that request changes, you'll want to update the message to reflect it's state.
143143

@@ -151,7 +151,7 @@ response = client.chat_update(
151151

152152
See the [`chat.update`](/reference/methods/chat.update) API method for formatting options and some special considerations when calling this with a bot user.
153153

154-
## Deleting a message {#deleting-messages}
154+
## Deleting a message {/* #deleting-messages */}
155155

156156
Sometimes you need to delete things.
157157

@@ -165,7 +165,7 @@ response = client.chat_delete(
165165
See the [`chat.delete`](/reference/methods/chat.delete) API method for more
166166
details.
167167

168-
## Opening a modal {#opening-modals}
168+
## Opening a modal {/* #opening-modals */}
169169

170170
Modals allow you to collect data from users and display dynamic information in a focused surface. Modals use the same blocks that compose messages, with the addition of an `input` block.
171171

@@ -244,14 +244,14 @@ if __name__ == "__main__":
244244
app.run("localhost", 3000)
245245
```
246246

247-
See the [`views.open`](/reference/methods/views.open) API method more details and additional parameters.
247+
See the [`views.open`](/reference/methods/views.open) API method for more details and additional parameters.
248248

249249
To run the above example, the following [app configurations](https://api.slack.com/apps) are required:
250250

251251
* Enable **Interactivity** with a valid Request URL: `https://{your-public-domain}/slack/events`
252252
* Add a global shortcut with the callback ID: `open-modal-shortcut`
253253

254-
## Updating and pushing modals {#updating-pushing-modals}
254+
## Updating and pushing modals {/* #updating-pushing-modals */}
255255

256256
You can dynamically update a view inside of a modal by calling the `views.update` API method and passing the view ID returned in the previous `views.open` API method call.
257257

@@ -298,7 +298,7 @@ See the [`views.update`](/reference/methods/views.update) API method for more de
298298

299299
If you want to push a new view onto the modal instead of updating an existing view, see the [`views.push`](/reference/methods/views.push) API method.
300300

301-
## Emoji reactions {#emoji}
301+
## Emoji reactions {/* #emoji */}
302302

303303
You can quickly respond to any message on Slack with an emoji reaction. Reactions can be used for any purpose: voting, checking off to-do items, showing excitement, or just for fun.
304304

@@ -324,7 +324,7 @@ response = client.reactions_remove(
324324

325325
See the [`reactions.add`](/reference/methods/reactions.add) and [`reactions.remove`](/reference/methods/reactions.remove) API methods for more details.
326326

327-
## Listing public channels {#listing-public-channels}
327+
## Listing public channels {/* #listing-public-channels */}
328328

329329
At some point, you'll want to find out what channels are available to your app. This is how you get that list.
330330

@@ -340,7 +340,7 @@ response = client.conversations_list(exclude_archived=1)
340340

341341
See the [`conversations.list`](/reference/methods/conversations.list) API method for more details.
342342

343-
## Getting a channel's info {#get-channel-info}
343+
## Getting a channel's info {/* #get-channel-info */}
344344

345345
Once you have the ID for a specific channel, you can fetch information about that channel.
346346

@@ -350,7 +350,7 @@ response = client.conversations_info(channel="C0XXXXXXX")
350350

351351
See the [`conversations.info`](/reference/methods/conversations.info) API method for more details.
352352

353-
## Joining a channel {#join-channel}
353+
## Joining a channel {/* #join-channel */}
354354

355355
Channels are the social hub of most Slack teams. Here's how you hop into one:
356356

@@ -364,7 +364,7 @@ See the [`conversations.join`](/reference/methods/conversations.join) API method
364364

365365
------------------------------------------------------------------------
366366

367-
## Leaving a channel {#leave-channel}
367+
## Leaving a channel {/* #leave-channel */}
368368

369369
Maybe you've finished up all the business you had in a channel, or maybe you joined one by accident. This is how you leave a channel.
370370

@@ -374,7 +374,7 @@ response = client.conversations_leave(channel="C0XXXXXXX")
374374

375375
See the [`conversations.leave`](/reference/methods/conversations.leave) API method for more details.
376376

377-
## Listing team members {#list-team-members}
377+
## Listing team members {/* #list-team-members */}
378378

379379
``` python
380380
response = client.users_list()
@@ -384,7 +384,7 @@ user_ids = list(map(lambda u: u["id"], users))
384384

385385
See the [`users.list`](/reference/methods/users.list) API method for more details.
386386

387-
## Uploading files {#uploading-files}
387+
## Uploading files {/* #uploading-files */}
388388

389389
``` python
390390
response = client.files_upload_v2(
@@ -396,7 +396,7 @@ response = client.files_upload_v2(
396396

397397
See the [`files.upload`](/reference/methods/files.upload) API method for more details.
398398

399-
## Calling API methods {#calling-API-methods}
399+
## Calling API methods {/* #calling-API-methods */}
400400

401401
This library covers all the public endpoints as the methods in `WebClient`. That said, you may see a bit of a delay with the library release. When you're in a hurry, you can directly use the `api_call` method as below.
402402

@@ -412,7 +412,7 @@ response = client.api_call(
412412
assert response["message"]["text"] == "Hello world!"
413413
```
414414

415-
## Rate limits {#rate-limits}
415+
## Rate limits {/* #rate-limits */}
416416

417417
When posting messages to a channel, Slack allows apps to send no more than one message per channel per second. We allow bursts over that limit for short periods; however, if your app continues to exceed the limit over a longer period of time, it will be rate limited. Different API methods have other limits — be sure to check the [rate limits](/apis/web-api/rate-limits) and test that your app has a graceful fallback if it should hit those limits.
418418

0 commit comments

Comments
 (0)