News for hackers. Stuff that matters.
Re:Quarkdown: A modern Markdown-based typesetting system by skwee357 on Tuesday June 03, 2025 @04:50AM (#44167852)
This looks very interesting and more approachable than Typst.

As some who uses headless chrome to turn html into pdf (for invoices), I have been looking for something simpler and faster.

I tried typst, but it felt messy to me. I wonder if quarkdown offers more streamlined experience

Re:Quarkdown: A modern Markdown-based typesetting system by skwee357 on Tuesday June 03, 2025 @06:57AM (#44168582)
Had a chance to read the wiki/docs deeper. Quarkdown seems to use puppeteer and chrome-print-to-pdf to generate PDF from HTML [1].

So, aside from the more minimal format or Markdown compared to HTML, I don't see much appeal in quarkdown compared to feeding HTML to a headless chrome instance.

But it is a cool project if one wants to turn a bunch of markdown files to say a book or an article.

[1] https://github.com/iamgio/quarkdown/wiki/pdf-export

Re:Quarkdown: A modern Markdown-based typesetting system by promiseofbeans on Tuesday June 03, 2025 @05:12AM (#44167960)
WEasyPrint is great for generating invoices from html!

https://weasyprint.org/

Also the only good implementation of web layout/rendering I've seen done in python.

Re:Quarkdown: A modern Markdown-based typesetting system by skwee357 on Tuesday June 03, 2025 @06:15AM (#44168332)
Whats the difference between them and running a headless chrome docker container?
Re:Quarkdown: A modern Markdown-based typesetting system by istjohn on Tuesday June 03, 2025 @07:30AM (#44168839)
WEasyPrint's Github:

> From a technical point of view, WeasyPrint is a visual rendering engine for HTML and CSS that can export to PDF. It aims to support web standards for printing. WeasyPrint is free software made available under a BSD license.

> It is based on various libraries but not on a full rendering engine like WebKit or Gecko. The CSS layout engine is written in Python, designed for pagination, and meant to be easy to hack on.

Re:Quarkdown: A modern Markdown-based typesetting system by genewitch on Tuesday June 03, 2025 @09:25AM (#44169840)
Cool, not who you replied to but this is a cool idea, another way to archive pages. Gotta compare it to singlefile and headless chrome - I've been looking for a faster way to get a snapshot of a webpage via a chatbot (like in discord or matrix). Used to use Firefox headless, but large pages/slower sites would time out the api.
Re:Quarkdown: A modern Markdown-based typesetting system by dev_l1x_be on Tuesday June 03, 2025 @04:55AM (#44167875)
> I tried typst, but it felt messy to me.

What exactly is messy about Typst?

Re:Quarkdown: A modern Markdown-based typesetting system by skwee357 on Tuesday June 03, 2025 @06:21AM (#44168356)
The syntax feels complicated. Maybe I just don't have enough patience for learning a typesetting syntax (I never worked with Latex before).

On top of that, there is no easy way to create a template. For example, I want an invoice template which I can reuse with different data. Theoretically, I can create a typ file for the template, and define the invoice as a function which I then call from a string with, say, json data. It seems great as web service, but not as a library I can use from, say, Rust.

And the type system is a bit confusing. I can define basic types like numbers or string, but when it comes to structs, they don't seem to have support for that.

I find it easier to create a handlebars template, and feed the HTML to headless chrome printing service, which will output a PDF for me. It's not scalable for high volume, but good enough for my needs (takes about 2-3 seconds to generate PDF).

Re:Quarkdown: A modern Markdown-based typesetting system by lugao on Tuesday June 03, 2025 @07:51AM (#44168967)
> On top of that, there is no easy way to create a template

Templates are just functions [0].

I think much of the frustration comes from typesetting being a harder problem than it seems at first. In general a typesetting system tries to abstract away how layout is recomputed depending on content.

Supporting contextual content -- cases where the content depend on other content, e.g. numbered lists, numbered figures, references, etc -- involves iterative rendering. This is evidentidly a complexity sinkhole and having a turing complete script language will bite you back when dealing with it. I recommend reding their documentation about it [1] where they explain how they propose solving this problem.

[0]: https://typst.app/docs/tutorial/making-a-template/

[1]: https://typst.app/docs/reference/context/#compiler-iteration...