qmd-lab / closeread

https://closeread.dev
MIT License
127 stars 5 forks source link

Consider changing closeread from a custom format to a filter #93

Closed andrewpbray closed 1 month ago

andrewpbray commented 2 months ago

This would allow users to develop their own closeread templates.

jimjam-slam commented 2 months ago

The only real work doing this, I think, is in inlining the core CSS straight into the HTML page!

andrewpbray commented 1 month ago

What are your thoughts on this?

https://github.com/quarto-dev/quarto-cli/discussions/10789

That suggests that there is a decent workflow for someone to make a custom format out of closeread-html even if we structure it as a custom format.

jimjam-slam commented 1 month ago

Yeah, I've been thinking on this! I don't love that workflow, tbh, because it places the onus on the user to stitch the fields from all the relevant extensions together, ensure extension paths resolve properly, etc.

If we can continue to contain Closeread to a single filter (since we use the Quarto Pandoc API to add the JS during the filter and could potentially inline the CSS using the filter), I feel like filters are far more composable than custom formats. I'm not married to it, though!

jimjam-slam commented 1 month ago

Discussed pros and cons of switching from a custom format to just a filter:

Pros:

Cons:

jimjam-slam commented 1 month ago

Left as a format for now, but might review in the future!