From ba7c7150492ca8640d8600f58690a32e452f2447 Mon Sep 17 00:00:00 2001 From: Steve Losh Date: Thu, 14 Jan 2010 22:56:12 -0500 Subject: [PATCH] Add code styles. --- content/projects/hg-prompt.html | 5 ++- layout/_post.html | 8 +++- media/css/pygments-monokai-light.css | 60 ++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 media/css/pygments-monokai-light.css diff --git a/content/projects/hg-prompt.html b/content/projects/hg-prompt.html index 594615e..247d586 100644 --- a/content/projects/hg-prompt.html +++ b/content/projects/hg-prompt.html @@ -128,7 +128,7 @@ To put it in your bash prompt, edit your `~/.bashrc` file to include something like this: - #!bash + :::bash hg_ps1() { hg prompt "{ on {branch}}{ at {bookmark}}{status}" 2> /dev/null } @@ -139,11 +139,13 @@ repository or you won't see anything. This little prompt will give you something like this: + :::text steve at myhost in ~/src/hg-prompt on default at feature-bookmark? $ How about something a little more interesting? + :::bash hg_ps1() { hg prompt "{[+{incoming|count}]-->}{root|basename}{/{branch}}{-->[+{outgoing|count}]}{ at {bookmark}}{status}" 2> /dev/null } @@ -152,6 +154,7 @@ And the result (this example assumes one incoming changeset and two outgoing): + :::text [+1]-->hg-prompt/default-->[+2] at feature-bookmark steve at myhost in ~/src/hg-prompt $ diff --git a/layout/_post.html b/layout/_post.html index 83104f0..4df6d03 100644 --- a/layout/_post.html +++ b/layout/_post.html @@ -1,5 +1,11 @@ {% extends "skeleton/_base.html" %} +{% block extra_css %} + +{% endblock %} + {% block content %}

{{ page.title|safe|typogrify }}

@@ -11,7 +17,7 @@

{{ page.title|safe|typogrify }}

{% filter typogrify %} {% article %} {% filter typogrify %} - {% markdown toc def_list %} + {% markdown toc def_list codehilite %} {% block article %}{% endblock %} {% endmarkdown %} {% endfilter %} diff --git a/media/css/pygments-monokai-light.css b/media/css/pygments-monokai-light.css new file mode 100644 index 0000000..282bcc3 --- /dev/null +++ b/media/css/pygments-monokai-light.css @@ -0,0 +1,60 @@ +/* @override http://localhost:8080/media/css/pygments-monokai-light.css */ +.codehilite .hll { background-color: #49483e } +.codehilite .c { color: #75715e } /* Comment */ +.codehilite .err { color: #960050; background-color: #1e0010 } /* Error */ +.codehilite .k { color: #00a8c8} /* Keyword */ +.codehilite .l { color: #ae81ff } /* Literal */ +.codehilite .n { color: #111111 } /* Name */ +.codehilite .o { color: #f92672 } /* Operator */ +.codehilite .p { color: #111111 } /* Punctuation */ +.codehilite .cm { color: #75715e } /* Comment.Multiline */ +.codehilite .cp { color: #75715e } /* Comment.Preproc */ +.codehilite .c1 { color: #75715e } /* Comment.Single */ +.codehilite .cs { color: #75715e } /* Comment.Special */ +.codehilite .ge { font-style: italic } /* Generic.Emph */ +.codehilite .gs { font-weight: bold } /* Generic.Strong */ +.codehilite .kc { color: #00a8c8 } /* Keyword.Constant */ +.codehilite .kd { color: #00a8c8 } /* Keyword.Declaration */ +.codehilite .kn { color: #f92672 } /* Keyword.Namespace */ +.codehilite .kp { color: #00a8c8 } /* Keyword.Pseudo */ +.codehilite .kr { color: #00a8c8 } /* Keyword.Reserved */ +.codehilite .kt { color: #00a8c8 } /* Keyword.Type */ +.codehilite .ld { color: #d88200 } /* Literal.Date */ +.codehilite .m { color: #ae81ff } /* Literal.Number */ +.codehilite .s { color: #d88200} /* Literal.String */ +.codehilite .na { color: #75af00 } /* Name.Attribute */ +.codehilite .nb { color: #111111 } /* Name.Builtin */ +.codehilite .nc { color: #75af00 } /* Name.Class */ +.codehilite .no { color: #00a8c8 } /* Name.Constant */ +.codehilite .nd { color: #75af00 } /* Name.Decorator */ +.codehilite .ni { color: #111111 } /* Name.Entity */ +.codehilite .ne { color: #75af00 } /* Name.Exception */ +.codehilite .nf { color: #75af00} /* Name.Function */ +.codehilite .nl { color: #111111 } /* Name.Label */ +.codehilite .nn { color: #111111} /* Name.Namespace */ +.codehilite .nx { color: #75af00 } /* Name.Other */ +.codehilite .py { color: #111111 } /* Name.Property */ +.codehilite .nt { color: #f92672 } /* Name.Tag */ +.codehilite .nv { color: #111111 } /* Name.Variable */ +.codehilite .ow { color: #f92672 } /* Operator.Word */ +.codehilite .w { color: #111111 } /* Text.Whitespace */ +.codehilite .mf { color: #ae81ff } /* Literal.Number.Float */ +.codehilite .mh { color: #ae81ff } /* Literal.Number.Hex */ +.codehilite .mi { color: #ae81ff } /* Literal.Number.Integer */ +.codehilite .mo { color: #ae81ff } /* Literal.Number.Oct */ +.codehilite .sb { color: #d88200 } /* Literal.String.Backtick */ +.codehilite .sc { color: #d88200 } /* Literal.String.Char */ +.codehilite .sd { color: #d88200 } /* Literal.String.Doc */ +.codehilite .s2 { color: #d88200 } /* Literal.String.Double */ +.codehilite .se { color: #8045FF } /* Literal.String.Escape */ +.codehilite .sh { color: #d88200 } /* Literal.String.Heredoc */ +.codehilite .si { color: #d88200 } /* Literal.String.Interpol */ +.codehilite .sx { color: #d88200 } /* Literal.String.Other */ +.codehilite .sr { color: #d88200 } /* Literal.String.Regex */ +.codehilite .s1 { color: #d88200 } /* Literal.String.Single */ +.codehilite .ss { color: #d88200 } /* Literal.String.Symbol */ +.codehilite .bp { color: #111111 } /* Name.Builtin.Pseudo */ +.codehilite .vc { color: #111111 } /* Name.Variable.Class */ +.codehilite .vg { color: #111111 } /* Name.Variable.Global */ +.codehilite .vi { color: #111111 } /* Name.Variable.Instance */ +.codehilite .il { color: #ae81ff } /* Literal.Number.Integer.Long */ \ No newline at end of file