Post AXIAdT1XaNQ9YymLxY by mitsuhiko@hachyderm.io
 (DIR) More posts by mitsuhiko@hachyderm.io
 (DIR) Post #AXH4O8mBn27DXVwlpg by simon@fedi.simonwillison.net
       2023-07-02T05:39:14Z
       
       0 likes, 0 repeats
       
       New official Datasette tutorial: Data analysis with SQLite and PythonIncludes a 2hr45m video and a very extensive handout (which should standalone without watching the video) - originally presented at PyCon 2023It provides an introduction to sqlite3 in the Python library, then expands to cover sqlite-utils, Datasette, Datasette Lite and more - plus numerous basic and advanced SQL trickshttps://datasette.io/tutorials/data-analysis
       
 (DIR) Post #AXH4sZFTvkAuKW9nKi by simon@fedi.simonwillison.net
       2023-07-02T05:44:59Z
       
       0 likes, 0 repeats
       
       And a bonus TIL, how I got the syntax highlighting to work for the code examples in that tutorial using datasette-render-markdown and Pygments: https://til.simonwillison.net/datasette/syntax-highlighted-code-examples
       
 (DIR) Post #AXH6BEmiL5GSJnARwe by simon@fedi.simonwillison.net
       2023-07-02T05:59:22Z
       
       0 likes, 0 repeats
       
       Also fun: since I learned how to write custom Jinja tags today, I decided to write a new custom tag to implement the table of contents on this page - code here: https://github.com/simonw/datasette.io/blob/main/plugins/toc_template_tag.py
       
 (DIR) Post #AXHEl5tbfEwgoB04GW by dataschrat@sigmoid.social
       2023-07-02T07:35:23Z
       
       0 likes, 0 repeats
       
       @simon looks great! Thanks for sharing
       
 (DIR) Post #AXHIiZP1txwdGnkYfg by mitsuhiko@hachyderm.io
       2023-07-02T08:19:54Z
       
       0 likes, 0 repeats
       
       @simon for what it’s worth I was always hoping custom tags die out. They are hard to support for alternative implementations and the language is quite expressive that {% call %} and {{ func() }} should work most of the time.
       
 (DIR) Post #AXHo6clU9LzrE7CfHk by simon@fedi.simonwillison.net
       2023-07-02T14:11:50Z
       
       0 likes, 0 repeats
       
       @mitsuhiko I was previously using{{ render_markdown("""# content here""") }}But even though I used triple-quotes I still had to backslash escape single quotation marks, which got frustrating enough that I figured out {% markdown %} instead
       
 (DIR) Post #AXIAdT1XaNQ9YymLxY by mitsuhiko@hachyderm.io
       2023-07-02T18:24:17Z
       
       0 likes, 0 repeats
       
       @simon You can also do `{% call render_markdown() %}# content here{% endcall %}`. The contents are passed as `caller` (a callable).
       
 (DIR) Post #AXIAqr8fEqI47QUlIO by simon@fedi.simonwillison.net
       2023-07-02T18:26:45Z
       
       0 likes, 0 repeats
       
       @mitsuhiko wow I had no idea! Definitely going to try that out
       
 (DIR) Post #AXIB21me09ReJoWSga by simon@fedi.simonwillison.net
       2023-07-02T18:27:52Z
       
       0 likes, 0 repeats
       
       @mitsuhiko any patterns I can use to pass extra arguments to that render_markdown() function?
       
 (DIR) Post #AXIBFFt2sRnLp7p9VY by mitsuhiko@hachyderm.io
       2023-07-02T18:30:08Z
       
       0 likes, 0 repeats
       
       @simon ```def render_markdown(caller=None, **kwargs):    let body = caller()    markdown2html(body, **kwargs)```And then `{% call render_markdown(foo='bar') %}...{% endcall %}`