diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2010-02-19 13:01:11 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2010-02-19 13:01:54 +0100 |
commit | 3141d15061baea8f72d7eaeb84d83382eef42f63 (patch) | |
tree | 8710552b832627c194b45b79fdc3baf89d9209db | |
parent | 00ed153bee1758c80db5ca440c67db2c1ab4d171 (diff) | |
download | rafb-nopaste-3141d15061baea8f72d7eaeb84d83382eef42f63.tar.gz rafb-nopaste-3141d15061baea8f72d7eaeb84d83382eef42f63.tar.xz rafb-nopaste-3141d15061baea8f72d7eaeb84d83382eef42f63.zip |
changes geshi styling, added abbility to highlight lines
Diffstat (limited to '')
-rw-r--r-- | paste/include/pastify.inc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/paste/include/pastify.inc b/paste/include/pastify.inc index 8103a7d..92253c9 100644 --- a/paste/include/pastify.inc +++ b/paste/include/pastify.inc @@ -44,11 +44,19 @@ function PastifyText($text, $language, $desc, $get_url, $remove_url) # Do the actual syntax highlighting $geshi = new GeSHi($text, $language); $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); - $geshi->set_header_type(GESHI_HEADER_PRE_TABLE); + $geshi->set_line_style('font-size: 0.8em; color: #999;', 'font-size: 0.8em; color: #000;'); + $geshi->set_code_style('margin-left: 1em; color: #000; font-size: 1.3em;', true); - $geshi->set_footer_content('<div style="font-size: 0.5em; color: #DDD; text-align: center;">Rendered in {TIME}s with GeSHi {VERSION}</div>'); + $geshi->set_header_type(GESHI_HEADER_DIV); + + $geshi->set_footer_content('Rendered in {TIME}s with GeSHi {VERSION}'); + $geshi->set_footer_content_style('font-size: 0.5em; color: #DDD; text-align: center;'); $geshi->set_overall_style('width: 100%;'); + if (isset($_REQUEST['hl'])) { + $geshi->highlight_lines_extra(explode(',', $_REQUEST['hl'])); + } + $output = $geshi->parse_code(); $html = <<<EOH |