Skip to content

Commit 694edb0

Browse files
author
Shawn McCool
committed
hack in prettify
1 parent 73f0a99 commit 694edb0

File tree

3 files changed

+70
-3
lines changed

3 files changed

+70
-3
lines changed

app/domain/Lio/Markdown/Markdown.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ class Markdown extends MarkdownExtra
77
public function transform($content)
88
{
99
$parsedContent = parent::transform($content);
10-
$parsedContent = str_replace('<code>', '<code class="prettyprint">', $parsedContent);
10+
11+
$parsedContent = str_replace('<p><code>', '<pre><code>', $parsedContent);
12+
$parsedContent = str_replace('</code></p>', '</code></pre>', $parsedContent);
13+
14+
$parsedContent = str_replace('<pre><code>', '<pre class="prettyprint"><code>', $parsedContent);
1115

1216
return $parsedContent;
1317
}

app/views/layouts/_code_prettify.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
@section('styles')
77
@parent
8-
<link rel="stylesheet" href="{{ asset('javascripts/vendor/google-code-prettify/prettify.css') }}">
8+
99
@stop
Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,64 @@
1-
.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
1+
.prettyprint
2+
{
3+
overflow:auto;
4+
white-space:pre-wrap;
5+
background-color:#222;
6+
font-size: 12px;
7+
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace;
8+
}
9+
10+
.prettyprint ol
11+
{
12+
color:#777;
13+
padding:2em 3em 2em 5em;
14+
}
15+
16+
.prettyprint code
17+
{
18+
font-family: Monaco, "Bitstream Vera Sans Mono", "Lucida Console", Terminal, monospace !important;
19+
}
20+
21+
.prettyprint ol li
22+
{
23+
padding:0;
24+
}
25+
26+
.com
27+
{
28+
color: #555;
29+
}
30+
31+
.lit
32+
{
33+
color: #17CFB6;
34+
}
35+
36+
.pun, .opn, .clo
37+
{
38+
color: #93a1a1;
39+
}
40+
41+
.fun
42+
{
43+
color: #dc322f;
44+
}
45+
46+
.str, .atv
47+
{
48+
color: #E3B446;
49+
}
50+
51+
.kwd, .linenums .tag
52+
{
53+
color: #DB613B;
54+
}
55+
56+
.typ, .atn, .dec, .var
57+
{
58+
color: #fff;
59+
}
60+
61+
.pln
62+
{
63+
color: #ccc;
64+
}

0 commit comments

Comments
 (0)