Hacker News new | ask | show | jobs
by alerighi 1552 days ago
Why do you need to rebuild parsers from scratch? You can just use Chromium. Want to build a PDF form an HTML page? You can launch chromium in headless mode and tell it to print your HTML. Guaranteed that you will have a good result. I don't understand where you have this problem these days.

Also, nobody really asks you to do complex things with CSS. Unless you use a huge framework (that I tend to avoid, I prefer writing everything from scratch) you don't need too much rules to make a page look good. In 200 lines of CSS you can get a good style for your site.

The problem is that people:

- think that frontend development is easy and have less dignity than other kind of software development - don't want to spend time learning CSS since it should be simple - don't know CSS and don't understand it - use a framework like Bootstrap because they don't want to learn CSS - complain that CSS is shit because they have to use a ton of !important to make things work

CSS is easy if you dedicate enough time to learn the basics of it, and start to make some stylesheets from scratch without Bootstrap or other shit.

1 comments

Nobody wants to ship Chromium with their pdf library or application. How do I get a print preview? If I do convince myself to lug around chromium, do I invoke Chromium each time for 1000 PDFs in a batch? Do I want to pay to invoke chromium on a EC2 instance or lambda?

Every document production library that handles HTML (a very popular feature) has had to implement HTML/CSS parsing.

I and many others are using HTML and CSS to declaratively lay out complex , dynamic documents (or trying to at least). Seems to make sense but we have ten more years to go before it's fully solved. Right now it costs serious coin to do it (unless you are releasing FOSS) and it ain't fun.