Hacker News new | past | comments | ask | show | jobs | submit login

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






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


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.


Whats the difference between them and running a headless chrome docker container?

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.


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.

> I tried typst, but it felt messy to me.

What exactly is messy about Typst?


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).


> 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...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: