From 6960f67026139c6bf36db627e61ceb1cdefb6d3f Mon Sep 17 00:00:00 2001 From: Martin Mahner Date: Sun, 24 Nov 2013 17:05:43 +0100 Subject: [PATCH] Text snippets are now rendered as text. --- dpaste/highlight.py | 1 + dpaste/static/dpaste/theme.css | 8 +++++++- dpaste/templates/dpaste/snippet_details.html | 9 ++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/dpaste/highlight.py b/dpaste/highlight.py index dc418fa..2db980d 100644 --- a/dpaste/highlight.py +++ b/dpaste/highlight.py @@ -83,6 +83,7 @@ LEXER_LIST = getattr(settings, 'DPASTE_LEXER_LIST', ( ('tcl', 'Tcl'), ('tcsh', 'Tcsh'), ('tex', 'TeX'), + ('text', 'Text'), ('vb.net', 'VB.net'), ('vim', 'VimL'), ('xml', 'XML'), diff --git a/dpaste/static/dpaste/theme.css b/dpaste/static/dpaste/theme.css index 6595072..41136c7 100644 --- a/dpaste/static/dpaste/theme.css +++ b/dpaste/static/dpaste/theme.css @@ -88,6 +88,12 @@ tt strong { display: none; } +.snippet-rendered { + font-size: 16px; + line-height: 1.5em; + max-width: 700px; +} + div.tree{ margin: 0 0 15px 0; line-height: 1.8em; @@ -223,4 +229,4 @@ 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 */ \ No newline at end of file +pre .il { color: #ae81ff } /* Literal.Number.Integer.Long */ diff --git a/dpaste/templates/dpaste/snippet_details.html b/dpaste/templates/dpaste/snippet_details.html index 1140331..fa7dfa5 100644 --- a/dpaste/templates/dpaste/snippet_details.html +++ b/dpaste/templates/dpaste/snippet_details.html @@ -63,7 +63,14 @@ - {% include "dpaste/snippet_pre.html" %} + {% if snippet.lexer == 'text' %} +
+ {{ snippet.content|linebreaks }} +
+ {% else %} + {% include "dpaste/snippet_pre.html" %} + {% endif %} +