CSS Notes Are Coming in WeasyPrint
What are CSS Notes and how to use them with WeasyPrint?
Writing is a kind of code
CourtBouillon conceives high-quality apps and tools to help you give life to elegant documents, wonderful images, lovely texts, and more.
What are CSS Notes and how to use them with WeasyPrint?
That’s a recurring question on our bug trackers: why don’t you add type annotations to your Python projects? That’s a good question, and it needs an article to really explain why.
In the next major version of WeasyPrint, you’ll be able to use many new ways to define colors! New color notations 🎨 will be available, that’s cool, but that’s just the tip of the iceberg: behind the curtain, WeasyPrint had to change the way it manages colors. It’s the first step of the road leading to our final destination: CMYK support.
When creating paged documents automatically, one of the most common remarks is: "This page break is really ugly, a human would never have done this!" That’s true: humans are still better than computers to define page breaks. But nothing prevents humans from teaching computers how to choose better page breaks!
Everyday we work with web technologies, but our work is a bit different from a lot of people: we don’t create websites. Our HTML and CSS aren’t displayed on web browsers, but transformed into PDF files.
box-decoration-break
When a box is split between multiple pages, do you want do display its top and bottom borders? Sometimes you do… but sometimes you don’t.
What would be an old book, a research paper, a 100-page report, a very important contract without footnotes at the bottom of the pages?
Having the current chapter name and number displayed in each page margin is useful in many situations: quickly turning the pages and checking the current chapter, printing a page and knowing in which part of the book it is, remembering the general topic of a long paragraph when reading a complex essay…
margin
You probably already noticed that books are made of pages. And you probably already noticed that there are two kinds of pages: rectos and versos. But, did you notice that it causes the layout of these pages to be slightly different?
leader()
If you ever tried to create a beautiful table of contents, you may have tried to include leaders. Leaders? Yes, these small dots you put between a chapter’s title and its page number.
Splitting content into multiple columns is a common way to display text in books, newspapers and flyers. Guess what: CSS can do this for you!
@media
Using the same content on a website and on a printed document is a very common requirement. Even when the two versions share most of the style, it’s often useful to define some specific details for one of the supports using media types.
@page
Ever wanted to use a landscape orientation for your tables, because they’re too large and overflow the page? It’s possible with CSS named pages!
Here we are. We untied knots, dug down to the roots, dissected formats, scattered files, opened a toolbox and defined needs. Maybe we can now think about making a package!
Python packaging can sometimes be a nightmare. It’s all the more hellish because when we talk about package creation and installation, we should first start to define precisely what we mean.
Python packaging can sometimes be a nightmare. To create, share and install packages, there are a lot of tools, sometimes doing the same thing, but not the same way.
Python packaging can sometimes be a nightmare. To convince yourself about that, you just need a few minutes of drowning into the myriad of usable (and used!) files to build or install a packages.
Python packaging can sometimes be a nightmare. But, by the way, what is a package? Obviously, as nothing is simple, as nothing will be spared, the non-answer to this question is: it depends…
Python packaging can sometimes be a nightmare. Because of the stupidity of Python maintainers? What if it was more complicated?
Python packaging can sometimes be a nightmare. You don’t know what we’re talking about? Let’s present you a couple of things and we’ll talk again after that…
A new feature, leader(), has been added in WeasyPrint 🎉.
A new feature, line-clamp, has been added in WeasyPrint.
The next major version of WeasyPrint will work without Cairo. What does it change for you?
We speak a lot about the pydyf branch, but concretely, when will it be the master one?