How to print from GitHub

前端 未结 20 1157
伪装坚强ぢ
伪装坚强ぢ 2021-01-29 20:17

If I want to print a markdown file from GitHub as it appears on screen, for example: https://github.com/RestKit/RestKit/blob/master/Docs/Object%20Mapping.md

Then how can

相关标签:
20条回答
  • 2021-01-29 20:36

    clone the repo

    gem install bluecloth
    
    • render the markdown files into html
    • open file on your filesystem in your browser
    • print from your browser

    http://deveiate.org/projects/BlueCloth

    you can find examples of the api here: http://deveiate.org/projects/BlueCloth/browser/spec/bluecloth_spec.rb

    0 讨论(0)
  • 2021-01-29 20:37

    http://github.com/github/markup

    You don't mention a language preference, but this is the Ruby library GitHub itself uses to render the markup files. It has the advantage of supporting the various markups GitHub supports (textile, rdoc etc). Rendering .markdown files has a dependency on the redcarpet markdown parser:

    http://github.com/tanoku/redcarpet

    0 讨论(0)
  • 2021-01-29 20:37

    I used MarkdownPad and printed the HTML to a PDF writer. If you have Pro you can export to PDF directly.

    0 讨论(0)
  • 2021-01-29 20:39

    Simple Hack:

    I've been opening the markdown file in something like Marked or the online tool Dillinger and then print from there. Some of these tools allow you to set the formatting to Github or other styles.

    A better way:

    Since I first wrote the above answer I found a better way:

    I've discovered a better way than what I said earlier.

    1. Git clone your wiki to a local directory
    2. Use gitbook & Calibre's ebook-convert to generate the PDF as per the instructions in https://github.com/GitbookIO/gitbook

      • On the Mac, you have to symlink the ebook-convert from within the /Application/calibre.app directory to someplace suitable before running the gitbook pdf command, with a command like:

      ln -s /Applications/calibre.app/Contents/console.app/Contents/MacOS/ebook-convert /usr/local/bin

    0 讨论(0)
  • 2021-01-29 20:41

    Try grip.

    pip install grip
    grip markdown.md
    

    Then it is hosted on a local port. You can then print or save to PDF through your native OS print dialog from your favourite browser.

    See here.

    0 讨论(0)
  • 2021-01-29 20:42

    Simply convert MD file into PDF

    You may download your .md file and upload it here to convert it into a pdf file. Which you can easily print.

    0 讨论(0)
提交回复
热议问题