Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
01015a2
docs: add Markdown code fences to docstrings
lukegalbraithrussell Aug 13, 2026
67812bc
docs: migrate API reference from HTML (pdoc3) to Markdown (pydoc-mark…
lukegalbraithrussell Aug 13, 2026
2266bf2
docs: serve package reference pages at folder URLs
lukegalbraithrussell Aug 13, 2026
23874b0
move to be within english
lukegalbraithrussell Aug 13, 2026
de6d47e
docs: fence App.start() example and target docs/english/reference
lukegalbraithrussell Aug 13, 2026
51128e2
docs: embed reference tree into _sidebar.json
lukegalbraithrussell Aug 13, 2026
c6960fc
go
lukegalbraithrussell Aug 14, 2026
2b95612
go
lukegalbraithrussell Aug 14, 2026
44bafeb
colliding paths fix
lukegalbraithrussell Aug 14, 2026
da71715
go
lukegalbraithrussell Aug 14, 2026
7bf50da
go
lukegalbraithrussell Aug 14, 2026
ab7e690
go
lukegalbraithrussell Aug 14, 2026
24fe29c
go
lukegalbraithrussell Aug 14, 2026
07ba452
toc
lukegalbraithrussell Aug 18, 2026
abe7dd9
docstrings
lukegalbraithrussell Aug 18, 2026
0669cbd
toggles
lukegalbraithrussell Aug 18, 2026
490dbde
griffe
lukegalbraithrussell Aug 20, 2026
ccfe23e
working
lukegalbraithrussell Aug 20, 2026
3b07a17
streamline
lukegalbraithrussell Aug 20, 2026
0e8f943
go
lukegalbraithrussell Aug 20, 2026
608fc38
cleanup
lukegalbraithrussell Aug 20, 2026
f8c6b89
fencing
lukegalbraithrussell Aug 20, 2026
9cdcc00
gen reference sidebar
lukegalbraithrussell Aug 25, 2026
6353313
go
lukegalbraithrussell Aug 26, 2026
eef36ac
Merge main: adopt Ruff + docstring formatting from #1566/#1567
lukegalbraithrussell Aug 28, 2026
4ff3e0f
Md reference griffe (#1569)
lukegalbraithrussell Sep 1, 2026
ff4a9f2
Merge branch 'main' into md-reference
lukegalbraithrussell Sep 3, 2026
fae307f
consolidate and tests
lukegalbraithrussell Sep 4, 2026
d910487
ci idea
lukegalbraithrussell Sep 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
go
  • Loading branch information
lukegalbraithrussell committed Aug 14, 2026
commit 2b95612db3bf4b745d2cd6da0ef1c24637b80dfd
18 changes: 10 additions & 8 deletions docs/english/reference/slack_bolt/adapter/asgi/aiohttp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1067,14 +1067,16 @@ This can be used for production deployment.
With the default settings, `http://localhost:3000/slack/events`
Run Bolt with [uvicron](https://www.uvicorn.org/)

# Python
app = AsyncApp()
api = SlackRequestHandler(app)

# bash
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
uvicorn app:api --port 3000 --log-level debug
```python
# Python
app = AsyncApp()
api = SlackRequestHandler(app)

# bash
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
uvicorn app:api --port 3000 --log-level debug
```

**Arguments**:

Expand Down
18 changes: 10 additions & 8 deletions docs/english/reference/slack_bolt/adapter/asgi/async_handler.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,16 @@ This can be used for production deployment.
With the default settings, `http://localhost:3000/slack/events`
Run Bolt with [uvicron](https://www.uvicorn.org/)

# Python
app = AsyncApp()
api = SlackRequestHandler(app)

# bash
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
uvicorn app:api --port 3000 --log-level debug
```python
# Python
app = AsyncApp()
api = SlackRequestHandler(app)

# bash
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
uvicorn app:api --port 3000 --log-level debug
```

**Arguments**:

Expand Down
47 changes: 47 additions & 0 deletions scripts/generate_api_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ def main():
session.process(modules)
session.render(modules)
_rename_package_indexes()
_check_mdx_hazards()
_finalize_reference_sidebar()
_strip_reference_from_site_sidebar()

Expand Down Expand Up @@ -305,6 +306,52 @@ def rewrite(node):
print("Renamed {} package __init__.md files to index.md".format(renamed))


# Docusaurus v3 parses every .md file as MDX, so a line that begins (at column
# zero, outside a code fence) with `export`/`import` is read as an ESM statement
# and a bare `<` as JSX -- either aborts the docs-site build with an opaque acorn
# error. pydoc-markdown strips docstring indentation, so an *unfenced* shell/py
# example (e.g. `export SLACK_BOT_TOKEN=...`) lands at column zero and trips this.
# The guard below turns that into a loud failure here, pointing at the generated
# file, instead of a cryptic failure later in the docs repo.
_MDX_ESM_RE = re.compile(r"^(export|import)\s")


def _check_mdx_hazards():
"""Fail generation if any rendered Markdown has an MDX/acorn hazard.

Scans every generated .md for lines outside code fences that MDX would try to
parse as JavaScript: leading ``export``/``import`` (ESM) or a leading ``<``
(JSX). These come from unfenced code examples in docstrings; the fix is to
fence the example at its source (see slack_bolt/adapter/asgi/aiohttp for the
canonical pattern)."""
reference_dir = os.path.join(DOCS_BASE_PATH, REFERENCE_SUBDIR)
hazards = []
for dirpath, _dirnames, filenames in os.walk(reference_dir):
for filename in filenames:
if not filename.endswith(".md"):
continue
path = os.path.join(dirpath, filename)
in_codeblock = False
with open(path, encoding="utf-8") as handle:
for lineno, raw in enumerate(handle, 1):
line = raw.rstrip("\n")
if line.lstrip().startswith("```"):
in_codeblock = not in_codeblock
continue
if in_codeblock:
continue
if _MDX_ESM_RE.match(line) or line.startswith("<"):
rel = os.path.relpath(path, DOCS_BASE_PATH)
hazards.append("{}:{}: {}".format(rel, lineno, line))

if hazards:
raise SystemExit(
"MDX/acorn hazards found in generated Markdown (unfenced code at column "
"zero). Fence the offending example in its source docstring:\n " + "\n ".join(hazards)
)
print("No MDX/acorn hazards in generated Markdown")


# The docs site (docs.slack.dev) build imports this generated sidebar.json in
# its sidebars.js and appends it under the "Bolt for Python" nav, so the file
# ships as an import-ready, self-contained "Reference" category. Its doc IDs are
Expand Down
2 changes: 2 additions & 0 deletions slack_bolt/adapter/asgi/aiohttp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def __init__(self, app: AsyncApp, path: str = "/slack/events"):
With the default settings, `http://localhost:3000/slack/events`
Run Bolt with [uvicron](https://www.uvicorn.org/)

```python
# Python
app = AsyncApp()
api = SlackRequestHandler(app)
Expand All @@ -25,6 +26,7 @@ def __init__(self, app: AsyncApp, path: str = "/slack/events"):
export SLACK_SIGNING_SECRET=***
export SLACK_BOT_TOKEN=xoxb-***
uvicorn app:api --port 3000 --log-level debug
```

Args:
app: Your bolt application
Expand Down