I have been waiting a program like grip for a long time, I know eventually there would be one.
It runs on http://localhost:5000/ by default, which can be change, the complete usage:
$ grip -h Usage: grip [options] [<path>] [<address>] grip -h | --help grip --version Where: <path> is a file to render or a directory containing a README.md file <address> is what to listen on, of the form <host>[:<port>], or just <port> Options: --gfm Use GitHub-Flavored Markdown, e.g. comments or issues --context=<repo> The repository context, only taken into account with --gfm --user=<username> A GitHub username for API authentication --pass=<password> A GitHub password for API authentication --export Exports to <path>.html or README.md instead of serving
It is like Python SimpleHTTPServer, but specially configured for GitHub README or any Markdown it serves. You can see it downloads GitHub webfont and CSS files in the logging, for example:
$ grip * Running on http://localhost:5000/ 127.0.0.1 - - [02/May/2014 10:40:26] "GET / HTTP/1.1" 200 - 127.0.0.1 - - [02/May/2014 10:40:26] "GET /cache/github-80eca8621f5e790aebb1d558c185d4767fd8ba8b.css HTTP/1.1" 304 - 127.0.0.1 - - [02/May/2014 10:40:26] "GET /cache/github2-643f7bf5b9562759c1f7b8135b2d4f1a503bb5bd.css HTTP/1.1" 304 - 127.0.0.1 - - [02/May/2014 10:41:26] "GET /assets/octicons-a87554e18586f5215a57fa67c9421a3e088aeafa.woff HTTP/1.1" 404 - 127.0.0.1 - - [02/May/2014 10:41:26] "GET /assets/octicons-1a9fcfe5c5246787653e20667b04f5fd666e8884.ttf HTTP/1.1" 404 -
It will look for README.md and serves it as default page, if you don’t tell it something else. Note that other markup would not work, such as README.rst can’t be served. This project is only for Markdown.
grip is written by Joe Esposito under the MIT License, currently git-fc80db8480ce79391de64cd0ce76cbe5d3868d6c (2014-04-28, post v2.0.0 (2013-09-27)). It depends on Flask, Jinja2, Markdown, Pygments, and 6 more.
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.