{"sha": "3cd06729f457d690603b6060dc552b535517ab09", "message": "Ability to over-ride templates for individual tables/databases\n\nIt is now possible to over-ride templates on a per-database / per-row or per-\ntable basis.\n\nWhen you access e.g. /mydatabase/mytable Datasette will look for the following:\n\n - table-mydatabase-mytable.html\n - table.html\n\nIf you provided a --template-dir argument to datasette serve it will look in\nthat directory first.\n\nThe lookup rules are as follows:\n\n Index page (/):\n index.html\n\n Database page (/mydatabase):\n database-mydatabase.html\n database.html\n\n Table page (/mydatabase/mytable):\n table-mydatabase-mytable.html\n table.html\n\n Row page (/mydatabase/mytable/id):\n row-mydatabase-mytable.html\n row.html\n\nIf a table name has spaces or other unexpected characters in it, the template\nfilename will follow the same rules as our custom CSS classes\nintroduced in 8ab3a169d42d096f - for example, a table called \"Food Trucks\"\nwill attempt to load the following templates:\n\n table-mydatabase-Food-Trucks-399138.html\n table.html\n\nIt is possible to extend the default templates using Jinja template\ninheritance. If you want to customize EVERY row template with some additional\ncontent you can do so by creating a row.html template like this:\n\n {% extends \"default:row.html\" %}\n\n {% block content %}\n

EXTRA HTML AT THE TOP OF THE CONTENT BLOCK

\n

This line renders the original block:

\n {{ super() }}\n {% endblock %}\n\nCloses #12, refs #153", "author_date": "2017-11-30T16:30:10Z", "committer_date": "2017-11-30T16:38:16Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}} {"sha": "8ab3a169d42d096f2c7979c6d3d7746618d30f0b", "message": "CSS styling hooks as classes on the body\n\nRefs #153\n\nEvery template now gets CSS classes in the body designed to support custom\nstyling.\n\nThe index template (the top level page at /) gets this:\n\n \n\nThe database template (/dbname/) gets this:\n\n \n\nThe table template (/dbname/tablename) gets:\n\n \n\nThe row template (/dbname/tablename/rowid) gets:\n\n \n\nThe db-x and table-x classes use the database or table names themselves IF\nthey are valid CSS identifiers. If they aren't, we strip any invalid\ncharacters out and append a 6 character md5 digest of the original name, in\norder to ensure that multiple tables which resolve to the same stripped\ncharacter version still have different CSS classes.\n\nSome examples (extracted from the unit tests):\n\n \"simple\" => \"simple\"\n \"MixedCase\" => \"MixedCase\"\n \"-no-leading-hyphens\" => \"no-leading-hyphens-65bea6\"\n \"_no-leading-underscores\" => \"no-leading-underscores-b921bc\"\n \"no spaces\" => \"no-spaces-7088d7\"\n \"-\" => \"336d5e\"\n \"no $ characters\" => \"no--characters-59e024\"", "author_date": "2017-11-30T07:09:54Z", "committer_date": "2017-11-30T07:09:54Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}} {"sha": "601934936c9e6e0007aca13547b73c3b36343f7f", "message": "Documentation for custom CSS/JavaScript/Templates\n\nWill go live at http://datasette.readthedocs.io/en/latest/custom_templates.html\n\nCloses #156", "author_date": "2017-11-30T17:09:48Z", "committer_date": "2017-11-30T17:09:48Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}} {"sha": "1feb5735dad538312fac8b76705c05516250967b", "message": "Moved getting started into separate docs page", "author_date": "2017-11-30T18:27:00Z", "committer_date": "2017-11-30T18:27:00Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}} {"sha": "ffa77f62b46e1ddf2f848f5da10a1e958323a084", "message": "Removed dependency on sanic-jinja2\n\nI wasn't using any of the functionality it adds on top of raw Jinja2.\n\nRefs #12 and #153", "author_date": "2017-11-30T15:51:40Z", "committer_date": "2017-11-30T15:51:40Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}} {"sha": "cf46b86cf736aadd5147f85bfd6ff44c29655fde", "message": "Switch to sphinx_rtd_theme", "author_date": "2017-11-30T16:56:20Z", "committer_date": "2017-11-30T16:56:20Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}} {"sha": "7ff51598c468deb1d2c0d4c23a808458c9b1e3a2", "message": "git commit -m \"datasette --template-dir=mytemplates/\" argument\n\nYou can now pass an additional argument specifying a directory to look for\ncustom templates in.\n\nDatasette will fall back on the default templates if a template is not\nfound in that directory.\n\nRefs #12, #153", "author_date": "2017-11-30T16:05:01Z", "committer_date": "2017-11-30T16:05:01Z", "raw_author": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "raw_committer": {"value": "13ae486343ea6454a93114c6f558ffea2f2c6874", "label": "Simon Willison"}, "repo": {"value": 107914493, "label": "datasette"}, "author": {"value": 9599, "label": "simonw"}, "committer": {"value": 9599, "label": "simonw"}}