Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve cookbook Sphinx tag #2082

Open
lidavidm opened this issue Aug 19, 2024 · 2 comments
Open

docs: improve cookbook Sphinx tag #2082

lidavidm opened this issue Aug 19, 2024 · 2 comments
Labels
Type: enhancement New feature or request

Comments

@lidavidm
Copy link
Member

lidavidm commented Aug 19, 2024

  • Add an index of all recipes
  • Add an ID to each recipe that can be linked to
  • Add title/short description/driver/tags to each recipe for the index's use (e.g. we can generate index pages for each language and tag and driver). Prior art: sphinx-tags
  • Highlight the cookbook examples more strongly on the home page
    • e.g. link directly to language or driver examples
    • add a carousel showcasing some common tasks

Strawman:

# --- RECIPE ---
# title: "Use ADBC PostgreSQL with SQLAlchemy"
# tags: [postgresql, sqlalchemy]
# description: Build queries with SQLAlchemy, then submit them via ADBC.
# --- RECIPE ---

import ...

the syntax isn't too big a deal, so long as we pick something that's recognizable but still valid Python

@lidavidm lidavidm added the Type: enhancement New feature or request label Aug 19, 2024
@lidavidm
Copy link
Member Author

lidavidm commented Aug 19, 2024

I am leaning towards "YAML frontmatter" though just because it is easily parseable. Though perhaps even better would be a docstring

"""
Build queries with SQLAlchemy, then submit them via ADBC.

Categories
----------
postgresql, sqlalchemy
"""

A separate title seems redundant as well here

It seems possible we could abuse the numpydoc parser: https://github.com/numpy/numpydoc/blob/main/numpydoc/docscrape.py

@lidavidm
Copy link
Member Author

lidavidm commented Aug 20, 2024

Another thing we could do:

  • Index all recipes based on scanning .py files in the source tree
  • Provide directives to insert particular recipes or list all recipes based on tags

This wouldn't quite integrate as well with the (rudimentary) incremental-build support in Sphinx though. So maybe a domain with custom indices is the right way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant