Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8853775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:43:53+00:00 2026-06-14T13:43:53+00:00

This is a really weird question: I have been able to generate html and

  • 0

This is a really weird question:

I have been able to generate html and pdf output using Sphinx; and I had to bundle both with my distribution (to PyPI) so that both would be accessible to the user.

Though I can upload HTML documentation directly to be hosted on PyPI, I am unable to upload the PDF LaTeX version of it as well. I want to do this because the actual code is under 50K, but bundling the documentation with it bloats it up to about 300K.

Ultimately, I would like the user to be able to have an off-line version of the documentation without having to download several pages of sphinx documentation.

So my question is this: is it possible for me to automatically bundle the PDF with the HTML so that an end user can directly download the PDF for off-line use? (I realize that I can bundle just the PDF with my distribution, but this seems a cleaner approach)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T13:43:55+00:00Added an answer on June 14, 2026 at 1:43 pm

    I went with a modification of Reinout van Rees’s solution:

    I created a downloadMe.rst (which has lorem ipsum text within it) which gets automatically built into HTML when make html is run and therefore makes downloadMe.html with the lorem ipsum text.

    I then edited the Makefile’s html target as follows:

    1. make it build the LaTeX pdf and copy it over into _build/html/static.
    2. use a sed script to replace the lorem ipsum text in downloadMe.html with an HTML hyperlink to the PDF in _build/html/_static.

    When all of that was done, this is what the html target in Makefile looks like:

    html:
            @echo "Making LaTeX"
            make latex
            ( cd _build/latex/; make ) # the LaTeX needs to be built separately. This can be done in a subshell
            @echo "Done making LaTeX"
            @echo "Copying PDF to Static"
            cp _build/latex/Genetic.pdf _build/html/_static/
            @echo "Copy PDF to Static... DONE"
            @echo "Adding PDF to HTML"
            sed -i '' 's/lorem\ ipsum/\<a href="_static\/Genetic.pdf"\>Download\ Me\<\/a\>/g' _build/html/downloadPDF.html
            @echo "Done adding PDF to HTML"
            @echo "Removing LaTeX dir"
            rm -rf _build/latex
            @echo "Done removing LaTeX dir"
    
            $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
            @echo
            @echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
    

    This makefile target, though a little heavier has the advantage that it’s fire-and-forget; I just have to make html and all the documentation is done in one go and I don’t have to edit any files when make is done. This leaves less room for me to forget to edit some file or other to make the documentation correctly before uploading to PyPI

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After ages of programming in php this question seems really weird still to me.
Ok, this is a really weird one. I have an MPI program, where each
Can anyone explain why using comments like this in css cause really weird effects
I have a bit of a weird question here. I am using iperf to
I have a really weird situation, I am calling my javascript function like this...
Inspired by Lance Pollard's comment in this question , something really weird happened and
I have a weird question. I have been writing a code to change the
im a newbie to flash,and i hav got this really weird problem.i have created
I'm sorry if this is a weird question. I have read plenty of stuff
I have a really weird issue with an SQL query I've been working with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.