mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Column metadata, closes #942
This commit is contained in:
parent
b1fed48a95
commit
e837095ef3
8 changed files with 88 additions and 2 deletions
|
|
@ -78,6 +78,34 @@ The three visible metadata fields you can apply to everything, specific database
|
|||
|
||||
For each of these you can provide just the ``*_url`` field and Datasette will treat that as the default link label text and display the URL directly on the page.
|
||||
|
||||
.. _metadata_column_descriptions:
|
||||
|
||||
Column descriptions
|
||||
-------------------
|
||||
|
||||
You can include descriptions for your columns by adding a ``"columns": {"name-of-column": "description-of-column"}`` block to your table metadata:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"databases": {
|
||||
"database1": {
|
||||
"tables": {
|
||||
"example_table": {
|
||||
"columns": {
|
||||
"column1": "Description of column 1",
|
||||
"column2": "Description of column 2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
These will be displayed at the top of the table page, and will also show in the cog menu for each column.
|
||||
|
||||
You can see an example of how these look at `latest.datasette.io/fixtures/roadside_attractions <https://latest.datasette.io/fixtures/roadside_attractions>`__.
|
||||
|
||||
Specifying units for a column
|
||||
-----------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue