Changeset 76 in lab


Ignore:
Timestamp:
Oct 27, 2010 2:36:14 PM (11 years ago)
Author:
mitty
Message:
  • change fancy line number to 10
  • change background color of codes to white
  • comment out copyright header
  • change title
  • comment out explanation of this script
  • suppress post form on source posted
  • add links to documents
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/genshi/index.php

    r75 r76  
    5959 
    6060    // Enable line numbers. We want fancy line numbers, and we want every 5th line number to be fancy 
    61     $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 5); 
     61    $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS, 10); 
    6262 
    6363    // Set the style for the PRE around the code. The line numbers are contained within this box (not 
    6464    // XHTML compliant btw, but if you are liberally minded about these things then you'll appreciate 
    6565    // the reduced source output). 
    66     $geshi->set_overall_style('font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #f0f0f0;', false); 
     66    $geshi->set_overall_style('font: normal normal 90% monospace; color: #000066; border: 1px solid #d0d0d0; background-color: #ffffff;', false); 
    6767 
    6868    // Set the style for line numbers. In order to get style for line numbers working, the <li> element 
     
    8686    // affected by the styles set by set_overall_style. So if the PRE has a border then the header/footer will 
    8787    // appear inside it. 
    88     $geshi->set_header_content('<SPEED> <TIME> GeSHi &copy; 2004-2007, Nigel McNie, 2007-2008 Benny Baumann. View source of example.php for example of using GeSHi'); 
    89     $geshi->set_header_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;'); 
     88    //$geshi->set_header_content('<SPEED> <TIME> GeSHi &copy; 2004-2007, Nigel McNie, 2007-2008 Benny Baumann. View source of example.php for example of using GeSHi'); 
     89    //$geshi->set_header_content_style('font-family: sans-serif; color: #808080; font-size: 70%; font-weight: bold; background-color: #f0f0ff; border-bottom: 1px solid #d0d0d0; padding: 2px;'); 
    9090 
    9191    // You can use <TIME> and <VERSION> as placeholders 
     
    101101<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    102102<head> 
    103     <title>GeSHi examples</title> 
     103    <title>GeSHi - Generic Syntax Highlighter</title> 
    104104    <style type="text/css"> 
    105105    <!-- 
     
    158158</head> 
    159159<body> 
     160<!-- 
    160161<h2>GeSHi Example Script</h2> 
    161162<p>To use this script, make sure that <strong>geshi.php</strong> is in the parent directory or in your 
     
    163164<p>Enter your source and a language to highlight the source in and submit, or just choose a language to 
    164165have that language file highlighted in PHP.</p> 
     166--> 
    165167<?php 
    166168if (isset($_POST['submit'])) { 
     
    168170    echo $geshi->parse_code(); 
    169171    echo '<hr />'; 
     172    echo '</body>'; 
     173    echo '</html>'; 
     174    exit; 
    170175} 
    171176?> 
     177<h2>GeSHi - Generic Syntax Highlighter</h2> 
     178<ul> 
     179  <li><a href="docs/geshi-doc.html">GeSHi Documentation</a></li> 
     180  <li><a href="docs/api/">GeSHi API</a></li> 
     181</ul> 
    172182<form action="<?php echo basename($_SERVER['PHP_SELF']); ?>" method="post"> 
    173183<h3>Source to highlight</h3> 
    174184<p> 
    175 <textarea rows="10" cols="60" name="source" id="source"><?php echo $fill_source ? htmlspecialchars($_POST['source']) : '' ?></textarea> 
     185<textarea rows="30" cols="120" name="source" id="source"><?php echo $fill_source ? htmlspecialchars($_POST['source']) : '' ?></textarea> 
    176186</p> 
    177187<h3>Choose a language</h3> 
Note: See TracChangeset for help on using the changeset viewer.