system-design-primer icon indicating copy to clipboard operation
system-design-primer copied to clipboard

PDF Download

Open WillDignazio opened this issue 7 years ago • 23 comments

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.

WillDignazio avatar Mar 09 '17 02:03 WillDignazio

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

donnemartin avatar Mar 09 '17 03:03 donnemartin

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

dumindu avatar Mar 09 '17 04:03 dumindu

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

tinylucid avatar Mar 09 '17 09:03 tinylucid

@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.

addianto avatar Mar 10 '17 12:03 addianto

@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.

donnemartin avatar Mar 11 '17 02:03 donnemartin

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

AlexandreCarvalhoDeMelo avatar Mar 15 '17 20:03 AlexandreCarvalhoDeMelo

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

donnemartin avatar Mar 15 '17 23:03 donnemartin

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 avatar Mar 16 '17 03:03 addianto

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

addianto avatar Mar 16 '17 05:03 addianto

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.

donnemartin avatar Mar 16 '17 09:03 donnemartin

@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.

elleryfamilia avatar Mar 22 '17 04:03 elleryfamilia

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.

divyum avatar Mar 27 '17 20:03 divyum

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.

donnemartin avatar Mar 28 '17 11:03 donnemartin

Here you are system-design-primer.pdf

canhlinh avatar Mar 28 '17 12:03 canhlinh

@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.

divyum avatar Mar 28 '17 12:03 divyum

@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.

donnemartin avatar Mar 29 '17 10:03 donnemartin

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

myartsev avatar Jan 28 '19 21:01 myartsev

Similar to https://github.com/donnemartin/system-design-primer/pull/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.

hectorv avatar Jun 03 '19 03:06 hectorv

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

canhlinh avatar Aug 15 '21 10:08 canhlinh

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

dumindu avatar Aug 18 '21 04:08 dumindu

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. 🤞🏽 🙏🏽

rcalixte avatar Dec 26 '21 14:12 rcalixte

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

onurusluca avatar Jul 17 '23 17:07 onurusluca

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.

mohammedouahman avatar Oct 19 '23 21:10 mohammedouahman