Skip to content

Move table configuration docs from metadata.rst to configuration.rst#2668

Merged
simonw merged 9 commits intomainfrom
claude/document-table-config-7cUsG
Mar 17, 2026
Merged

Move table configuration docs from metadata.rst to configuration.rst#2668
simonw merged 9 commits intomainfrom
claude/document-table-config-7cUsG

Conversation

@simonw
Copy link
Owner

@simonw simonw commented Mar 17, 2026

Where are all of the various table config things like sort and sort_desc and suchlike documented?

Propose a better place for that documentation

But first, pull in latest changes from main since those have even more table/column config settings

Yes, do it - I want metadata.rst to have very little table configuration in it (aside from a link to the new section)

This PR reorganizes the documentation to consolidate table-level configuration options into a dedicated section in the configuration reference, improving documentation structure and maintainability.

Summary

Table configuration documentation has been moved from docs/metadata.rst to a new "Table configuration" section in docs/configuration.rst. This change reflects the fact that these options are now primarily configured via datasette.yaml while maintaining backwards compatibility with metadata files.

Key Changes

  • New section in configuration.rst: Added comprehensive "Table configuration" section documenting all table-level configuration options:

    • sort / sort_desc - default sort order
    • size - rows per page
    • sortable_columns - which columns allow sorting
    • label_column - foreign key display labels
    • hidden - hide tables from listing
    • facets / facet_size - facet configuration
    • fts_table / fts_pk / searchmode - full-text search
    • columns - column descriptions
    • column_types - semantic column type assignments
  • Updated metadata.rst: Replaced detailed table configuration documentation with a brief reference pointing to the configuration.rst section, noting backwards compatibility with metadata files

  • Updated cross-references: Fixed documentation links throughout:

    • docs/facets.rst - updated reference to table configuration
    • docs/full_text_search.rst - updated reference to table configuration
    • docs/json_api.rst - updated label_column reference
    • docs/pages.rst - updated hidden tables reference
    • docs/internals.rst - updated label_column reference

Implementation Details

  • All configuration examples are provided in both YAML and JSON formats using the existing documentation tooling
  • A note clarifies that options can be specified in either datasette.yaml or metadata files, with datasette.yaml taking priority
  • Maintains all existing anchor references for backwards compatibility with external links

https://claude.ai/code/session_01UqboRB5Wt52BKPhxexUBEn


📚 Documentation preview 📚: https://datasette--2668.org.readthedocs.build/en/2668/

Move table configuration documentation (sort, sort_desc, size,
sortable_columns, label_column, hidden, facets, facet_size, fts_table,
fts_pk, searchmode, columns, column_types) from metadata.rst into a new
"Table configuration" section in configuration.rst, which is the
canonical reference for datasette.yaml.

metadata.rst now has a brief section pointing to the new location.
Cross-references in facets.rst, full_text_search.rst, internals.rst,
json_api.rst, and pages.rst updated to point to new anchors. Old anchor
names preserved as aliases so existing links continue to work.

https://claude.ai/code/session_01UqboRB5Wt52BKPhxexUBEn
@simonw
Copy link
Owner Author

simonw commented Mar 17, 2026

@simonw
Copy link
Owner Author

simonw commented Mar 17, 2026


.. _metadata_default_sort:

.. _table_configuration_sort:

``sort`` / ``sort_desc``

I don't like having _metadata_default_sort labels there - I do not want any of †he headings to have multiple labels. All labels in this section should be _table_configuration_x labels. If this means there is no more _metadata_x label that's fine, update any existing internal links to point to the new table configuration one instead.

claude added 6 commits March 17, 2026 15:36
Each heading now has only one label using the table_configuration_*
naming convention. Updated all :ref: links in changelog.rst to use
the new anchor names.

https://claude.ai/code/session_01UqboRB5Wt52BKPhxexUBEn
The auto-detection checks for: (1) a single unique text column,
(2) a column named "name" or "title", (3) a two-column table with
one primary key column - not just the two-column case.

https://claude.ai/code/session_01UqboRB5Wt52BKPhxexUBEn
These table configuration examples were showing metadata.yaml/json tabs
but should show datasette.yaml/json since they are configuration, not
metadata. Also updated prose references from "metadata" to
"configuration" in facets.rst.

https://claude.ai/code/session_01UqboRB5Wt52BKPhxexUBEn
Column descriptions are metadata (stored via set_column_metadata), not
table configuration. Moved the columns section back to metadata.rst and
removed it from configuration.rst. Also added a :ref: link from the
column_types docs to the register_column_types plugin hook.

https://claude.ai/code/session_01UqboRB5Wt52BKPhxexUBEn
@simonw simonw merged commit 63d73a8 into main Mar 17, 2026
37 checks passed
@simonw simonw deleted the claude/document-table-config-7cUsG branch March 17, 2026 15:47
@codecov
Copy link

codecov bot commented Mar 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.56%. Comparing base (bc7a19b) to head (2eb7c7f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2668   +/-   ##
=======================================
  Coverage   90.56%   90.56%           
=======================================
  Files          55       55           
  Lines        8308     8308           
=======================================
  Hits         7524     7524           
  Misses        784      784           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants