github
html_url | issue_url | id | node_id | user | created_at | updated_at | author_association | body | reactions | issue | performed_via_github_app |
---|---|---|---|---|---|---|---|---|---|---|---|
https://github.com/simonw/datasette/issues/1274#issuecomment-805214307 | https://api.github.com/repos/simonw/datasette/issues/1274 | 805214307 | MDEyOklzc3VlQ29tbWVudDgwNTIxNDMwNw== | 7476523 | 2021-03-23T20:12:29Z | 2021-03-23T20:12:29Z | CONTRIBUTOR | One issue I could see with adding first class support for metadata in hjson format is that this would require adding an additional dependency to handle this, for a feature that would be unused by many users. I wonder if this could fit in as a plugin instead; if a hook existed for loading metadata (maybe as part of https://github.com/simonw/datasette/issues/860) the metadata could then come from any source, as specified by plugins, e.g. hjson, toml, XML, a database table etc. Until/unless this exists, a few ideas for how you could add comments: - Using YAML as you suggest. - A common pattern is adding a `"comment"` key for comments to any object in JSON - I don't think including an unnecessary key like this would break anything in Datasette, but not certain. - You could use another tool as a preprocessor for your JSON metadata - e.g. hjson or Jsonnet. You'd write the metadata in that format, and then convert that into JSON to actually use as your final metadata. | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
839008371 | |
https://github.com/simonw/datasette/issues/1153#issuecomment-805109341 | https://api.github.com/repos/simonw/datasette/issues/1153 | 805109341 | MDEyOklzc3VlQ29tbWVudDgwNTEwOTM0MQ== | 9599 | 2021-03-23T17:55:48Z | 2021-03-23T18:41:57Z | OWNER | Beginnings of a UI element for switching between them: ```html <div style="border: 1px solid rgb(225, 228, 229); background-color: rgb(238, 255, 204); padding: 0.3em; position: relative; top: 3px; font-family: courier;"> <a href="#" style="display: inline-block; padding-left: 0px; padding-right: 2em;">JSON</a> <a href="#" style="display: inline-block;">YAML</a> </div> ``` <img width="646" alt="Metadata_—_Datasette_documentation" src="https://user-images.githubusercontent.com/9599/112194637-51f92500-8bc6-11eb-9662-3faa7ef37538.png"> That `<pre>` has a padding of 12px, so using 12px padding on the tab links should get them to line up better. | { "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
771202454 |