Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Plugin includes #1204

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

WIP: Plugin includes #1204

wants to merge 2 commits into from

Conversation

simonw
Copy link
Owner

@simonw simonw commented Jan 25, 2021

Refs #1191

Next steps:

  • Get comfortable that this pattern is the right way to go
  • Implement it for all of the other pages, not just the table page
  • Add a new set of plugin tests that exercise ALL of these new hook locations
  • Document, then ship

@simonw
Copy link
Owner Author

simonw commented Jan 25, 2021

Writing the tests will be a bit tricky since we need to confirm that the include_table_top(datasette, database, actor, table) arguments were all passed correctly but the only thing we get back from the plugin is a list of templates. Maybe encode those values into the template names somehow?

@20after4
Copy link

Writing the tests will be a bit tricky since we need to confirm that the include_table_top(datasette, database, actor, table) arguments were all passed correctly but the only thing we get back from the plugin is a list of templates. Maybe encode those values into the template names somehow?

Why not return a data structure instead of just a template name?

I've already done some custom hacking to modify datasette but the plugin mechanism you are building here would be much cleaner than what I've built. I'd be happy to help with testing this PR and fleshing it out further if you are still considering merging this.

@simonw
Copy link
Owner Author

simonw commented Dec 17, 2021

I think this is missing the _macro.html template file but I have that in my Dropbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants