retype icon indicating copy to clipboard operation
retype copied to clipboard

Single HTML file of a book

Open geoffreymcgill opened this issue 4 years ago • 14 comments

Discussed in https://github.com/retypeapp/retype/discussions/84

Originally posted by larmarange July 21, 2021 Do you have any plan for allowing to generate (in addition of the website) an HTML file (ideally self-contained) containing all the book allowing to propose to readers to download the overall book and/or to print it as a PDF with their browser.

geoffreymcgill avatar Jul 21 '21 17:07 geoffreymcgill

Yes, 100% this is happening. I've had on my TODO list since the beginning of Retype.

We will be providing several print friendly, file download, and eBook download options. This will include:

  1. Print friendly stylesheet, so printing any individual page directly from the browser looks awesome
  2. A per page .pdf download option
  3. An entire content (the "Book") in at least several different formats:
    1. .epub (all content)
    2. .ibooks (might not be required)
    3. .pdf (per page & all book)
    4. .html (might not be required)

We haven't started on any of these features yet, but they are technically trivial for us to implement. Most of the development time will be taken up with UI design and testing.

I'm not exactly sure what release the above (or some of the above) features will be implemented, but it is a priority.

We're a small team and working our way through all the feature requests as fast as we can. That said, all of the above will supported by Retype.

Hope this helps answer your questions.

geoffreymcgill avatar Jul 21 '21 17:07 geoffreymcgill

Yes thanks. That would be great

larmarange avatar Jul 21 '21 18:07 larmarange

Any updates on this issue? I'm really looking forward for an option to build the documentation as a single pdf file.

Zerotask avatar Feb 11 '22 23:02 Zerotask

Looking forward to this, too. Does anyone see a "hacked" (pandoc?) way of getting something out, even if not perfect?

arminus avatar Apr 05 '22 08:04 arminus

Does anyone see a "hacked" (pandoc?) way of getting something out, even if not perfect?

There should be a relative easy way to hack something up.

  1. A script that iterates over the files, and removes or modifies all non-standard markdown elements
  2. Then, it concatenates the output to a single markdown file
  3. Then, you can just preview it with any markdown previewer - personally, I am using my own CLI to preview READMEs (madman and save the HTML, or use any other "markdown to HTML" conversion technique.

The bigger challenge, would be to convert the non standard markdown elements.

Another similar approach, would be to

  1. Write a script that iterates and concats all your markdown files, and saves the output back to the source folder
  2. Open the result in Retype... :)

DannyBen avatar Apr 05 '22 10:04 DannyBen

@geoffreymcgill No PDF support is preventing me from using Retype

mudgen avatar Sep 02 '22 19:09 mudgen

Any updates on PDF support? This is really the missing thing here!

p0fi avatar Jan 24 '23 13:01 p0fi

Converting individual markdown files into one cohesive PDF book is not a trivial task.

From dev perspective, it involves two tasks:

Task 1: Concatenating markdowns, which will require:

  • Having a new template that understands "pages", has a Table of Contents and other elements in preparation for PDF export.
  • Being able to adjust all links to be internal
  • Being able to adjust all header links, to distinguish from one another.
  • More

Task 2: Converting markdown to HTML and then to PDF

While it can be done in a server environment (one that render server-side markdown to HTML), it is - to my knowledge - quite impossible to do on a client side, without bringing in bloated software to do so.

Personally, I do not know of any other documentation tool generator that does that - I would love to be enlightened if there is any.

I believe the only course of action for Retype developers (if any) is to render a special HTML page (say "my-retype-site.com/book"), which will create the HTML render of everything (i.e. Task 1), and then the user can use their already available "Download as PDF" in Chrome or other modern browser.

DannyBen avatar Jan 24 '23 14:01 DannyBen

Im well aware that this is not trivial, it's a really important feature nevertheless in my eyes.

Personally, I do not know of any other documentation tool generator that does that - I would love to be enlightened if there is any.

Gitbook does that. See Gitbook Docs – PDF Export

p0fi avatar Jan 24 '23 19:01 p0fi

I understand. But Gitbook is a hosted service, retype is a static site generator.

DannyBen avatar Jan 24 '23 20:01 DannyBen

  • Print friendly stylesheet, so printing any individual page directly from the browser looks awesome

  • A per page .pdf download option

  • An entire content (the "Book") in at least several different formats:

    1. .epub (all content)
    2. .ibooks (might not be required)
    3. .pdf (per page & all book)
    4. .html (might not be required)

I understand the additional complexity involved in # 3 (entire "book"), but the first two points seem much more trivial. Since Retype doesn't currently support at-rules @page { @top-right {...}} it's damn near impossible to get a nice printout of a single article.

Any updates on this @geoffreymcgill?

lnarynskyyi avatar Mar 22 '23 22:03 lnarynskyyi

@p0fi Nice. Thanks for that.

geoffreymcgill avatar Mar 23 '23 20:03 geoffreymcgill

Just an FYI. Refer to #628 for a somewhat "hacky" workaround that can be used as an interim measure for single page pdfs.

ApolonTorq avatar Sep 12 '23 09:09 ApolonTorq