Skip to content

Commit f305201

Browse files
committed
docs: convert Sync/Async MkDocs tabs to GitHub-native <details> blocks
Replace pymdownx.tabbed '=== "Sync"/"Async"' content-tabs (render as literal text + lose highlighting on GitHub) with <details markdown="1"> collapsible blocks in README + 16 docs pages. Add md_in_html extension so fenced code inside <details> highlights on the MkDocs site.
1 parent 86c8200 commit f305201

18 files changed

Lines changed: 599 additions & 530 deletions

README.md

Lines changed: 72 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -84,74 +84,78 @@ the key stays out of source code):
8484
export DATAMAXI_API_KEY="your_api_key"
8585
```
8686

87-
=== "Sync"
88-
89-
```python
90-
from datamaxi import Datamaxi, Telegram, Naver
91-
92-
# Clients read DATAMAXI_API_KEY from the environment automatically.
93-
# Alternatively, pass api_key="your_api_key" explicitly to each client.
94-
maxi = Datamaxi()
95-
telegram = Telegram()
96-
naver = Naver()
97-
98-
# Fetch CEX candle data (returns pandas DataFrame)
99-
df = maxi.cex.candle(
100-
exchange="binance",
101-
symbol="BTC-USDT",
102-
interval="1d",
103-
market="spot"
104-
)
105-
print(df.head())
106-
107-
# Fetch ticker data
108-
ticker = maxi.cex.ticker.get(
109-
exchange="binance",
110-
symbol="BTC-USDT",
111-
market="spot"
112-
)
113-
print(ticker)
114-
115-
# Fetch premium data
116-
premium = maxi.premium(asset="BTC")
117-
print(premium.head())
118-
```
119-
120-
=== "Async"
121-
122-
```python
123-
import asyncio
124-
from datamaxi.aio import AsyncDatamaxi
125-
126-
127-
async def main():
128-
# Reads DATAMAXI_API_KEY from the environment automatically.
129-
# Alternatively, pass api_key="your_api_key" explicitly.
130-
async with AsyncDatamaxi() as client:
131-
# Fetch CEX candle data (returns pandas DataFrame)
132-
df = await client.cex.candle(
133-
exchange="binance",
134-
symbol="BTC-USDT",
135-
interval="1d",
136-
market="spot",
137-
)
138-
print(df.head())
139-
140-
# Fetch ticker data
141-
ticker = await client.cex.ticker.get(
142-
exchange="binance",
143-
symbol="BTC-USDT",
144-
market="spot",
145-
)
146-
print(ticker)
147-
148-
# Fetch premium data
149-
premium = await client.premium(asset="BTC")
150-
print(premium.head())
151-
152-
153-
asyncio.run(main())
154-
```
87+
<details markdown="1"><summary>Sync</summary>
88+
89+
```python
90+
from datamaxi import Datamaxi, Telegram, Naver
91+
92+
# Clients read DATAMAXI_API_KEY from the environment automatically.
93+
# Alternatively, pass api_key="your_api_key" explicitly to each client.
94+
maxi = Datamaxi()
95+
telegram = Telegram()
96+
naver = Naver()
97+
98+
# Fetch CEX candle data (returns pandas DataFrame)
99+
df = maxi.cex.candle(
100+
exchange="binance",
101+
symbol="BTC-USDT",
102+
interval="1d",
103+
market="spot"
104+
)
105+
print(df.head())
106+
107+
# Fetch ticker data
108+
ticker = maxi.cex.ticker.get(
109+
exchange="binance",
110+
symbol="BTC-USDT",
111+
market="spot"
112+
)
113+
print(ticker)
114+
115+
# Fetch premium data
116+
premium = maxi.premium(asset="BTC")
117+
print(premium.head())
118+
```
119+
120+
</details>
121+
122+
<details markdown="1"><summary>Async</summary>
123+
124+
```python
125+
import asyncio
126+
from datamaxi.aio import AsyncDatamaxi
127+
128+
129+
async def main():
130+
# Reads DATAMAXI_API_KEY from the environment automatically.
131+
# Alternatively, pass api_key="your_api_key" explicitly.
132+
async with AsyncDatamaxi() as client:
133+
# Fetch CEX candle data (returns pandas DataFrame)
134+
df = await client.cex.candle(
135+
exchange="binance",
136+
symbol="BTC-USDT",
137+
interval="1d",
138+
market="spot",
139+
)
140+
print(df.head())
141+
142+
# Fetch ticker data
143+
ticker = await client.cex.ticker.get(
144+
exchange="binance",
145+
symbol="BTC-USDT",
146+
market="spot",
147+
)
148+
print(ticker)
149+
150+
# Fetch premium data
151+
premium = await client.premium(asset="BTC")
152+
print(premium.head())
153+
154+
155+
asyncio.run(main())
156+
```
157+
158+
</details>
155159

156160
## Async Client
157161

docs/cex-announcement.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,50 @@ Exchange announcements such as listings and delistings.
44

55
## Usage
66

7-
=== "Sync"
7+
<details markdown="1"><summary>Sync</summary>
88

9-
```python
10-
from datamaxi import Datamaxi
9+
```python
10+
from datamaxi import Datamaxi
1111

12-
maxi = Datamaxi(api_key="YOUR_API_KEY")
12+
maxi = Datamaxi(api_key="YOUR_API_KEY")
1313

14-
data, next_request = maxi.cex.announcement(
15-
exchange="binance",
16-
category="listing",
17-
page=1,
18-
limit=50,
19-
sort="desc",
20-
)
14+
data, next_request = maxi.cex.announcement(
15+
exchange="binance",
16+
category="listing",
17+
page=1,
18+
limit=50,
19+
sort="desc",
20+
)
2121

22-
more_data, _ = next_request()
23-
```
22+
more_data, _ = next_request()
23+
```
2424

25-
=== "Async"
25+
</details>
2626

27-
```python
28-
import asyncio
29-
from datamaxi.aio import AsyncDatamaxi
27+
<details markdown="1"><summary>Async</summary>
3028

29+
```python
30+
import asyncio
31+
from datamaxi.aio import AsyncDatamaxi
3132

32-
async def main():
33-
async with AsyncDatamaxi(api_key="YOUR_API_KEY") as client:
34-
data, next_request = await client.cex.announcement(
35-
exchange="binance",
36-
category="listing",
37-
page=1,
38-
limit=50,
39-
sort="desc",
40-
)
4133

42-
more_data, _ = await next_request()
34+
async def main():
35+
async with AsyncDatamaxi(api_key="YOUR_API_KEY") as client:
36+
data, next_request = await client.cex.announcement(
37+
exchange="binance",
38+
category="listing",
39+
page=1,
40+
limit=50,
41+
sort="desc",
42+
)
4343

44+
more_data, _ = await next_request()
4445

45-
asyncio.run(main())
46-
```
46+
47+
asyncio.run(main())
48+
```
49+
50+
</details>
4751

4852
## Notes
4953

docs/cex-candle.md

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4,52 +4,56 @@ Historical OHLCV candle data for centralized exchanges.
44

55
## Usage
66

7-
=== "Sync"
7+
<details markdown="1"><summary>Sync</summary>
88

9-
```python
10-
from datamaxi import Datamaxi
9+
```python
10+
from datamaxi import Datamaxi
1111

12-
maxi = Datamaxi(api_key="YOUR_API_KEY")
12+
maxi = Datamaxi(api_key="YOUR_API_KEY")
1313

14-
exchanges = maxi.cex.candle.exchanges(market="spot")
15-
symbols = maxi.cex.candle.symbols(exchange="binance", market="spot")
16-
intervals = maxi.cex.candle.intervals()
14+
exchanges = maxi.cex.candle.exchanges(market="spot")
15+
symbols = maxi.cex.candle.symbols(exchange="binance", market="spot")
16+
intervals = maxi.cex.candle.intervals()
1717

18-
df = maxi.cex.candle(
19-
exchange="binance",
20-
symbol="BTC-USDT",
21-
interval="1d",
22-
market="spot",
23-
from_unix=1704067200,
24-
to_unix=1706745600,
25-
)
26-
```
18+
df = maxi.cex.candle(
19+
exchange="binance",
20+
symbol="BTC-USDT",
21+
interval="1d",
22+
market="spot",
23+
from_unix=1704067200,
24+
to_unix=1706745600,
25+
)
26+
```
2727

28-
=== "Async"
28+
</details>
2929

30-
```python
31-
import asyncio
32-
from datamaxi.aio import AsyncDatamaxi
30+
<details markdown="1"><summary>Async</summary>
3331

32+
```python
33+
import asyncio
34+
from datamaxi.aio import AsyncDatamaxi
3435

35-
async def main():
36-
async with AsyncDatamaxi(api_key="YOUR_API_KEY") as client:
37-
exchanges = await client.cex.candle.exchanges(market="spot")
38-
symbols = await client.cex.candle.symbols(exchange="binance", market="spot")
39-
intervals = await client.cex.candle.intervals()
4036

41-
df = await client.cex.candle(
42-
exchange="binance",
43-
symbol="BTC-USDT",
44-
interval="1d",
45-
market="spot",
46-
from_unix=1704067200,
47-
to_unix=1706745600,
48-
)
37+
async def main():
38+
async with AsyncDatamaxi(api_key="YOUR_API_KEY") as client:
39+
exchanges = await client.cex.candle.exchanges(market="spot")
40+
symbols = await client.cex.candle.symbols(exchange="binance", market="spot")
41+
intervals = await client.cex.candle.intervals()
4942

43+
df = await client.cex.candle(
44+
exchange="binance",
45+
symbol="BTC-USDT",
46+
interval="1d",
47+
market="spot",
48+
from_unix=1704067200,
49+
to_unix=1706745600,
50+
)
5051

51-
asyncio.run(main())
52-
```
52+
53+
asyncio.run(main())
54+
```
55+
56+
</details>
5357

5458
## Notes
5559

docs/cex-fee.md

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,40 @@ Trading fee schedules for centralized exchanges.
44

55
## Usage
66

7-
=== "Sync"
7+
<details markdown="1"><summary>Sync</summary>
88

9-
```python
10-
from datamaxi import Datamaxi
9+
```python
10+
from datamaxi import Datamaxi
1111

12-
maxi = Datamaxi(api_key="YOUR_API_KEY")
12+
maxi = Datamaxi(api_key="YOUR_API_KEY")
1313

14-
exchanges = maxi.cex.fee.exchanges()
15-
symbols = maxi.cex.fee.symbols(exchange="binance")
14+
exchanges = maxi.cex.fee.exchanges()
15+
symbols = maxi.cex.fee.symbols(exchange="binance")
1616

17-
fees = maxi.cex.fee(exchange="binance", symbol="BTC-USDT")
18-
```
17+
fees = maxi.cex.fee(exchange="binance", symbol="BTC-USDT")
18+
```
1919

20-
=== "Async"
20+
</details>
2121

22-
```python
23-
import asyncio
24-
from datamaxi.aio import AsyncDatamaxi
22+
<details markdown="1"><summary>Async</summary>
2523

24+
```python
25+
import asyncio
26+
from datamaxi.aio import AsyncDatamaxi
2627

27-
async def main():
28-
async with AsyncDatamaxi(api_key="YOUR_API_KEY") as client:
29-
exchanges = await client.cex.fee.exchanges()
30-
symbols = await client.cex.fee.symbols(exchange="binance")
3128

32-
fees = await client.cex.fee(exchange="binance", symbol="BTC-USDT")
29+
async def main():
30+
async with AsyncDatamaxi(api_key="YOUR_API_KEY") as client:
31+
exchanges = await client.cex.fee.exchanges()
32+
symbols = await client.cex.fee.symbols(exchange="binance")
3333

34+
fees = await client.cex.fee(exchange="binance", symbol="BTC-USDT")
3435

35-
asyncio.run(main())
36-
```
36+
37+
asyncio.run(main())
38+
```
39+
40+
</details>
3741

3842
## Notes
3943

0 commit comments

Comments
 (0)