Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Thib
@thibaultamartin@mamot.fr  ·  activity timestamp 2 months ago

I wrote a post (in markdown) on my website, and would like a printed copy of it.

Normal person: copy the markdown, slap it into a document, and print it

Me: time for some @media print queries!

#css#webDev #frontend

  • Copy link
  • Flag this post
  • Block
Jasper Vinkenvleugel
@jvnknvlgl@mastodon.social replied  ·  activity timestamp 2 months ago
@thibaultamartin I do this to convert my resume to PDF! Though unfortunately I can’t seem to get backgrounds to cover whole pages for some reason, so I hardcode heights with print queries.
  • Copy link
  • Flag this comment
  • Block
Thib
@thibaultamartin@mamot.fr replied  ·  activity timestamp 2 months ago
@jvnknvlgl I have an issue open for several months now to do it for my resume :D
  • Copy link
  • Flag this comment
  • Block
Jens Zalzala
@anakin78z@mograph.social replied  ·  activity timestamp 2 months ago
@thibaultamartin @media just print the webpage 🤷
  • Copy link
  • Flag this comment
  • Block
Thib
@thibaultamartin@mamot.fr replied  ·  activity timestamp 2 months ago
@anakin78z it has a dark background (which is bad for accessibility and I should fix anyway)
  • Copy link
  • Flag this comment
  • Block
Jens Zalzala
@anakin78z@mograph.social replied  ·  activity timestamp 2 months ago
@thibaultamartin OK, I haven't had my morning caffeine. I see now that you're actually working on using the media queries to make the page printable.

Yes, I think that's a good idea. We've done that on projects, and it's always kind of awesome to have a print perfect layout for a complicated page.

And, you know, in theory you'll only have to do this once, and can then print posts forever. So totally worth the time 😉.

  • Copy link
  • Flag this comment
  • Block
Kris
@isotopp@infosec.exchange replied  ·  activity timestamp 2 months ago
@thibaultamartin

Why not just

pandoc somttext.md -t html -o sometext.pdf

and be done with it?

@media

  • Copy link
  • Flag this comment
  • Block
Thib
@thibaultamartin@mamot.fr replied  ·  activity timestamp 2 months ago
@isotopp I see you answering with facts when I’m speaking with my heart 😄
  • Copy link
  • Flag this comment
  • Block
Thib
@thibaultamartin@mamot.fr replied  ·  activity timestamp 2 months ago

Well I meant at-rule but hej, fediverse handle parsing

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_media_queries/Printing#using_media_queries_and_page_to_control_printed_content

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login