simonw/datasette-lite

Referencing metadata.json from the url

pax opened this issue · 4 comments

pax commented

Is it possible to load a custom metadata.json? If so, how to call it from the url?

*I was curious to see if Datasette Dashboards works with Datasette Lite.

My use-case is to organize workshop to discover the Datasette ecosystem and not wanting to battle with Python packaging for inexperienced users. Datasette-Lite is perfect in this context, in the same vein of JupyterLite.

I also think that referencing an URL to metadata.json / metadata.yaml would be wonderful to be able to use plugins that need to be heavily configured (such as datasette-dashboards).

Or, could we have a settings page where we can live update the metadata? (as the app is entirely loaded client-side)

I'm going to see if I can get this working - I have a hunch it should be pretty easy.

Oops, that broke it:

Traceback (most recent call last):
  File "/lib/python3.10/asyncio/futures.py", line 201, in result
    raise self._exception
  File "/lib/python3.10/asyncio/tasks.py", line 232, in __step
    result = coro.send(None)
  File "/lib/python3.10/site-packages/_pyodide/_base.py", line 500, in eval_code_async
    await CodeRunner(
  File "/lib/python3.10/site-packages/_pyodide/_base.py", line 353, in run_async
    await coroutine
  File "<exec>", line 37, in <module>
NameError: name 'null' is not defined

Here's a very simple demo, using a metadata.yml file at https://gist.github.com/simonw/a7d246bcbe93db7a7f6f5c1bf5c0ea48

title: Datasette Lite Metadata Demo
about_url: https://gist.github.com/
about: Gist

https://lite.datasette.io/?metadata=https://gist.github.com/simonw/a7d246bcbe93db7a7f6f5c1bf5c0ea48

image