GRIPHOME
Specify an alternative settings.py location, "~/.grip" by default.
Preview github markdown files like readme locally
grip [options]
[PATH]
[ADDRESS]
Grip is a command-line server application written in Python that uses the GitHub markdown API to render a local readme file. The styles come directly from GitHub, so you'll know exactly how it will appear. Changes you make to the Readme will be instantly reflected in the browser without requiring a page refresh.
Privacy notice: by default all documents will be sent to GitHub (Microsoft).
PATH is a file to render or a directory containing README.md. Use - for stdin.
ADDRESS is what to listen on, of the form HOST[:PORT], or just PORT
--user-content
Render as user-content like comments or issues.
--context=<repo>
The repository context, only taken into account when using --user-content.
--user=<username>
A GitHub username for API authentication. If used without the --pass option, an upcoming password input will be necessary.
--pass=<password>
A GitHub password or auth token for API auth.
--wide
Renders wide, i.e. when the side nav is collapsed.
--clear
Clears the cached styles and assets and exits.
--export
Exports to <path>.html or README.md instead of serving, optionally using [<address>] as the out file (- for stdout).
--no-inline
Link to styles instead inlining when using --export.
-b --browser
Open a tab in the browser after the server starts.
--api-url=<url>
Specify a different base URL for the github API, for example that of a Github Enterprise instance. Default is the public API: https://api.github.com
--title=<title>
Manually sets the page's title. The default is the filename.
--norefresh
Do not automatically refresh the Readme content when the file changes.
--quiet
Do not print to the terminal.
-V, --version
Version info.
-h, --help
Show help message and exit.
GRIPHOME
Specify an alternative settings.py location, "~/.grip" by default.
GRIPURL
The URL of the Grip server, "/__/grip" by default.
To render the readme of a repository:
$ grip
Now open a browser and visit http://localhost:6419. Or run with -b and Grip will open a new browser tab for you.
You can also specify a port:
$ grip 80
Or an explicit file:
$ grip AUTHORS.md
Alternatively, you could just run grip and visit http://localhost:6419/AUTHORS.md since Grip supports relative URLs.
You can combine the previous examples:
$ grip AUTHORS.md 80
Or specify a hostname instead of a port.:
$ grip CHANGES.md 0.0.0.0
Or provide both:
$ grip . 0.0.0.0:80
You can even bypass the server and export to a single HTML file, with all the styles and assets inlined:
$ grip --export
Control the output name with the second argument:
$ grip README.md --export readme.html
If you're exporting a bunch of files, you can prevent styles from being inlined to save space with --no-inline:
$ grip README.md --export --no-inline introduction.html
Reading from stdin:
$ cat README.md | grip -
Writing to stdout:
$ grip AUTHORS.md --export - | bcat
And both is also supported, allowing you to use Grip with other programs:
$ cat README.md | grip --export - | less
Rendering as user-content like comments and issues is also supported, with an optional repository context for linking to issues:
$ grip --user-content --context=joeyespo/grip
8 releases since Debian 2.2 (Potato); the text changed 6 times.
--api-url since Debian 9 (Stretch);
--browser since Debian 9 (Stretch);
--clear since Debian 9 (Stretch);
--context since Debian 9 (Stretch);
--export since Debian 9 (Stretch);
--help since Debian 4.0 (Etch);
--no-inline since Debian 9 (Stretch);
--norefresh since Debian 9 (Stretch);
--pass since Debian 9 (Stretch);
--quiet since Debian 9 (Stretch);
--title since Debian 9 (Stretch);
--user since Debian 9 (Stretch);
--user-content since Debian 9 (Stretch);
--version since Debian 4.0 (Etch);
--wide since Debian 9 (Stretch);
-V since Debian 9 (Stretch);
-b since Debian 9 (Stretch);
-h since Debian 9 (Stretch).
--class until Debian 5.0 (Lenny);
--config until Debian 5.0 (Lenny);
--device until Debian 5.0 (Lenny);
--disable-crash-dialog until Debian 5.0 (Lenny);
--disable-sound until Debian 5.0 (Lenny);
--display until Debian 5.0 (Lenny);
--enable-sound until Debian 5.0 (Lenny);
--espeaker until Debian 5.0 (Lenny);
--g-fatal-warnings until Debian 5.0 (Lenny);
--gdk-debug until Debian 5.0 (Lenny);
--gdk-no-debug until Debian 5.0 (Lenny);
--geometry until Debian 5.0 (Lenny);
--gtk-debug until Debian 5.0 (Lenny);
--gtk-module until Debian 5.0 (Lenny);
--gtk-no-debug until Debian 5.0 (Lenny);
--local until Debian 5.0 (Lenny);
--name until Debian 5.0 (Lenny);
--no-redirect until Debian 5.0 (Lenny);
--oaf-activate-iid until Debian 5.0 (Lenny);
--oaf-ior-fd until Debian 5.0 (Lenny);
--oaf-private until Debian 5.0 (Lenny);
--screen until Debian 5.0 (Lenny);
--scsi-device until Debian 5.0 (Lenny);
--sm-client-id until Debian 5.0 (Lenny);
--sm-config-prefix until Debian 5.0 (Lenny);
--sm-disable until Debian 5.0 (Lenny);
--small until Debian 5.0 (Lenny);
--sync until Debian 5.0 (Lenny);
--usage until Debian 5.0 (Lenny);
--verbose until Debian 5.0 (Lenny);
-? until Debian 5.0 (Lenny).