dcrdocs icon indicating copy to clipboard operation
dcrdocs copied to clipboard

Full docs copy for offline read (PDF, EPUB, HTML)

Open xaur opened this issue 5 years ago • 6 comments

Suggested here.

As an example see how Python bundles the entire documentation: https://docs.python.org/3/download.html

xaur avatar Apr 17 '19 19:04 xaur

Did a little research on this.

There is actually a MkDocs plugin now that outputs a PDF (which is arguably the most accessible format, if we just choose one), https://github.com/zhaoterryy/mkdocs-pdf-export-plugin

However, ran into some errors I'm spinning my wheels on. Perhaps @jholdstock has some ideas here? This is the error I'm getting (for all images):

ERROR: Relative URI reference without a base URI: <img src="/img/dcr-icons/DCRsymbol.svg">

I think it might be related this known issue. The workaround is to change a MkDocs config parameter, which I fear could create new issues.

This plugin is based on another project called mkdocs-combine , which combines multiple markdown files into a single markdown file. Which can then be used as input into a tool like pandoc, which can generate any format (PDF, single-page html, epub, etc.). I've tried using pandoc to create the PDF, but am running into yet more errors.

Would keep going here, but wanted to check in to see if anyone had ideas on this before I spent any more time.

s-ben avatar Apr 17 '19 23:04 s-ben

What is the situation with this? Is anybody working on this?

imestin avatar Sep 22 '19 08:09 imestin

Hello, please i have the same issue using pdf-export plugin,

i have the following errors : https://pastebin.com/WVpDPvCZ

i dont know what is wrongg in my configuration ? PS : i cannot install mkdocs-combine.

Best Regards,

elmesrar avatar May 10 '21 14:05 elmesrar

Hi @elmesrar - I have moved your log onto pastebin and updated your comment. Please don't paste such long logs into github comments.

Investigating this now.

jholdstock avatar May 17 '21 02:05 jholdstock

I've spent some time on this, and fixed all of the "broken" links and references (decred/dcrdocs#1168, decred/dcrdevdocs#98)

I got mkdocs-pdf-export-plugin running, but it has a bunch of issues:

  • Ugly and will need lots of custom css to make pretty
  • Takes >200 seconds to execute
  • Links in the pdf don't work
  • Custom fonts don't work

I have discovered mkdocs-print-site-plugin which seems to be a much more elegant solution - I tested it and it works really well. The only issue is we need to wait for squidfunk/mkdocs-material#2655 to be released first.

jholdstock avatar May 17 '21 04:05 jholdstock

I saw the reference to this issue on the mkdocs-material issue. I'm the author of mkdocs-print-site-plugin. The main feature of that plugin is being able to combine all markdown pages into a single HTML page. From there, you can create a PDF, but I am also planning on building a workflow to make a standalone HTML that you can share (https://github.com/timvink/mkdocs-print-site-plugin/issues/48).

The epub is a nice idea, but it seems to be more involved. Found f.e. https://github.com/gutenbergtools/ebookmaker. Not on the roadmap but I'm open for PRs if we discuss the design together ;)

timvink avatar May 19 '21 08:05 timvink