donnemartin / system-design-primer

Learn how to design large-scale systems. Prep for the system design interview. Includes Anki flashcards.
Other
272.35k stars 45.92k forks source link

PDF Download #4

Open WillDignazio opened 7 years ago

WillDignazio commented 7 years ago

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 commented 7 years ago

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

dumindu commented 7 years ago

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

tinylucid commented 7 years ago

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

addianto commented 7 years ago

@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 commented 7 years ago

@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 commented 7 years ago

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

donnemartin commented 7 years ago

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

addianto commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Here you are system-design-primer.pdf

divyum commented 7 years ago

@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 commented 7 years ago

@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 commented 5 years ago

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

hectorv commented 5 years ago

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.

canhlinh commented 3 years ago

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

dumindu commented 3 years ago

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

rcalixte commented 2 years ago

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 commented 1 year ago

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

mohammedouahman commented 11 months ago

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 commented 2 months ago

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 commented 2 months ago

Latest README.pdf