gaearon / gitbook-plugin-prism

Gitbook plugin for Prism highlighting
Apache License 2.0
88 stars 26 forks source link

Breaks syntax highlighting in PDF :( #4

Closed paulkoegel closed 8 years ago

paulkoegel commented 9 years ago

Dan, since you introduced this plugin to redux's docs, the syntax highlighting in the offline versions is gone :(

before:

screen shot 2015-09-21 at 10 26 31

after:

screen shot 2015-09-21 at 10 29 40

checked the PDF and ePub. assume it's the same for mobi. any clue what might have caused this?

paulkoegel commented 9 years ago

JFYI: The HTML version (from gitbook serve) is fine for me.

gaearon commented 8 years ago

Can you please verify whether this is still an issue with 1.0.0 and the latest Redux master?

paulkoegel commented 8 years ago

Yeah, now it's working :)

screen shot 2015-10-05 at 14 14 01

thanks to you and @SamyPesse for fixing this!

just pushed a new release to paulkogel/redux-offline-docs: redux-documentation-2015-10-05.pdf

SamyPesse commented 8 years ago

Nice :sparkles: Why are you self generating all of this instead of just using gitbook.com ?

GitBook.com can build automatically the PDF, epub, mobi; you can have a custom domain name for the website; and it integrates perfectly with GitHub.

gaearon commented 8 years ago

I assumed it's paid or can't integrate with GH pages.

:-O

paulkoegel commented 8 years ago

Didn't know you can do this. Can we use it for free? Would you mind setting this up for us or point me to relevant documentation?

ah yes, very good point from Dan - will you be able to see the offline docs in the HTML version somehow? something like this (i believe this is a mockup i found somewhwere on the net):

Another thing i was wondering about is why the gitbook HTML versions don't support cache manifests. this would make them offline friendly out of the box :)

SamyPesse commented 8 years ago

@gaearon it's free for public documentation, it integrates with GitHub (not GH Pages), the doc will be hosted on gitbook.com and updated everytime you commit to GitHub (no need to manually update the gh-pages branch or anything).

@paulkogel We removed the cache manifest because it caused a lot of different issues (when testing, etc). It can easily be reimplemented by a plugin (I'll probably make one).

This download button in your screenshot can also be implemented by a plugin (I'll also make one for this ^^), I'm currently working on new APIs for plugins (https://github.com/GitbookIO/gitbook/pull/964) to make this kind of thing easy to do.

It's really easy to setup this documentation on gitbook.com:

  1. Create an account on gitbook.com
  2. Click to create a book
    • Select the GitHub tab to import a book
    • Authorize GitBook to access your public books
    • Select the GH rpeository
  3. The book is now created and imported!
  4. Everytime you commit to GH, it'll trigger a build on GitBook
  5. You can setup custom domains, ...

Let mw know if you need more help; feel free to join our Slack community to chat about this (https://slack.gitbook.com)

paulkoegel commented 8 years ago

@gaearon: overview of Gitbook redux docs with PDF,... download links: https://www.gitbook.com/book/paulkogel/redux-docs/ web version: https://paulkogel.gitbooks.io/redux-docs/content/

using gitbook should be the easiest thing for the project - won't need to create the PDFs ever again and they'll always be up to date. the doc's URL would change from github.io to gitbook.io, but that should be fine. what do you think? (rest is mostly for @SamyPesse, so you can stop reading if you want)


@SamyPesse thanks for your instructions!

some feedback:

  1. don't want to connect with my github account since gitbook is asking for organisation. picked the "import" tab instead and imported the official rackt/redux repo.
  2. found it very confusing that the stuff in the tabs at the bottom of the overview page (https://www.gitbook.com/book/paulkogel/redux-docs/) isn't the actual book. there's a ToC but the links don't work. in the first tab, it shows a preview of my book but all the links lead back to github :(

took me a while to discover the buttons at the top - you tend to ignore the header stuff when it looks like the content you're looking for starts at the bottom.

  1. PDF looks fine. smaller font size than mine and hence 60 pages less, but that should be fine.
  2. thanks for the great service :) this can save us some headaches and help keep the docs up to date!
SamyPesse commented 8 years ago

@paulkogel nice :+1: Thanks for the feedback.

don't want to connect with my github account since gitbook is asking for organisation. picked the "import" tab instead and imported the official rackt/redux repo.

If you don't want to connect a GitHub account, you can manually push the docs:

$ git push https://git.gitbook.com/paulkogel/redux-docs.git --force

Then manually add the webhook to the GitHub repository: https://git.gitbook.com/github?book= {bookID}&username={username}&token={apiToken} (The apiToken can be found in your account settings).

found it very confusing that the stuff in the tabs at the bottom of the overview page (https://www.gitbook.com/book/paulkogel/redux-docs/) isn't the actual book. there's a ToC but the links don't work. in the first tab, it shows a preview of my book but all the links lead back to github :(

The details page only contains the README (like on GitHub). The links lead back to GitHub because you are using absolute urls in your README.md, relative links will be resolved to the GitBook's content.

PDF looks fine. smaller font size than mine and hence 60 pages less, but that should be fine.

We are using the same gitbook pdf command with the latest version of GitBook, so it depends on which version you were using before. I'm working on a big improvements for PDF output: https://github.com/GitbookIO/gitbook/pull/959