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

Improve print view styling #2468

Merged
merged 4 commits into from
Apr 5, 2023
Merged

Improve print view styling #2468

merged 4 commits into from
Apr 5, 2023

Conversation

tecosaur
Copy link
Contributor

@tecosaur tecosaur commented Feb 7, 2023

Here are a few small tweaks that I think improve the print style.

  • Remove (useless) symbol definition underlines. These could be linked in the PDF (as in HTML), but they aren't, and so they end up being visual noise.
  • Re-add the left cell border, in case the browser is hiding background colors, otherwise cells can look a bit funky.
  • Hide the gutter element, it serves no purpose here.
  • Hide the automatic page/url/date annotations

Before (Firefox default print settings)

image

After (Firefox default print settings)

image

- Remove (useless) symbol definition underlines. These could be linked
  in the PDF (as in HTML), but they aren't, and so they end up being
  visual noise.
- Re-add the left cell border, in case the browser is hiding background
  colors, otherwise cells can look a bit funky.
- Hide the gutter element, it serves no purpose here.
- Hide the automatic page/url/date annotations
@github-actions
Copy link
Contributor

github-actions bot commented Feb 7, 2023

Try this Pull Request!

Open Julia and type:

julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/tecosaur/Pluto.jl", rev="improve-print-view")
julia> using Pluto

@Pangoraw
Copy link
Collaborator

Pangoraw commented Mar 8, 2023

These could be linked in the PDF (as in HTML), but they aren't

I made an export (Chrome), and the global definitions actually have links targeting the defining cell. IMO it make sense to keep line numbers rather than hide them but it would be better if they were not selectable to enable easier copying from the pdf export.

@fonsp
Copy link
Owner

fonsp commented Mar 13, 2023

I want to keep the underlines because of #2450 and the gutters because of 33cb224 . Good point about making them not selectable!

@fonsp
Copy link
Owner

fonsp commented Apr 5, 2023

I removed the @page rules because we probably just want the user/browser to choose these settings.

It would be nice to set the "header/footer text" setting to false by default, but margin is not the right API to do that with, right? It looks like this is a trick to make the content flow on top of the headers, not an API to change the setting directly.

@fonsp fonsp merged commit 4bde084 into fonsp:main Apr 5, 2023
@tecosaur
Copy link
Contributor Author

tecosaur commented Apr 5, 2023

I removed the @page rules because we probably just want the user/browser to choose these settings.

Eh, I'm not sure about that, and it included size: auto; which should result in pretty sensible behaviour.

It looks like this is a trick to make the content flow on top of the headers, not an API to change the setting directly.

In a way it is, but you could then describe it as "a trick without side effects". The reality is, it seems to be the only way you can do so currently, and so I'd think worthwhile.

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.

3 participants