Skip to content

Instantly share code, notes, and snippets.

@preaction
Last active January 9, 2016 21:19
Show Gist options
  • Select an option

  • Save preaction/f453b7a447538eb08c68 to your computer and use it in GitHub Desktop.

Select an option

Save preaction/f453b7a447538eb08c68 to your computer and use it in GitHub Desktop.
Proposal for shell session highlighting
<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>
%# 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
diff --git a/README.mkdn b/README.mkdn
index 4fb06d6..4b83e15 100644
--- a/README.mkdn
+++ b/README.mkdn
@@ -80,3 +80,4 @@ 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.
+HELLO
% end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment