Skip to content

Document to_css_class as a supported internal#2856

Open
ColumbusLabs wants to merge 1 commit into
simonw:mainfrom
ColumbusLabs:codex/document-to-css-class
Open

Document to_css_class as a supported internal#2856
ColumbusLabs wants to merge 1 commit into
simonw:mainfrom
ColumbusLabs:codex/document-to-css-class

Conversation

@ColumbusLabs

Copy link
Copy Markdown

What

Document datasette.utils.to_css_class() as a supported internal utility and register it with Datasette's @documented safeguard.

Why

Plugins already use this helper, but it was absent from the documented internals. That left its support status unclear and meant the documentation registry could not protect its API section from accidental removal.

Fixes #1743

Details

  • describes unchanged inputs, ordered normalization, and collision-resistant suffixes
  • includes examples matching the existing behavior tests
  • uses the standard internals_utils_to_css_class anchor and decorator registration

Testing

  • uv run pytest -n auto -m 'not serial' (2269 passed, 40 skipped, 6 xfailed, 15 xpassed)
  • uv run pytest -m serial (36 passed)
  • uv run pytest tests/test_docs.py::test_functions_marked_with_documented_are_documented
  • uv run pytest tests/test_utils.py -k to_css_class
  • warning-as-error Sphinx build
  • Cog, blacken-docs, codespell, Black, and git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

datasette.utils.to_css_class() should be a documented internal

1 participant