Last active
January 9, 2016 21:19
-
-
Save preaction/f453b7a447538eb08c68 to your computer and use it in GitHub Desktop.
Proposal for shell session highlighting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <pre><samp class="hljs">$ <kbd class="hljs-shell"><span class="hljs-keyword">echo</span> <span class="hljs-string">'hello'</span></kbd> | |
| hello | |
| </samp></pre> | |
| <pre><samp class="hljs">$ <kbd class="hljs-shell"><span class="hljs-keyword">git</span> <span class="hljs-option">-c</span> log <span class="hljs-option">-n2</span></kbd> | |
| <span class="ansi-fg-yellow">commit f12c3c0434f144ee09c0dcfda2a819600baad2a4</span> | |
| Author: Doug Bell <[email protected]> | |
| Date: Fri Jan 8 21:19:39 2016 -0600 | |
| add better error message when include not found | |
| Now the error also includes the directories that were searched when the | |
| include wasn't found. | |
| Refs #428 | |
| <span class="ansi-fg-yellow">commit f9286e730accafc5fa3da0fe74ac589ddf9ba27b</span> | |
| Author: Doug Bell <[email protected]> | |
| Date: Fri Jan 8 20:56:32 2016 -0600 | |
| add parent dir to includes when rendering document | |
| Now, documents can include other files in their directory directly. | |
| Previously, only files in the theme directory could be included by | |
| default. | |
| Fixes #428 | |
| </pre> | |
| <pre><samp class="hljs">$ <kbd class="hljs-shell"><span class="hljs-keyword">git</span> diff</kbd> | |
| <b>diff --git a/README.mkdn b/README.mkdn</b> | |
| <b>index 4fb06d6..4b83e15 100644</b> | |
| <b>--- a/README.mkdn</b> | |
| <b>+++ b/README.mkdn</b> | |
| <span class="ansi-fg-cyan">@@ -80,3 +80,4 @@</span> This software is copyright (c) 2016 by Doug Bell. | |
| This is free software; you can redistribute it and/or modify it under | |
| the same terms as the Perl 5 programming language system itself. | |
| <span class="ansi-fg-green">+</span><span class="ansi-fg-green">HELLO</span> | |
| </samp></pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %# Run a simple shell command and display the output | |
| %= system "echo 'hello'" | |
| %# Run "git log -n2" and colorize the output, using "$" for the prompt (the default) | |
| %= system --prompt => "$", "git log -n2" | |
| %# Highlight an entire shell run, with prompt lines starting with $ or # (the default) | |
| %= shell --prompt => "$|#", begin | |
| $ git diff | |
| [1mdiff --git a/README.mkdn b/README.mkdn[m | |
| [1mindex 4fb06d6..4b83e15 100644[m | |
| [1m--- a/README.mkdn[m | |
| [1m+++ b/README.mkdn[m | |
| [36m@@ -80,3 +80,4 @@[m [mThis software is copyright (c) 2016 by Doug Bell.[m | |
| [m | |
| This is free software; you can redistribute it and/or modify it under[m | |
| the same terms as the Perl 5 programming language system itself.[m | |
| [32m+[m[32mHELLO[m | |
| % end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment