mirror of
https://github.com/pierre42100/comunic
synced 2024-11-17 02:51:13 +00:00
125 lines
5.6 KiB
HTML
Executable File
125 lines
5.6 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>Luminous Syntax Highlighter</title>
|
|
<link rel='stylesheet' type='text/css' href='style/luminous.css'>
|
|
<link rel='stylesheet' type='text/css' href='style/geonyx.css'>
|
|
<style>
|
|
h1{font-size: x-large;}
|
|
h2{font-size: large; }
|
|
h3{font-size: medium;}
|
|
body{ margin:1em; font-family: sans-serif; font-size:12pt;}
|
|
.luminous { border: 1px solid #bbb; }
|
|
span.inline-code {
|
|
background-color: #E7E7E7;
|
|
padding: 1px 0.25em;
|
|
font-family: monospace;
|
|
font-weight: bold;
|
|
color: #323232;
|
|
border: 1px solid #888;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>Luminous - a Syntax Highlighter for PHP - v0.7.0</h1>
|
|
|
|
<p><a href="http://travis-ci.org/markwatkinson/luminous"><img src="https://secure.travis-ci.org/markwatkinson/luminous.png" alt="Build Status" title="" /></a></p>
|
|
|
|
<p>Luminous is an accurate and style-able syntax highlighter for PHP which
|
|
supports a bunch of common languages and output to HTML and LaTeX.</p>
|
|
|
|
<p>If you simply want to use Luminous as a library, <strong>please don't clone this
|
|
repository</strong>. Or if you do, make sure you delete luminous/tests afterwards.
|
|
Do not expose luminous/tests on a public machine. It is recommended to get a
|
|
packaged version from the links below.</p>
|
|
|
|
<h2>Links:</h2>
|
|
|
|
<ul>
|
|
<li><a href="http://luminous.asgaard.co.uk/">Luminous PHP syntax highlighter official site</a> - news, latest stable versions, etc</li>
|
|
<li><a href="http://luminous.asgaard.co.uk/index.php/demo">Online demo</a></li>
|
|
<li><a href="http://luminous.asgaard.co.uk/index.php/docs/show/index">Documentation and help</a>,
|
|
read this if you get stuck!</li>
|
|
<li><a href="http://luminous.asgaard.co.uk/assets/luminous/supported.php">Supported language list</a></li>
|
|
<li><a href="https://github.com/markwatkinson/luminous">Luminous on GitHub</a> - please
|
|
report problems to the issue tracker here</li>
|
|
</ul>
|
|
|
|
<h1>Installation</h1>
|
|
|
|
<p>Extract your tarball, zip, whatever, into some directory where it's going to be
|
|
used (i.e. probably your web-server). We'll assume it's called `luminous/'</p>
|
|
|
|
<h1>Quick Usage </h1>
|
|
|
|
<p>First, if you're going to use caching, which you probably are, create a
|
|
directory called luminous/cache and give it writable permissions (chmod 777 on
|
|
most servers -- yours may accept a less permissive value). Then include
|
|
luminous/luminous.php and away you go!</p>
|
|
|
|
<p><div
|
|
class="luminous"
|
|
data-language="PHP"
|
|
style=""
|
|
><table><tbody><tr><td><pre class="line-numbers"><span>1</span><span>2</span><span>3</span><span>4</span></pre></td><td class="code-container"><pre class="code numbered"
|
|
data-startline="1"
|
|
data-highlightlines=""
|
|
><span><span class='delimiter'><?php</span>
|
|
</span><span><span class='function'>require_once</span> <span class='string'>'luminous/luminous.php'</span><span class='operator'>;</span>
|
|
</span><span><span class='function'>echo</span> <span class='obj'>luminous</span><span class='operator'>::</span><span class='oo'>head_html</span>()<span class='operator'>;</span> <span class='comment'>// outputs CSS includes, intended to go in <head></span>
|
|
</span><span><span class='function'>echo</span> <span class='obj'>luminous</span><span class='operator'>::</span><span class='oo'>highlight</span>(<span class='string'>'c'</span><span class='operator'>,</span> <span class='string'>'printf("hello world<span class='esc'>\n</span>");'</span>)<span class='operator'>;</span>
|
|
</span></pre></td></tr></tbody></table></div></p>
|
|
|
|
<p>Useful examples can be found in luminous/examples/. If you have problems,
|
|
check that luminous/examples/example.php works.</p>
|
|
|
|
<h1>Command Line Usage</h1>
|
|
|
|
<p>If you're crazy and want to use Luminous/PHP on the command line, guess what,
|
|
you can!</p>
|
|
|
|
<p><div
|
|
class="luminous"
|
|
data-language="Bash"
|
|
style=""
|
|
><table><tbody><tr><td><pre class="line-numbers"><span>1</span><span>2</span></pre></td><td class="code-container"><pre class="code numbered"
|
|
data-startline="1"
|
|
data-highlightlines=""
|
|
><span>$ <span class='function'>cd</span> luminous/
|
|
</span><span>$ php luminous.php --help
|
|
</span></pre></td></tr></tbody></table></div></p>
|
|
|
|
<h1>Polite Warning</h1>
|
|
|
|
<p>Luminous is fairly slow. But it caches! So it's not slow. Or is it?</p>
|
|
|
|
<p>It depends on your use-case, is the simple answer. Most people should make sure
|
|
the cache works (create luminous/cache with appropriate permissions), and after
|
|
that, Luminous will almost certainly have negligable impact on their
|
|
performance.</p>
|
|
|
|
<p>Optimizations are welcome, but not at the expense of maintainability.</p>
|
|
|
|
<h2>Caching</h2>
|
|
|
|
<p>The cache can be stored either directly on the file system or in a MySQL table
|
|
(support for other DBMSs will come later, patches welcome). In either case,
|
|
check out the <a href="http://luminous.asgaard.co.uk/index.php/docs/show/cache">cache documentation</a>.</p>
|
|
|
|
<h1>Licensing</h1>
|
|
|
|
<p>Luminous is distributed under the LGPL but includes a bunch of stuff which is
|
|
separate.</p>
|
|
|
|
<ul>
|
|
<li>Everything under src/ and languages/ is part of Luminous.</li>
|
|
<li>Everything under tests/regression/<em>/</em> is real source code taken from various
|
|
projects, which is used only as test data. It is all GPL-compatible, but
|
|
is distributed under its own license. This directory is only present in
|
|
the git repository and is not part of any stable distribution archives.</li>
|
|
<li>We also include jQuery which is provided under its own license.</li>
|
|
</ul>
|
|
|
|
</body>
|
|
</html> |