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

render_cell(value) plugin hook #352

Closed
simonw opened this issue Jul 30, 2018 · 4 comments
Closed

render_cell(value) plugin hook #352

simonw opened this issue Jul 30, 2018 · 4 comments
Labels

Comments

@simonw
Copy link
Owner

@simonw simonw commented Jul 30, 2018

To allow plugins to customize how values matching a specific pattern are displayed in the HTML table view.

@simonw
Copy link
Owner Author

@simonw simonw commented Aug 1, 2018

The hook is currently only used on the custom SQL results page - it needs to run on table/view pages as well.

simonw added a commit that referenced this issue Aug 5, 2018
@simonw simonw closed this in #353 Aug 5, 2018
simonw added a commit that referenced this issue Aug 5, 2018
New plugin hook for customizing the way cells values are rendered in HTML.

The first full example of this hook in use is https://github.com/simonw/datasette-json-html
@simonw simonw added this to the Next release milestone Aug 5, 2018
@simonw
Copy link
Owner Author

@simonw simonw commented Aug 6, 2018

@xrotwang
Copy link

@xrotwang xrotwang commented Feb 10, 2020

I don't want to re-open this issue, but I'm wondering whether it would be possible to include the full row for which a specific cell is to be rendered in the hook signature. My use case are rows where custom rendering would need access to multiple values (specifically, rows containing the constituents of interlinear glossed text (IGT) in separate columns, see https://github.com/cldf/cldf/tree/master/components/examples).

I could probably cobble this together with custom SQL and the sql-to-html plugin. But having a full row within a render_cell implementation seems a lot simpler.

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

Successfully merging a pull request may close this issue.

None yet
2 participants