From 3141d15061baea8f72d7eaeb84d83382eef42f63 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 19 Feb 2010 13:01:11 +0100 Subject: changes geshi styling, added abbility to highlight lines --- paste/include/pastify.inc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'paste/include') 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('
Rendered in {TIME}s with GeSHi {VERSION}
'); + $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 = <<