Skip to content

Provide ZIP downloads for MkDocs #1939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marcelstoer opened this issue Jan 17, 2016 · 6 comments
Closed

Provide ZIP downloads for MkDocs #1939

marcelstoer opened this issue Jan 17, 2016 · 6 comments
Labels
Accepted Accepted issue on our roadmap Feature New feature
Milestone

Comments

@marcelstoer
Copy link
Contributor

I know there's no PDF for MkDocs projects (http://docs.readthedocs.org/en/latest/builds.html?highlight=pdf#mkdocs and #1174).

However, why can't there be at least a downloadable HTML bundle? You have to produce those files anyway, right? Or should there be an HTML bundle but my project https://readthedocs.org/projects/nodemcu/ simply isn't configured/working correctly?

@ericholscher
Copy link
Member

Mkdocs doesn't generate PDF's, so there is no way for us to support this. Feel free to open a bug there to get PDF support.

We could do downloadable HTML of the mkdocs builds, if you want to add support, the code for it is here: https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/doc_builder/backends/mkdocs.py

@marcelstoer
Copy link
Contributor Author

Mkdocs doesn't generate PDF's, so there is no way for us to support this.

As I said, I know and understand that 😉 There are a number of issues over at MkDocs that circle around that topic but only mkdocs/mkdocs#374 (comment) currently has some momentum. We'll see...

Thanks for the pointer to mkdocs.py. Being familiar with neither your code base NOR Python makes this seem like a daunting task. However, even old dogs are never too old to learn new tricks. In pseudo-code I'd expect something like:

...
invokeMkDocsBuilder(outputDir)
zip = zip(outputDir)
copyFile(zip, 'https://readthedocs.org/projects/' + project + '/downloads/')
...

I'll look into the code and http://docs.readthedocs.org/en/latest/contribute.html#contributing-to-development to see if I think it'll get me somewhere.

@jgrassler
Copy link

On the subject of PDF generation: mkdocs/mkdocs#374 (comment) yielded a working PDF generator already: https://github.com/jgrassler/mkdocs-pandoc

In a nutshell, it generates a single Pandoc document from the original mkdocs source and uses Pandoc's PDF generator facilities. It may have a few more bugs that need ironing out, but it's at a point where I'd risk exposing it to a somewhat broader user base to trigger all these edge cases I probably haven't thought of :-)

@vlcinsky
Copy link

vlcinsky commented Oct 12, 2017

Why everybody talks here about PDF when the title asks for ZIP file and explicitly excludes PDF?

Maybe the title is confusing (using two negations is probably the problem). I would propose changing the title to Provide ZIP downloads for MkDocs

@RichardLitt RichardLitt changed the title Why no non-PDF downloads for MkDocs Provide ZIP downloads for MkDocs Oct 14, 2017
@RichardLitt
Copy link
Member

Thanks @vlcinsky - good point. Changed.

@humitos
Copy link
Member

humitos commented Jan 31, 2023

Hello 👋🏼 We standardized the output paths for all the formats that Read the Docs supports in #9888. This allow people to output, for example, a PDF under _readthedocs/pdf/<project-slug>.pdf to be recognized by Read the Docs and expose it as a downloadable content (https://docs.readthedocs.io/en/stable/downloadable-documentation.html) 💯

I created an example at:

It uses the mkdocs-with-pdf MkDocs plugin: https://pypi.org/project/mkdocs-with-pdf/


I also created a similar example for HTML Zip files at:

It uses the mkdocs-autozip MkDocs plugin: https://pypi.org/project/mkdocs-autozip/

Unfortunately, the Zip file provided by this plugin is just a zipped version of all the source files (.md) and not a self-contained web page. However, this is a limitation of the plugin 😞 , not Read the Docs.

I'm closing this issue since with the introduction of the standard output directories, users can solve this problem by themselves by using external plugins/tools to achieve this goal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Feature New feature
Projects
None yet
Development

No branches or pull requests

8 participants
@ericholscher @humitos @marcelstoer @vlcinsky @RichardLitt @agjohnson @jgrassler and others