Is it possible to blanket export all posts that have a specific tag as pdf documents?

hi everyone, Owen made a functionality where you can download a post as a pre-formatted pdf (see the download button here Edgeryders)

We are now weaving together content from platform into one anthology per project we would like to gift everyone who has contributed to those conversations.

It would simplify @MariaEuler @noemi and my own were it possible to download all the posts that have been tagged e.g windows-of-perception as batch downloads, rather than each one individually.

Possible @owen @hugi @matthias?

It’s certainly possible, but it’s not necessarily trivial. We could make this happen, but it should be planned well so that it can be reused. If it’s still useful to have in January, we could put it in the pipeline, but if it’s mainly something that’s useful for the work happening this week, it’s not enough notice to do it properly, while still finishing the other work that needs to be done.

The script takes the markdown of each posts and formats into html that can be generated into a PDF using this module. It should be possible with x number of posts - but @matthias might have a better solution in mind that works through the backend of the platform, if it involves large batches of posts… the reason would be that if you have 100 posts, that means 100 calls to get the posts from discourse and to process them (and 100 downloads), which might not be efficient in the browser.

Tldr - I could make it work, but it might be slow for lots of posts.

There seems to be some terminology confusion here – maybe you mean “topic” where you wrote “post”, @nadia and @owen?

If you indeed mean “post”, there is a hidden feature in Discourse that will make this fast, much faster than sending 100 calls to Discourse to get 100 posts of a single topic and then converting them from Markdown to HTML in JavaScript, and from there to pdfmake format, and from there to PDF.

Namely, when you append ?_escaped_fragment_ to the normal URL of a Discourse topic, you get the whole topic as one single HTML document, bypassing the normal API (example). This can be used to manually convert topics to PDF (details in our manual). But it also provides a fast way to get HTML for a topic, to then convert to PDF the way Owen is doing it now.

Since this is fast, creating a single PDF document from up to approx. 10 Discourse topics would also be reasonably fast, but beyond that we’d need a more robust implementation, and time to plan and do that as @hugi says.

yes I meant topic :slight_smile: