{"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-350519821", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 350519821, "node_id": "MDEyOklzc3VlQ29tbWVudDM1MDUxOTgyMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-10T02:08:45Z", "updated_at": "2017-12-10T02:08:45Z", "author_association": "OWNER", "body": "Also worth mentioning: as of #160 and #157 the `datasette publish now`, `datasette publish heroku` and `datasette package` commands all know how to bundle up any `--static` or `--template-dir` content and include it in the Docker image / Heroku/Now deployment that gets generated.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-350519736", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 350519736, "node_id": "MDEyOklzc3VlQ29tbWVudDM1MDUxOTczNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-10T02:06:01Z", "updated_at": "2017-12-10T02:06:01Z", "author_association": "OWNER", "body": "@ftrain Datasette 0.14 is now released with all of the above: https://github.com/simonw/datasette/releases/tag/0.14", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-349874052", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 349874052, "node_id": "MDEyOklzc3VlQ29tbWVudDM0OTg3NDA1Mg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-12-07T06:17:33Z", "updated_at": "2017-12-07T06:17:33Z", "author_association": "OWNER", "body": "In #159 I added a mechanism for easily customizing per-column displays, and I've added documentation showing an example of using this mechanism to set certain columns to display as unescaped HTML: http://datasette.readthedocs.io/en/latest/custom_templates.html#custom-templates\r\n\r\nThis fixes item 3, so I'm closing this ticket!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-348255925", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 348255925, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODI1NTkyNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-30T17:12:03Z", "updated_at": "2017-11-30T17:12:03Z", "author_association": "OWNER", "body": "Documentation is now live for this: http://datasette.readthedocs.io/en/latest/custom_templates.html", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-348252037", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 348252037, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODI1MjAzNw==", "user": {"value": 20264, "label": "ftrain"}, "created_at": "2017-11-30T16:59:00Z", "updated_at": "2017-11-30T16:59:00Z", "author_association": "NONE", "body": "WOW!\n\n--\nPaul Ford // (646) 369-7128 // @ftrain\n\nOn Thu, Nov 30, 2017 at 11:47 AM, Simon Willison \nwrote:\n\n> Remaining work on this now lives in a milestone:\n> https://github.com/simonw/datasette/milestone/6\n>\n> \u2014\n> You are receiving this because you were mentioned.\n> Reply to this email directly, view it on GitHub\n> ,\n> or mute the thread\n> \n> .\n>\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-348248406", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 348248406, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODI0ODQwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-30T16:47:45Z", "updated_at": "2017-11-30T16:47:45Z", "author_association": "OWNER", "body": "Remaining work on this now lives in a milestone: https://github.com/simonw/datasette/milestone/6", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-348245843", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 348245843, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODI0NTg0Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-30T16:40:02Z", "updated_at": "2017-11-30T16:40:02Z", "author_association": "OWNER", "body": "It is now possible to over-ride templates on a per-database / per-row or per-\r\ntable basis.\r\n\r\nWhen you access e.g. `/mydatabase/mytable` Datasette will look for the following:\r\n\r\n - table-mydatabase-mytable.html\r\n - table.html\r\n\r\nIf you provided a `--template-dir` argument to datasette serve it will look in\r\nthat directory first.\r\n\r\nThe lookup rules are as follows:\r\n\r\n Index page (/):\r\n index.html\r\n\r\n Database page (/mydatabase):\r\n database-mydatabase.html\r\n database.html\r\n\r\n Table page (/mydatabase/mytable):\r\n table-mydatabase-mytable.html\r\n table.html\r\n\r\n Row page (/mydatabase/mytable/id):\r\n row-mydatabase-mytable.html\r\n row.html\r\n\r\nIf a table name has spaces or other unexpected characters in it, the template\r\nfilename will follow the same rules as our custom `` CSS classes\r\nintroduced in 8ab3a16 - for example, a table called \"Food Trucks\"\r\nwill attempt to load the following templates:\r\n\r\n table-mydatabase-Food-Trucks-399138.html\r\n table.html\r\n\r\nIt is possible to extend the default templates using Jinja template\r\ninheritance. If you want to customize EVERY row template with some additional\r\ncontent you can do so by creating a `row.html` template like this:\r\n\r\n {% extends \"default:row.html\" %}\r\n\r\n {% block content %}\r\n

EXTRA HTML AT THE TOP OF THE CONTENT BLOCK

\r\n

This line renders the original block:

\r\n {{ super() }}\r\n {% endblock %}\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-348103270", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 348103270, "node_id": "MDEyOklzc3VlQ29tbWVudDM0ODEwMzI3MA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-30T07:16:40Z", "updated_at": "2017-11-30T07:16:40Z", "author_association": "OWNER", "body": "Every template now gets CSS classes in the body designed to support custom\r\nstyling.\r\n\r\nThe index template (the top level page at /) gets this:\r\n\r\n \r\n\r\nThe database template (/dbname/) gets this:\r\n\r\n \r\n\r\nThe table template (/dbname/tablename) gets:\r\n\r\n \r\n\r\nThe row template (/dbname/tablename/rowid) gets:\r\n\r\n \r\n\r\nThe db-x and table-x classes use the database or table names themselves IF\r\nthey are valid CSS identifiers. If they aren't, we strip any invalid\r\ncharacters out and append a 6 character md5 digest of the original name, in\r\norder to ensure that multiple tables which resolve to the same stripped\r\ncharacter version still have different CSS classes.\r\n\r\nSome examples (extracted from the unit tests):\r\n\r\n \"simple\" => \"simple\"\r\n \"MixedCase\" => \"MixedCase\"\r\n \"-no-leading-hyphens\" => \"no-leading-hyphens-65bea6\"\r\n \"_no-leading-underscores\" => \"no-leading-underscores-b921bc\"\r\n \"no spaces\" => \"no-spaces-7088d7\"\r\n \"-\" => \"336d5e\"\r\n \"no $ characters\" => \"no--characters-59e024\"\r\n", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-347928926", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 347928926, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NzkyODkyNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-29T17:09:40Z", "updated_at": "2017-11-29T17:09:40Z", "author_association": "OWNER", "body": "OK, that's point 1 covered.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-347735598", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 347735598, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NzczNTU5OA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-29T02:46:31Z", "updated_at": "2017-11-29T02:47:27Z", "author_association": "OWNER", "body": "To style individual columns you'll currently need to use the `nth-of-type` selector, e.g.:\r\n\r\n td:nth-of-type(5):before { white-space: pre }", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-347735724", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 347735724, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NzczNTcyNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-29T02:47:14Z", "updated_at": "2017-11-29T02:47:14Z", "author_association": "OWNER", "body": "(This only addresses point 2 in your issue description - points 1 and point 3 are still to come)", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-347735334", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 347735334, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NzczNTMzNA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-29T02:45:03Z", "updated_at": "2017-11-29T02:45:03Z", "author_association": "OWNER", "body": "@ftrain OK I've shipped the first version of this. Here's the initial documentation:\r\n\r\nCreate a `metadata.json` file that looks like this:\r\n\r\n {\r\n \"extra_css_urls\": [\r\n \"https://simonwillison.net/static/css/all.bf8cd891642c.css\"\r\n ],\r\n \"extra_js_urls\": [\r\n \"https://code.jquery.com/jquery-3.2.1.slim.min.js\"\r\n ]\r\n }\r\n\r\nThen start datasette like this:\r\n\r\n datasette mydb.db --metadata=metadata.json\r\n\r\nThe CSS and JavaScript files will be linked in the `` of every page.\r\n\r\nYou can also specify a SRI (subresource integrity hash) for these assets:\r\n\r\n {\r\n \"extra_css_urls\": [\r\n {\r\n \"url\": \"https://simonwillison.net/static/css/all.bf8cd891642c.css\",\r\n \"sri\": \"sha384-9qIZekWUyjCyDIf2YK1FRoKiPJq4PHt6tp/ulnuuyRBvazd0hG7pWbE99zvwSznI\"\r\n }\r\n ],\r\n \"extra_js_urls\": [\r\n {\r\n \"url\": \"https://code.jquery.com/jquery-3.2.1.slim.min.js\",\r\n \"sri\": \"sha256-k2WSCIexGzOj3Euiig+TlR8gA0EmPjuc79OEeY5L45g=\"\r\n }\r\n ]\r\n }\r\n\r\nModern browsers will only execute the stylsheet or JavaScript if the SRI hash\r\nmatches the content served. You can generate hashes using www.srihash.org\r\n\r\nThis isn't shipped in a release yet, but you can still access these features in `datasette publish` like so:\r\n\r\n datasette publish now mydb.db --metadata=metadata.json --branch=master\r\n\r\nThe `--branch=master` option will pull the latest master build of Datasette from GitHub.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-347051331", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 347051331, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NzA1MTMzMQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-27T00:23:40Z", "updated_at": "2017-11-27T03:58:49Z", "author_association": "OWNER", "body": "One quick fix could be to add a `extra_css_url` key to the `metadata.json` format (which currently hosts `title`, `license_url` etc) - if populated, we can inject a link to that stylesheet on every page. We could add a few classes in strategic places that include the database and table names to give people styling hooks.\r\n\r\nWhile we're at it, an `extra_js_url` key would let people go really nuts!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/153#issuecomment-347050235", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/153", "id": 347050235, "node_id": "MDEyOklzc3VlQ29tbWVudDM0NzA1MDIzNQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2017-11-27T00:06:24Z", "updated_at": "2017-11-27T00:06:24Z", "author_association": "OWNER", "body": "I've been thinking about 1. a bit - I actually think it would be fine to have a rule that says \"if the contents of the cell starts with `http://` or `https://` and doesn't contain any whitespace, turn that into a link\". If you need the non-linked version that will always be available in the JSON.\r\n\r\nFor the other two... I think #12 may be the way to go here: if you can easily over-ride the `row.html` and `table.html` templates for specific databases you can easily set pre-formatted text or similar for certain values - maybe even with CSS that targets a specific table column.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 276842536, "label": "Ability to customize presentation of specific columns in HTML view"}, "performed_via_github_app": null}