#1179·datasette

Make original path available to render hooks

Author: simonwCreated Jan 6, 2021Updated Sep 17, 2026
Labelssmallplugins

https://github.com/simonw/datasette-export-notebook/blob/0.1/datasette_export_notebook/__init__.py

python
async def render_notebook(datasette, request):
    return Response.html(
        await datasette.render_template(
            "export_notebook.html",
            {
                "csv_stream_url": datasette.absolute_url(
                    request,
                    path_with_format(
                        request=request, format="csv", extra_qs={"_stream": "on"}
                    ),
                ),
                "json_url": datasette.absolute_url(
                    request,
                    path_with_format(
                        request=request, format="json", extra_qs={"_shape": "array"}
                    ),
                ),
                "json": json,
            },
        )
    )

This results in https://latest-with-plugins.datasette.io/github/issue_comments.Notebook showing http://latest-with-plugins.datasette.io/github/issue_comments.Notebook?_format=json&_shape=array