Skip to content
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

PDF Download #4

Open
WillDignazio opened this issue Mar 9, 2017 · 25 comments · May be fixed by #632
Open

PDF Download #4

WillDignazio opened this issue Mar 9, 2017 · 25 comments · May be fixed by #632

Comments

@WillDignazio
Copy link

WillDignazio commented Mar 9, 2017

I'd love to be able to read this as a PDF, can a pdf generated per-commit be added to the repo?

EDIT: Or a script to generate a pdf?


Edit by donnemartin: Thanks to @canhlinh for making a PDF version of the repo as of March 28, 2017! We're looking into perhaps a Gitbook version of this repo which supports PDF downloads.

@donnemartin
Copy link
Owner

Hi @WillDignazio, interesting suggestion! Not sure how to do this, if anyone has any tips, please feel free to share.

@dumindu
Copy link

dumindu commented Mar 9, 2017

@donnemartin If you convert this to a Gitbook , it gives interfaces to download this as pdf, epub and etc.

@tinylucid
Copy link

Yup, try Gitbook. Having this amazing piece in PDF would be great, and I would appreciate it a lot.

@addianto
Copy link

addianto commented Mar 10, 2017

@donnemartin Or you can also use Travis CI to generate the PDF automatically and upload it as a GitHub releases. I can try setting up an example in my fork and make a Pull Request this weekend.

The idea is to use a utility named pandoc that can convert Markdown file to other format such as PDF. We can setup a Travis build by installing the required tool and dependencies for pandoc in order to read Markdown file and generate the PDF file.

EDIT:

Did a quick experiment using Travis CI. I successfully installed pandoc and its required dependencies. However, the build failed when pandoc tries to parse images that are included using Markdown ![Imgur] syntax, e.g. ![Imgur](http://i.imgur.com/ciJelTB.png). Before parsing those images, pandoc didn't return any errors so I assume images that are included using HTML <img> tag are parsed correctly by pandoc.

Full build log can be viewed here.

@donnemartin
Copy link
Owner

@addianto interesting approach, thanks for investigating it and reporting the results.

@dumindu @FilipMiletic I'll try to free up and check out Gitbook, thanks for the suggestion.

@AlexandreCarvalhoDeMelo

Thank you very much for the work, this is life changing information!
There's anyway i can donate to you?

@donnemartin
Copy link
Owner

@SuperAssassinNinja @anishshah44 I really appreciate the gesture! Please just donate to your favorite charity, thanks :)

@addianto
Copy link

I continued my previous experiment on using pandoc to automate PDF generation. The tool still failed to generate the PDF file.

The cause of error probably because the image files are linked from external source, i.e. from Imgur. Is it possible to locally host the images in the repository? @donnemartin

If anyone interested, you can see the build log here.

@addianto
Copy link

Did a quick other experiment using a Python module named m2pdf. Although it required several dependencies on Ubuntu, it can read the README file in this repository and successfully generated the PDF file.

The result is not quite right yet. Several images and tables are rendered incorrectly in the generated PDF document. See the example: https://imgur.com/a/SGdrK

@donnemartin
Copy link
Owner

Thanks for the update @addianto. I think hosting images in the repo is do-able. Good to hear that m2pdf is working quite well.

I'd like to explore the Gitbook path when I free up and compare the PDF result to m2pdf.

@elleryfamilia
Copy link

@WillDignazio I just used the Atom plugin "Markdown to PDF" and it did at Ok job. Too large a font size is the only issue I'm seeing.

@divyum
Copy link

divyum commented Mar 27, 2017

Hi @donnemartin, thanks for making such an informative guide.
I tried experimenting with Gitbook, have created a very basic draft here.
Looking for feedback/suggestions so that I can continue developing it.

P.S. Topics shall be empty. Its just how the doc will look like, will have to add data to respective topics and/or create nested topics based on requirement.

@donnemartin
Copy link
Owner

donnemartin commented Mar 28, 2017

Hi @divyum, thanks for prototyping Gitbook! This does look easier to digest than the current README and exercise solutions.

I'm not too familiar with Gitbook, it seems like I'd have to run Gitbook from my GitHub account so it auto-syncs with this repo?

Edited for clarity.

@canhlinh
Copy link

canhlinh commented Mar 28, 2017

Here you are
system-design-primer.pdf

@divyum
Copy link

divyum commented Mar 28, 2017

@donnemartin I tried auto-sync repo, the issue is that Gitbook merges complete README into a single topic which is like a single README in Gitbook :P. The only way I see is to manually move data into different topics.

I also tried making gitbook from gitbook-cli but seems it just gives you a basic structure and not automatically makes topic for each section (see here). We can also follow this structure and keep sections in different markdown files.

@donnemartin
Copy link
Owner

@canhlinh thanks for the PDF version! I updated the original post with a link to your comment.

@divyum thanks for the additional info! I hope to free up soon to better evaluate/help with Gitbook.

@myartsev
Copy link

Would be great to have a PDF as a github "release"

@hectorv
Copy link

hectorv commented Jun 3, 2019

Similar to #207, we could have something like this:

pandoc \
  --pdf-engine=xelatex \
  --toc -N \
  -V colorlinks -V urlcolor=NavyBlue -V toccolor=Red \
  -o system-design-primer.pdf \
  README.md

but it's not perfect, it still needs some tweaking.

@canhlinh
Copy link

I just generated the latest PDF here
system-design-primer.pdf

@dumindu
Copy link

dumindu commented Aug 18, 2021

If we can add these under releases, things will be more visible and accessible to all :)

@rcalixte
Copy link

rcalixte commented Dec 26, 2021

I just opened a PR for this.
A sample of the PDF that will be auto-generated once it is merged:
system-design-primer.pdf

Feedback would be greatly appreciated. 🤞🏽 🙏🏽

@onurusluca
Copy link

@canhlinh Could you please update the pdf? Thank you!

@mohammedouahman
Copy link

Thanks for sharing this informative pdf, can you please provide us how did you done that, because we need other versions of different languages as you know.

@dmitri-mamrukov
Copy link

Thanks for sharing this informative pdf, can you please provide us how did you done that, because we need other versions of different languages as you know.

You can run https://github.com/donnemartin/system-design-primer/blob/master/generate-epub.sh to generate an ePub, which can be converted to a PDF.

@arthurazs
Copy link

Latest README.pdf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.