Skip to content

Instantly share code, notes, and snippets.

@hjacobs
Created October 26, 2017 20:22
Show Gist options
  • Save hjacobs/9ac697bc71b8c7705c2b2442bd5a09c3 to your computer and use it in GitHub Desktop.
Save hjacobs/9ac697bc71b8c7705c2b2442bd5a09c3 to your computer and use it in GitHub Desktop.

Revisions

  1. hjacobs created this gist Oct 26, 2017.
    8 changes: 8 additions & 0 deletions bash2html.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/usr/bin/env python3
    import sys

    from pygments import highlight
    from pygments.lexers import BashLexer
    from pygments.formatters import HtmlFormatter

    print(highlight(sys.stdin.read(), BashLexer(), HtmlFormatter(full=True)))