Skip to content

Instantly share code, notes, and snippets.

@stengland
Last active December 14, 2015 09:28
Show Gist options
  • Select an option

  • Save stengland/5065013 to your computer and use it in GitHub Desktop.

Select an option

Save stengland/5065013 to your computer and use it in GitHub Desktop.
Render and open markdown
#!/bin/sh
TFILE=`tempfile -s .html`
echo '<link href="https://gist.github.com/stengland/5065514/raw/markdown.css" rel="stylesheet" type="text/css" />' >> $TFILE
marked $1 >> $TFILE &&
xdg-open $TFILE
@stengland

Copy link
Copy Markdown
Author

Uses https://github.com/chjj/marked for Git Hub flavoured markdown

@chrismytton

Copy link
Copy Markdown

@stengland This looks very handy! Have you seen GitHub's markdown API? It would remove the node dependency, but I guess it adds a network dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment