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

Add themes, margin and sticky notes, and change layout #8

Closed TwoTau closed 2 years ago

TwoTau commented 2 years ago

ACM template theme: https://homes.cs.washington.edu/~vishald/lpub/themes/acm-article/ Normal theme: https://homes.cs.washington.edu/~vishald/lpub/themes/normal/

Things added:

Some open questions:

TODO:

jheer commented 2 years ago

This is looking great! I added comments/questions on some of the code changes.

A few additional questions:

Also, take a look at this PR, as we'll need to reconcile our approaches: https://github.com/uwdata/living-papers-testbed/pull/9

TwoTau commented 2 years ago

How valuable is using SCSS? I'm not against it, but would like to keep things as-simple-as-possible unless a change makes a substantial difference in what we can express.

The SCSS features I use most are nested selectors and reusable mixins to organize code. I think the main expressiveness benefit of SCSS is being able to pass variables around, but this is now also possible with CSS variables. I've noticed that programmers tend to use SCSS variables for colors and CSS variables for layout, but I'm not sure why (maybe because of the SCSS's color functions?)

What is the difference between an inlinenote (previously just note) and an aside? I'm not currently using aside anywhere in living papers now, so I'm curious what you have in mind here.

I mentioned this in a previous comment; I don't think there was a difference. I'll push a commit that renames inlinenote back to note

For the sticky attributes, how about sticky-until (stick until you reach the start of the identified section) and sticky-through (sticky until you reach the end of the identified section). Does that match your current semantics for sticky-until-top and sticky-until-bottom?

Yep, just pushed a commit to change the naming to sticky-until/sticky-through.

(And on that note, I'm not sure of the semantics for until-bottom... does it reason in terms of paper sections or only via specific element ids?) I'm tempted to keep things simple and use only sticky-until (top) for now, unless you have some compelling argument otherwise!

Right now, both until-top and until-bottom only reason in terms of CSS selectors (#ids but also harder-to-use selectors like #header ~ p ~ p). However, I'm guessing most authors would prefer to specify "sticky until the bottom of the current section" or "sticky until the next h1 or h2 heading" without needing to know the heading's ID.

My reasoning for adding a "sticky-through" option was just aesthetic. I think it's more cohesive for the sticky figure to end at the same y-position as the bottom of the last <p> of the current <section> instead of the first <p> of the next <section> because sections have margins.

sticky

TwoTau commented 2 years ago

Rendered with themes:

Changes