Skip to content

Ability for plugins to define extra JavaScript and CSS #214

@simonw

Description

@simonw

This can hook in to the existing extra_css_urls and extra_js_urls mechanism:

datasette/datasette/app.py

Lines 304 to 305 in b2955d9

'extra_css_urls': self.ds.extra_css_urls(),
'extra_js_urls': self.ds.extra_js_urls(),

The plugins should be able to bundle their own assets though, so it will also have to integrate with the /static/ static mounts mechanism somehow:

datasette/datasette/app.py

Lines 1255 to 1257 in b2955d9

app.static('/-/static/', str(app_root / 'datasette' / 'static'))
for path, dirname in self.static_mounts:
app.static(path, dirname)

Refs #14

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions