Skip to content
This repository has been archived by the owner on Oct 24, 2021. It is now read-only.

Publish a PDF version of the guide #166

Closed
serkandurusoy opened this issue Dec 17, 2015 · 32 comments
Closed

Publish a PDF version of the guide #166

serkandurusoy opened this issue Dec 17, 2015 · 32 comments

Comments

@serkandurusoy
Copy link

Today I was happily surprized to see the number of articles published on the guide.

I decided to take a plunge and check to see if there are any interesting new patterns that I can make use of myself. But I quickly missed the taste of paper on my fingertips when I get sifting through pages of a great book!

When I first started meteor, I purchased all the books out there. The ones I could only get a soft copy of, I printed them. (I know I know, but I'll save some trees using the new vast knowledge I'm getting myself acquainted with) Sometimes I print extra pages and post them on a wall. Sometimes I just print zoomed-in sections as cuecards to keep handy.

So the point is, the screen has only so much space for reading learning material and it would just be awesome if there were a pdf version of the guide for download.

@Slava
Copy link
Contributor

Slava commented Dec 17, 2015

Google Chrome (and I believe other browsers too) have an ability "to print" the page to a pdf file.

@serkandurusoy
Copy link
Author

That ability is insufficient in many ways.

For one, it requires browsing each individual article.

Furthermore, if there are no explicitly set print-friendly styles, the resulting document does not represent the feel of a book, which defeats the whole purpose.

Margins, page breaks, code snippets, headings etc often look too wonky to be viewed as learning material.

@stubailo stubailo changed the title PDF export functionality Publish a PDF version of the guide Dec 17, 2015
@stubailo
Copy link
Contributor

Do you know any services we could use to generate it? It is probably just a matter of having a separate print CSS and then calling out to some service.

@serkandurusoy
Copy link
Author

There apparently are lots of API based services

I guess that could be incorporated into the hexo publish workflow

@stubailo
Copy link
Contributor

@dominicnguyen if you want, you could take a stab at making some nice print CSS - could be a good start to the fancy book effort!

@serkandurusoy
Copy link
Author

Great!

Apart from his visual genius, I'd also suggest some care for

  • page numbering (css counter property can help)
  • page-breaks (clear separation of sections as well as sacrificing some space in favor of intact blocks of paragraphs or code where appropriate/relevant)
  • testing on A4 (international standard) rather than letter (US standard)
  • switching out font-icons (if any) with their png counterparts (this is for better compatibility)

@stubailo
Copy link
Contributor

I don't think we currently have any icons, so that won't be a problem.

I bet a lot of the other stuff could be fixed by converting Markdown -> LaTeX using pandoc or similar. Maybe then we don't actually need any CSS.

@serkandurusoy
Copy link
Author

Cool, LaTeX indeed does address such concerns, but then I find formatting LaTeX documents rather (much) harder than writing print styles :)

@stubailo
Copy link
Contributor

I guess the hope is that the default formatting can be good enough :P as an added bonus we can submit our work to an academic paper more easily...

@serkandurusoy
Copy link
Author

👍

@stubailo
Copy link
Contributor

stubailo commented Jan 8, 2016

So I tried wkhtmltopdf, and everything is great... except for some reason everything is italic. No idea why.

@serkandurusoy
Copy link
Author

I searched the repo but could not find a reference to wkhtmltopdf

I'd be happy to lend a second set of eyes if you can let me in on where you're doing the conversion.

@stubailo
Copy link
Contributor

stubailo commented Jan 8, 2016

Oh this was just me locally installing that program and typing some stuff in the terminal. Basically, all we need is some sort of command line tool that will work, then we can integrate it into the build process.

@serkandurusoy
Copy link
Author

Oh, ok. Let me know if you need anything.

@necmettin
Copy link

I'm not sure if you guys are aware, so here it goes:

There is https://github.com/alanshaw/markdown-pdf
And a recipe to merge multiple markdown files into a single pdf: https://github.com/alanshaw/markdown-pdf#concat-from-multiple-paths-to-single-path

@serkandurusoy
Copy link
Author

This does look cool and hackable!

@kwgainey
Copy link

I can't play with it tonight, but I think it's possible to clone the repo and then use GitBook.com to set it up as an ebook for downloading in various formats, including PDF. Please correct me if that's not possible. I'll try to play with it tomorrow and see what I can do. I like dead trees sometimes, too.

@kwgainey
Copy link

Okay, so technically I lied. I did play with the formatting on GitBook tonight. You can download a copy of the PDF here: https://www.gitbook.com/book/kwgainey/meteorguide/details. As I state at that link, I'm not associated with MDG, just wanted to make the guide available in PDF format. Enjoy.

@serkandurusoy
Copy link
Author

This looks cool! Can we integrate that into our build process?

@kwgainey
Copy link

Right now, I don't have it linked to the GitHub repository for updates, but it can be setup to build the PDF on commits.

@kvetoslavnovak
Copy link

I am trying to make a GitBook linked to the GitHub repository for updates. But it seems rather tricky and the GitBook documentation is not really helpful.

@kwgainey
Copy link

@kvetoslavnovak I had problems trying to link GitBook directly to GH repository updates as well. :(

@stubailo
Copy link
Contributor

GitBook definitely has its fair share of issues.

@kvetoslavnovak
Copy link

OK. I had success to build Gitbook version of the book which automatically updates from Github - https://www.gitbook.com/book/kvetoslavnovak/the-gitbook-meteor-guide/details

I had to fork the official Github meteor/guide repo to my ( https://github.com/kvetoslavnovak/GitBook-Meteor-Guide ) to approve access of Gitbook to Github.

@stubailo best way would be if MDG opens its own Gitbook account.

  • when creating new book go to SETTINGS - Github tab and add meteor/guide repo link and save. Webhook URL will be generated
  • then you have to copy Webhook URL from Gitbook and insert it nito Github meteor/guide repo Settings - Webhooks & services. There click Add webhook button and paste link into Payload URL and save. This should enable automatic read of updates from Github into Gitbook
  • go back to Gitbook and start editing the book, the source files should be built and generated automatically from Github when you start
  • the only thing you have to do is to open SUMMARY.md file in your book tree structure and paste this content that I have already created https://jsfiddle.net/x7g6doLr/ This is how content of the Gitbook is generated from Github meteor/guide content files OR just merge my reguest to add the SUMMARY.md file directly here.

There may be some formatting issues (I have noticed only chapter headings and descriptions to look strange). But I would recommend to have the Gitbook as a "dumb component" so you will only take care of Github version of the Guide. Maybe you can try to play with formatting in Github and see how it reflects in Gitbook.

If you add any chapters in the future to the Guide you should update SUMMARY.md accordingly.

EDIT: I have added SUMMARY.md file request #366 for possible merge directly here instead of upload it into Gitbook

@stubailo
Copy link
Contributor

I think it's really bad for SEO to have duplicated content here and on GitBook, but using it as part of a PDF build process makes a lot of sense. I wonder if that's part of the GitBook open source tool, or if it's only available through their service.

The web UI of GitBook I think is a pretty big step down from the Guide right now - we don't get the table of contents, embedded forum thread, it is much slower to load, and we don't have analytics. So I would be very strongly against switching to GitBook for the main site.

@kvetoslavnovak
Copy link

I definitly agree. There is very easy solution:

  • Make Gitbook book private so it is available on GitBook only for you
  • Use GitBook only to download automaticaly generated pdf, epud and mobi versions
  • Upload them on the Meteor Guide website
  • Provide links to these versions on Meteor Guide page itself

@stubailo
Copy link
Contributor

Excited to see if this approach works! We'll try to get on it in the next few days.

@matheusjardimb
Copy link

matheusjardimb commented Dec 7, 2016

any solutions on this one?

@yvan-sraka
Copy link
Contributor

yvan-sraka commented Dec 9, 2016

pandoc could also be a good tool to automated Markdown to Latex to PDF conversion 😉!

@Falieson
Copy link

Falieson commented Jun 18, 2017

About to go on a long flight, I wish I could download a pdf of the guide!

@abernix
Copy link
Contributor

abernix commented Jun 19, 2017

@Falieson I imagine you've probably already taken your flight, but as a suggestion to others, the "Dash" app from Kapeli has (up to date!) Meteor docs as one of their downloadable options – it works offline!

This isn't the solution to this issue necessarily, but an option!

@filipenevola
Copy link
Collaborator

I'm closing this issue because it's too old.

We are going to make many updates to the guide in the next weeks and it's better to focus on issues with recent activity. If you think this issue is still relevant please open a new one.

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

No branches or pull requests