Skip to content

Commit 77b2d31

Browse files
committed
doc: documentation overhaul
1 parent 39cc433 commit 77b2d31

10 files changed

Lines changed: 454 additions & 199 deletions

File tree

README.md

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

33
The community-maintained Python library for Top.gg.
44

5+
## Chapters
6+
7+
- [Installation](#installation)
8+
- [Setting up](#setting-up)
9+
- [Usage](#usage)
10+
- [Getting a bot](#getting-a-bot)
11+
- [Getting several bots](#getting-several-bots)
12+
- [Getting your bot's voters](#getting-your-bots-voters)
13+
- [Check if a user has voted for your bot](#check-if-a-user-has-voted-for-your-bot)
14+
- [Getting your bot's server count](#getting-your-bots-server-count)
15+
- [Posting your bot's server count](#posting-your-bots-server-count)
16+
- [Automatically posting your bot's server count every few minutes](#automatically-posting-your-bots-server-count-every-few-minutes)
17+
- [Checking if the weekend vote multiplier is active](#checking-if-the-weekend-vote-multiplier-is-active)
18+
- [Generating widget URLs](#generating-widget-urls)
19+
- [Webhooks](#webhooks)
20+
- [Being notified whenever someone voted for your bot](#being-notified-whenever-someone-voted-for-your-bot)
21+
522
## Installation
623

724
```sh
@@ -10,24 +27,26 @@ $ pip install topggpy
1027

1128
## Setting up
1229

13-
### Automatic cleanup
30+
### Implicit cleanup
1431

1532
```py
1633
import topgg
1734

1835
import os
1936

37+
2038
async with topgg.Client(os.getenv('TOPGG_TOKEN')) as client:
2139
# ...
2240
```
2341

24-
### Manual cleanup
42+
### Explicit cleanup
2543

2644
```py
2745
import topgg
2846

2947
import os
3048

49+
3150
client = topgg.Client(os.getenv('TOPGG_TOKEN'))
3251

3352
# ...
@@ -165,6 +184,7 @@ import topgg
165184
import asyncio
166185
import os
167186

187+
168188
webhooks = topgg.Webhooks(os.getenv('MY_TOPGG_WEBHOOK_SECRET'), 8080)
169189

170190
@webhooks.on_vote('/votes')

docs/_static/style.css

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,30 @@ aside.toc-drawer .docutils:hover, .sidebar-brand-text:hover {
2727
filter: opacity(75%);
2828
}
2929

30-
.highlight .c1, em {
30+
.highlight *, em {
3131
font-style: normal !important;
32+
text-decoration: none !important;
33+
font-weight: normal !important;
3234
}
3335

34-
.highlight .nn {
35-
text-decoration: none !important;
36+
.sig-paren, span.p, :not(.sig-name) > span.pre {
37+
font-weight: normal !important;
38+
}
39+
40+
:not(h1) > a.reference {
41+
text-decoration: underline;
42+
}
43+
44+
:not(h1) > a.reference:hover {
45+
text-decoration: none;
46+
}
47+
48+
.field-even p strong, .field-odd p strong {
49+
font-family: var(--font-stack--monospace);
50+
}
51+
52+
h1 > a.reference:hover {
53+
text-decoration: underline;
3654
}
3755

3856
h1 {
@@ -41,8 +59,4 @@ h1 {
4159

4260
.sidebar-brand-text {
4361
font-weight: bolder;
44-
}
45-
46-
.sidebar-scroll .reference.internal {
47-
color: var(--color-brand-primary);
4862
}

docs/client.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ Client reference
44
.. autoclass:: topgg.client.Client
55
:members:
66

7-
.. automodule:: topgg.widget
7+
.. autoclass:: topgg.widget.WidgetType()
88
:members:
9+
:undoc-members:
910

10-
.. autoclass:: topgg.models.SortBy()
11-
:members:
11+
.. autofunction:: topgg.widget.large
12+
.. autofunction:: topgg.widget.owner
13+
.. autofunction:: topgg.widget.social
14+
.. autofunction:: topgg.widget.votes
1215

1316
.. autoclass:: topgg.errors.Error()
1417

0 commit comments

Comments
 (0)