diff --git a/dpaste/static/dpaste/theme.css b/dpaste/static/dpaste/theme.css index af8f01c..42aed6c 100644 --- a/dpaste/static/dpaste/theme.css +++ b/dpaste/static/dpaste/theme.css @@ -142,11 +142,12 @@ h1, h2, h3, h4 { } .snippet-rendered { - color: #555; + color: #666; font-size: 16px; - line-height: 1.5em; - max-width: 700px; - font-family: Georgia, Palatino, "Palatino Linotype", FreeSerif, serif; + line-height: 24px; + max-width: 620px; + font-family: Helvetica, FreeSerif, serif; + font-weight: 300; } div.tree{ @@ -195,27 +196,114 @@ div.tree div.submit input{ } /* ---------------------------------------------------------------------------- - Pre + .code ---------------------------------------------------------------------------- */ +.code { + background: #232829; + color: #f8f8f2; + padding: 20px 30px !important; + border-radius: 0; + padding: 20px 30px; + font-family: Monaco,Menlo,Consolas,"Courier New",monospace; +} -ol.linenums { +.code.wordwrap { + overflow: auto; + white-space: nowrap; +} + +.code ol { margin: 0 0 0 45px; } -ol.linenums li { +.code ol li { color: #aaa; font-size: 12px; - line-height: 20px; + line-height: 21px; cursor: pointer; padding-left: 5px; } -ol.linenums li.marked { +.code ol li.marked { color: #f4e009; background-color: #4f4800; + margin-right: -30px; + padding-right: 30px; } +/* ---------------------------------------------------------------------------- + Pygments +---------------------------------------------------------------------------- */ + +.code .gd { background-color: rgba(226, 12, 19, .3); color: #fff; display: block; } +.code .gi { background-color: rgba(23, 189, 10, .2); color: #fff; display: block; } + +.code .hll { background-color: #49483e } +.code .c { color: #75715e } /* Comment */ +.code .err { color: #960050; background-color: #1e0010 } /* Error */ +.code .k { color: #66d9ef } /* Keyword */ +.code .l { color: #ae81ff } /* Literal */ +.code .n { color: #f8f8f2 } /* Name */ +.code .o { color: #f92672 } /* Operator */ +.code .p { color: #f8f8f2 } /* Punctuation */ +.code .cm { color: #75715e } /* Comment.Multiline */ +.code .cp { color: #75715e } /* Comment..codeproc */ +.code .c1 { color: #75715e } /* Comment.Single */ +.code .cs { color: #75715e } /* Comment.Special */ +.code .ge { font-style: italic } /* Generic.Emph */ +.code .gs { font-weight: bold } /* Generic.Strong */ +.code .kc { color: #66d9ef } /* Keyword.Constant */ +.code .kd { color: #66d9ef } /* Keyword.Declaration */ +.code .kn { color: #f92672 } /* Keyword.Namespace */ +.code .kp { color: #66d9ef } /* Keyword.Pseudo */ +.code .kr { color: #66d9ef } /* Keyword.Reserved */ +.code .kt { color: #66d9ef } /* Keyword.Type */ +.code .ld { color: #e6db74 } /* Literal.Date */ +.code .m { color: #ae81ff } /* Literal.Number */ +.code .s { color: #e6db74 } /* Literal.String */ +.code .na { color: #a6e22e } /* Name.Attribute */ +.code .nb { color: #f8f8f2 } /* Name.Builtin */ +.code .nc { color: #a6e22e } /* Name.Class */ +.code .no { color: #66d9ef } /* Name.Constant */ +.code .nd { color: #a6e22e } /* Name.Decorator */ +.code .ni { color: #f8f8f2 } /* Name.Entity */ +.code .ne { color: #a6e22e } /* Name.Exception */ +.code .nf { color: #a6e22e } /* Name.Function */ +.code .nl { color: #f8f8f2 } /* Name.Label */ +.code .nn { color: #f8f8f2 } /* Name.Namespace */ +.code .nx { color: #a6e22e } /* Name.Other */ +.code .py { color: #f8f8f2 } /* Name.Property */ +.code .nt { color: #f92672 } /* Name.Tag */ +.code .nv { color: #f8f8f2 } /* Name.Variable */ +.code .ow { color: #f92672 } /* Operator.Word */ +.code .w { color: #f8f8f2 } /* Text.Whitespace */ +.code .mf { color: #ae81ff } /* Literal.Number.Float */ +.code .mh { color: #ae81ff } /* Literal.Number.Hex */ +.code .mi { color: #ae81ff } /* Literal.Number.Integer */ +.code .mo { color: #ae81ff } /* Literal.Number.Oct */ +.code .sb { color: #e6db74 } /* Literal.String.Backtick */ +.code .sc { color: #e6db74 } /* Literal.String.Char */ +.code .sd { color: #e6db74 } /* Literal.String.Doc */ +.code .s2 { color: #e6db74 } /* Literal.String.Double */ +.code .se { color: #ae81ff } /* Literal.String.Escape */ +.code .sh { color: #e6db74 } /* Literal.String.Heredoc */ +.code .si { color: #e6db74 } /* Literal.String.Interpol */ +.code .sx { color: #e6db74 } /* Literal.String.Other */ +.code .sr { color: #e6db74 } /* Literal.String.Regex */ +.code .s1 { color: #e6db74 } /* Literal.String.Single */ +.code .ss { color: #e6db74 } /* Literal.String.Symbol */ +.code .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ +.code .vc { color: #f8f8f2 } /* Name.Variable.Class */ +.code .vg { color: #f8f8f2 } /* Name.Variable.Global */ +.code .vi { color: #f8f8f2 } /* Name.Variable.Instance */ +.code .il { color: #ae81ff } /* Literal.Number.Integer.Long */ + + +/* ---------------------------------------------------------------------------- + Mobile +---------------------------------------------------------------------------- */ + @media (max-width: 580px) { .form-options-expire { float: left; @@ -223,78 +311,3 @@ ol.linenums li.marked { margin-top: 10px; } } - -/* ---------------------------------------------------------------------------- - Pygments ----------------------------------------------------------------------------- */ - -pre { - background: #232829; - color: #f8f8f2; - padding: 10px 15px 10px 0; - border-radius: 0; - padding: 20px 30px; -} - -pre .gd { background-color: rgba(226, 12, 19, .3); color: #fff; display: block; } -pre .gi { background-color: rgba(23, 189, 10, .2); color: #fff; display: block; } - -pre .hll { background-color: #49483e } -pre .c { color: #75715e } /* Comment */ -pre .err { color: #960050; background-color: #1e0010 } /* Error */ -pre .k { color: #66d9ef } /* Keyword */ -pre .l { color: #ae81ff } /* Literal */ -pre .n { color: #f8f8f2 } /* Name */ -pre .o { color: #f92672 } /* Operator */ -pre .p { color: #f8f8f2 } /* Punctuation */ -pre .cm { color: #75715e } /* Comment.Multiline */ -pre .cp { color: #75715e } /* Comment.Preproc */ -pre .c1 { color: #75715e } /* Comment.Single */ -pre .cs { color: #75715e } /* Comment.Special */ -pre .ge { font-style: italic } /* Generic.Emph */ -pre .gs { font-weight: bold } /* Generic.Strong */ -pre .kc { color: #66d9ef } /* Keyword.Constant */ -pre .kd { color: #66d9ef } /* Keyword.Declaration */ -pre .kn { color: #f92672 } /* Keyword.Namespace */ -pre .kp { color: #66d9ef } /* Keyword.Pseudo */ -pre .kr { color: #66d9ef } /* Keyword.Reserved */ -pre .kt { color: #66d9ef } /* Keyword.Type */ -pre .ld { color: #e6db74 } /* Literal.Date */ -pre .m { color: #ae81ff } /* Literal.Number */ -pre .s { color: #e6db74 } /* Literal.String */ -pre .na { color: #a6e22e } /* Name.Attribute */ -pre .nb { color: #f8f8f2 } /* Name.Builtin */ -pre .nc { color: #a6e22e } /* Name.Class */ -pre .no { color: #66d9ef } /* Name.Constant */ -pre .nd { color: #a6e22e } /* Name.Decorator */ -pre .ni { color: #f8f8f2 } /* Name.Entity */ -pre .ne { color: #a6e22e } /* Name.Exception */ -pre .nf { color: #a6e22e } /* Name.Function */ -pre .nl { color: #f8f8f2 } /* Name.Label */ -pre .nn { color: #f8f8f2 } /* Name.Namespace */ -pre .nx { color: #a6e22e } /* Name.Other */ -pre .py { color: #f8f8f2 } /* Name.Property */ -pre .nt { color: #f92672 } /* Name.Tag */ -pre .nv { color: #f8f8f2 } /* Name.Variable */ -pre .ow { color: #f92672 } /* Operator.Word */ -pre .w { color: #f8f8f2 } /* Text.Whitespace */ -pre .mf { color: #ae81ff } /* Literal.Number.Float */ -pre .mh { color: #ae81ff } /* Literal.Number.Hex */ -pre .mi { color: #ae81ff } /* Literal.Number.Integer */ -pre .mo { color: #ae81ff } /* Literal.Number.Oct */ -pre .sb { color: #e6db74 } /* Literal.String.Backtick */ -pre .sc { color: #e6db74 } /* Literal.String.Char */ -pre .sd { color: #e6db74 } /* Literal.String.Doc */ -pre .s2 { color: #e6db74 } /* Literal.String.Double */ -pre .se { color: #ae81ff } /* Literal.String.Escape */ -pre .sh { color: #e6db74 } /* Literal.String.Heredoc */ -pre .si { color: #e6db74 } /* Literal.String.Interpol */ -pre .sx { color: #e6db74 } /* Literal.String.Other */ -pre .sr { color: #e6db74 } /* Literal.String.Regex */ -pre .s1 { color: #e6db74 } /* Literal.String.Single */ -pre .ss { color: #e6db74 } /* Literal.String.Symbol */ -pre .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ -pre .vc { color: #f8f8f2 } /* Name.Variable.Class */ -pre .vg { color: #f8f8f2 } /* Name.Variable.Global */ -pre .vi { color: #f8f8f2 } /* Name.Variable.Instance */ -pre .il { color: #ae81ff } /* Literal.Number.Integer.Long */ diff --git a/dpaste/templates/dpaste/about.html b/dpaste/templates/dpaste/about.html index 9201b3f..aa7d730 100644 --- a/dpaste/templates/dpaste/about.html +++ b/dpaste/templates/dpaste/about.html @@ -19,8 +19,9 @@
+
- #!/usr/bin/env python
- import urllib
- import urllib2
- import sys
- def paste_code():
- request = urllib2.Request(
- 'https://dpaste.de/api/',
- urllib.urlencode([('content', sys.stdin.read())]),
- )
- response = urllib2.urlopen(request)
- # Strip surrounding quotes (NB: response has no trailing newline)
- print response.read()[1:-1]
- if __name__ == '__main__':
- paste_code()
Save this script in /usr/local/bin/dpaste
and chmod +x ..filepath
.
Usage: cat foo.txt | dpaste
+{% load dpaste_tags %}{% for line in snippet|highlight %}
- {{ line|safe|default:" " }}
{% endfor %}