# Making DOI Ready PDFs from Discourse

**URL:** https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858
**Category:** Feature
**Created:** [July 21, 2018, 8:20pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858 "2018-07-21T20:20:02Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [July 21, 2018, 8:20pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/1 "2018-07-21T20:20:03Z")

</div>

How do I download a topic as HTML or a PDF file? I’m a bit lost on how to do this. Any help?

---

<div class="post-metadata">

### Author: ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)
#### Post date: [July 21, 2018, 8:30pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/2 "2018-07-21T20:30:53Z")

</div>

The system isn’t designed to be ready-to-print as you lose the context, but you could use the print shortcut Ctrl+P and save it from there?

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [July 21, 2018, 8:46pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/3 "2018-07-21T20:46:20Z")

</div>

I see! That works.

Though is there a way to improve on this? This seems to be an important thing to enable. Is there a way to enable download as a single webpage or webpage archive?

---

<div class="post-metadata">

### Author: ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)
#### Post date: [July 21, 2018, 8:57pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/4 "2018-07-21T20:57:53Z")

</div>

Why important? What’s your use case for this? I’m intrigued

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [July 21, 2018, 9:34pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/5 "2018-07-21T21:34:45Z")

</div>

This has been discussed at length already. FWIW print to pdf solves it for me in most cases.

[https://meta.discourse.org/t/print-long-topic-to-pdf-redux-again/44639?u=tobiaseigen](https://meta.discourse.org/t/print-long-topic-to-pdf-redux-again/44639)

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [July 22, 2018, 1:28am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/6 "2018-07-22T01:28:47Z")

</div>

> [@robmc](#):
>
> Why important? What’s your use case for this? I’m intrigued

I’m trying to get a DOI for a forum thread, because this is a conversation of high value. I want it to be cited. For that reason, I need to get it distilled down into a semi-professional PDF to submit to Zenodo.

> **[Zenodo](https://zenodo.org/)**

This is an increasingly important thing to support. As academics are allowed to cite anything with a DOI. In fact, having facilities to ease DOI generation workflows would be really useful.

---

<div class="post-metadata">

### Author: ![robmc](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmc/32/125900_2.png) [@robmc](https://meta.discourse.org/u/robmc)
#### Post date: [July 22, 2018, 8:43am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/7 "2018-07-22T08:43:38Z")

</div>

Yes, that is an interesting use-case. I can’t quite get my head around how you present either all or just a selection of posts in a topic in this way as opposed to simply using the permalink for the topic.

As a matter of interest, does it have to be a PDF in this case? Is a topic not just as much of a ‘digital object’? (I’m not an academic, as you can tell).

I guess I can see how this MIGHT work as a plugin for communities around research topics. You can search this site for conversations around the topic of printing and exporting (such as the excellent link from @tobiaseigen above) and maybe there would be folks to collaborate with to develop the concept further?

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [July 22, 2018, 9:14am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/8 "2018-07-22T09:14:04Z")

</div>

There’s already a solution

> [@Falco](#):
>
> For example, going to [The State of JavaScript on Android in 2015 is… poor](https://meta.discourse.org/t/the-state-of-javascript-on-android-in-2015-is-poor/33889) and pressing CTRL+P will open a popup with a print dialog asking to print **64 pages**.

Print to PDF, which is well understood and supported on every operating system.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 22, 2018, 11:16am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/9 "2018-07-22T11:16:45Z")

</div>

I’d argue that you’d want to create the DOI for the thread itself, not a static and out-of-date. I thought that Zenodo would let you do that, but FWIW, you can just append `/print` to the end of a topic URL to get the print version.

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [August 5, 2018, 6:51pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/10 "2018-08-05T18:51:41Z")

</div>

This is all helpful. I just blogged about the use case I am after here:

> **[The Perils of Digital Dialogue](https://peacefulscience.org/articles/digital-dialogue/)**
>
> In the conversation between theology and science, digital dialogue is important, but comes with perils. Maybe DOIs could help us do better.

The challenge I’ve now seen from using this is several fold.

> [@robmc](#):
>
> As a matter of interest, does it have to be a PDF in this case? Is a topic not just as much of a ‘digital object’? (I’m not an academic, as you can tell).

It does have to be a static file that can be uploaded to Zenodo. The “promise” behind DOIs is that they will **_always_** be accessible in perpetuity, and immutable. Uploading to Zenodo guarrantees this, but we have to upload. It need not be a PDF. A well packaged HTML file could work too, but PDF’s are viewable on the website. The key thing is that it must be static.

> [@robmc](#):
>
> Yes, that is an interesting use-case. I can’t quite get my head around how you present either all or just a selection of posts in a topic in this way as opposed to simply using the permalink for the topic.

That would be a great feature. Though it seems downstream from some other problems. Here is what I see are the big issues:

1. Links are not handled well, nor are crosslinks.
2. Most of the problems are hackishly solvable with custom css added to the template.
3. Links should ideally be handled as footnotes, but this is not easy to do with standard CSS. I should be done on the backend.
4. It is currently untested on things like “spoiler” tags or Latex.
5. There is a ton of nuisance elements that need to be removed (such as cross link indicators after posts). If someone wants to help with this, I can produce a definitive list.
6. Process is pretty manual. Ideally there is an Admin button one could click which would interface directly with the Zenodo API, including getting the versioning correctly, etc. This admittedly is a lot of work. So I imagine will take a while.

I can provide the CSS I am using if someone wants to make it default. All it does is add some CSS in print and page css sections to clean things up for print. That is probably the easiest thing to do right now, perhaps adding some configuration options to discourse to tune it. Is there interest in that?

The HTML link to footnote is a real problem that does need to be addressed. It is most likely solvable only on the backend, as CSS is not set up for this. That, it seems, it the most important hard problem to solve quickly.

Is this something anyone can help with?

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [August 5, 2018, 6:55pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/11 "2018-08-05T18:55:47Z")

</div>

A couple other features that would be really powerful and useful, and eaiser than full Zenodo Integration:

1. Add a button to click for users to request a DOI of a topic.
2. Once a DOI is assigned, have a way for admins to display the DOI alongside the title.
3. Add markup code to identify and automatically format DOI’s correctly like this: [![DOI](https://global.discourse-cdn.com/meta/original/3X/e/1/e1b61847dc064c8361dba11fe67361bf3243270e.svg)](https://doi.org/10.5281/zenodo.1328264).

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [August 5, 2018, 6:56pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/12 "2018-08-05T18:56:51Z")

</div>

I know this might be work, but if its done, I think it could create some good press for Discourse. I think there is important intellectual work happening in some discourse communities, and there is growing interest in alternate publishing platforms in academia.

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [August 5, 2018, 10:00pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/13 "2018-08-05T22:00:25Z")

</div>

One more critical challenge is how to deal with author handles. Ideally, the cited people are included at the bottom of the pdf. One again, this is only solvable on the backend, but seems imminently doable.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [August 6, 2018, 10:31am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/14 "2018-08-06T10:31:21Z")

</div>

This should be pretty doable in a plugin. Were I still an academic I would probably give it a shot.

---

<div class="post-metadata">

### Author: ![jks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jks/32/101841_2.png) [@jks](https://meta.discourse.org/u/jks)
#### Post date: [August 7, 2018, 4:18pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/15 "2018-08-07T16:18:54Z")

</div>

> [@swamidass](#):
>
> The HTML link to footnote is a real problem that does need to be addressed. It is most likely solvable only on the backend, as CSS is not set up for this. That, it seems, it the most important hard problem to solve quickly.

The good old arc90 Readability bookmarklet reformatted links to footnotes in client-side Javascript. It no longer works but there are copies on the web since it was open source:

> <https://gist.github.com/cristiandouce/4493741>

---

<div class="post-metadata">

### Author: ![swamidass](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/swamidass/32/119549_2.png) [@swamidass](https://meta.discourse.org/u/swamidass)
#### Post date: [August 7, 2018, 11:08pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/16 "2018-08-07T23:08:40Z")

</div>

I’m displaying my ignorance here, how would I use this?

---

<div class="post-metadata">

### Author: ![jks](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jks/32/101841_2.png) [@jks](https://meta.discourse.org/u/jks)
#### Post date: [August 8, 2018, 5:14am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/17 "2018-08-08T05:14:16Z")

</div>

I think in principle you could try this out by pasting something like this in the Javascript console (warning: don’t paste things in the console that you don’t understand):

```plaintext
var s = document.createElement('script');s.type='text/javascript';s.src='https://rawgit.com/cristiandouce/4493741/raw/d0fd4f71f3ecd272a23088901eab9a7170f78270/readability.js';document.documentElement.appendChild(s)

```

It doesn’t seem to immediately work on Discourse content, so it’s going to need more work. But the `addFootnotes` function could be a useful starting point.

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [August 15, 2018, 12:02am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/18 "2018-08-15T00:02:12Z")

</div>

You would instead use the Discourse API to register a `decorateCooked` callback and run that JS on each post as they get rendered – but this won’t work for the print view.

---

<div class="post-metadata">

### Author: ![cathyc](https://avatars.discourse-cdn.com/v4/letter/c/8491ac/32.png) [@cathyc](https://meta.discourse.org/u/cathyc)
#### Post date: [November 29, 2020, 9:33am UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/19 "2020-11-29T09:33:58Z")

</div>

I’ve been struggling with a solution to downloading threads and I’m afraid this is not a solution. Replies to comments are no longer nested under the relevant comment, but are listed in chronological order along with all comments. It makes it impossible to meaningfully use as far as I can see.

If there is a solution I’d love to see it. I’m about to go through the very painful process of expanding replies and copying and pasting, a few at a time for 1.2K comments, plus their replies. If only I could avoid doing this!

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [November 29, 2020, 7:29pm UTC](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858/20 "2020-11-29T19:29:12Z")

</div>

Oh, I see, you want the content reformatted in a specific way – that’ll take an external program or plugin.

_Discourse isn’t a threaded discussion system_, so displaying the replies to the topic in chronological order, as the user interface does, is the only built in method of displaying topic content.

[Next page](https://meta.discourse.org/t/making-doi-ready-pdfs-from-discourse/92858.md?page=2)
