Sphinx + Shibuya Docs Workflow
Overview
Use this skill to design or rework Sphinx documentation that uses the Shibuya theme. Focus on clean structure, short pages, and Shibuya-friendly directives.
Workflow
1) Discover current structure
- Read
docs/conf.pyfor enabled extensions and theme config. - Scan
docs/index.rstand top-level section indexes for current toctree structure. - Locate custom extensions in
tools/sphinx_ext/and reuse them before adding new ones. - Prefer
docs/examples/+literalincludepatterns for code snippets.
2) Structure for short pages
- Split long guides into per-topic pages using a section
index.rstwith a hidden toctree. - Keep each page scoped to one concept or workflow; link out to examples and reference pages.
- Prefer list tables or grid cards for navigation hubs.
Example Shibuya grid card hub (use with sphinx-design):
.. grid:: 1 1 2 4
:gutter: 2
:padding: 0
.. grid-item-card:: Litestar
:link: frameworks/litestar
:link-type: doc
.. image:: /_static/logos/litestar.svg
:width: 72
:align: center
:alt: Litestar
3) Shibuya-compatible extensions to consider
Use only what the docs actually need, but favor these Shibuya-friendly extensions:
sphinx_designfor grids, cards, and layout components.sphinx_iconifyfor icon usage.sphinx_docsearchfor Algolia DocSearch UI.sphinx_tabs.tabsfor tabbed content.sphinx_togglebuttonfor collapsible sections.sphinx_datatablesfor data tables where sorting/searching helps.sphinx_copybutton,sphinx_paramlinks,sphinxcontrib.mermaidas needed.
4) Code samples
- Use
literalincludewith# start-example/# end-examplemarkers. - Keep examples short and runnable with
pytestwhere possible. - Prefer language-specific highlights (
:language: python,:language: sql).
5) Validation
- Run
make docsand address warnings. - If auto-generated API docs are present, keep them excluded from the main toctree unless explicitly linked.
Project conventions (SQLSpec)
- Prefer examples in
docs/examples/and reference them withliteralinclude. - Keep pages short, avoid heavy emoji usage, and favor neutral tone.
- Use custom directives from
tools/sphinx_ext/when available (e.g., playground/changelog helpers).
Official References
- https://shibuya.lepture.com/
- https://shibuya.lepture.com/changelog/
- https://www.sphinx-doc.org/en/master/
- https://sphinx-design.readthedocs.io/en/latest/
- https://sphinx-docsearch.readthedocs.io/
- https://sharm294.github.io/sphinx-datatables/
Shared Styleguide Baseline
- Use shared styleguides for generic language/framework rules to reduce duplication in this skill.
- General Principles
- Keep this skill focused on tool-specific workflows, edge cases, and integration details.
Scan to join WeChat group