uwdata / living-papers

Authoring tools for scholarly communication. Create interactive web pages or formal research papers from markdown source.
BSD 3-Clause "New" or "Revised" License
128 stars 10 forks source link

proof-of-concept of alternative snapshot approach #17

Closed mathisonian closed 2 years ago

mathisonian commented 2 years ago

Here's an initial stab of the approach described in #14 to improve image snapshots. Sharing here for visibility / comment.

While I think it makes sense in general, the main concern I have is that, in hiding all of the other elements on the page, you could potentially override an element's initial position styling.

I considered scoping down the hiding css to just body [data-ast-id] { display: none; } so that only elements that are part of the AST are hidden (and so you wouldn't have to "unhide" the ancestors and descendants of the target node, but this didn't seem to reliably hide all of the other elements on the page). Maybe there is a way to do this reliably, or there is a better approach to the hiding that I haven't thought of yet.

jheer commented 2 years ago

Thanks! This served as a helpful starting point for #18.