index.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <title>Luminous Syntax Highlighter</title>
  6. <link rel='stylesheet' type='text/css' href='style/luminous.css'>
  7. <link rel='stylesheet' type='text/css' href='style/geonyx.css'>
  8. <style>
  9. h1{font-size: x-large;}
  10. h2{font-size: large; }
  11. h3{font-size: medium;}
  12. body{ margin:1em; font-family: sans-serif; font-size:12pt;}
  13. .luminous { border: 1px solid #bbb; }
  14. span.inline-code {
  15. background-color: #E7E7E7;
  16. padding: 1px 0.25em;
  17. font-family: monospace;
  18. font-weight: bold;
  19. color: #323232;
  20. border: 1px solid #888;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <h1>Luminous - a Syntax Highlighter for PHP - v0.7.0</h1>
  26. <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>
  27. <p>Luminous is an accurate and style-able syntax highlighter for PHP which
  28. supports a bunch of common languages and output to HTML and LaTeX.</p>
  29. <p>If you simply want to use Luminous as a library, <strong>please don't clone this
  30. repository</strong>. Or if you do, make sure you delete luminous/tests afterwards.
  31. Do not expose luminous/tests on a public machine. It is recommended to get a
  32. packaged version from the links below.</p>
  33. <h2>Links:</h2>
  34. <ul>
  35. <li><a href="http://luminous.asgaard.co.uk/">Luminous PHP syntax highlighter official site</a> - news, latest stable versions, etc</li>
  36. <li><a href="http://luminous.asgaard.co.uk/index.php/demo">Online demo</a></li>
  37. <li><a href="http://luminous.asgaard.co.uk/index.php/docs/show/index">Documentation and help</a>,
  38. read this if you get stuck!</li>
  39. <li><a href="http://luminous.asgaard.co.uk/assets/luminous/supported.php">Supported language list</a></li>
  40. <li><a href="https://github.com/markwatkinson/luminous">Luminous on GitHub</a> - please
  41. report problems to the issue tracker here</li>
  42. </ul>
  43. <h1>Installation</h1>
  44. <p>Extract your tarball, zip, whatever, into some directory where it's going to be
  45. used (i.e. probably your web-server). We'll assume it's called `luminous/'</p>
  46. <h1>Quick Usage </h1>
  47. <p>First, if you're going to use caching, which you probably are, create a
  48. directory called luminous/cache and give it writable permissions (chmod 777 on
  49. most servers -- yours may accept a less permissive value). Then include
  50. luminous/luminous.php and away you go!</p>
  51. <p><div
  52. class="luminous"
  53. data-language="PHP"
  54. style=""
  55. ><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"
  56. data-startline="1"
  57. data-highlightlines=""
  58. ><span><span class='delimiter'>&lt;?php</span>
  59. </span><span><span class='function'>require_once</span> <span class='string'>'luminous/luminous.php'</span><span class='operator'>;</span>
  60. </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 &lt;head&gt;</span>
  61. </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>
  62. </span></pre></td></tr></tbody></table></div></p>
  63. <p>Useful examples can be found in luminous/examples/. If you have problems,
  64. check that luminous/examples/example.php works.</p>
  65. <h1>Command Line Usage</h1>
  66. <p>If you're crazy and want to use Luminous/PHP on the command line, guess what,
  67. you can!</p>
  68. <p><div
  69. class="luminous"
  70. data-language="Bash"
  71. style=""
  72. ><table><tbody><tr><td><pre class="line-numbers"><span>1</span><span>2</span></pre></td><td class="code-container"><pre class="code numbered"
  73. data-startline="1"
  74. data-highlightlines=""
  75. ><span>$ <span class='function'>cd</span> luminous/
  76. </span><span>$ php luminous.php --help
  77. </span></pre></td></tr></tbody></table></div></p>
  78. <h1>Polite Warning</h1>
  79. <p>Luminous is fairly slow. But it caches! So it's not slow. Or is it?</p>
  80. <p>It depends on your use-case, is the simple answer. Most people should make sure
  81. the cache works (create luminous/cache with appropriate permissions), and after
  82. that, Luminous will almost certainly have negligable impact on their
  83. performance.</p>
  84. <p>Optimizations are welcome, but not at the expense of maintainability.</p>
  85. <h2>Caching</h2>
  86. <p>The cache can be stored either directly on the file system or in a MySQL table
  87. (support for other DBMSs will come later, patches welcome). In either case,
  88. check out the <a href="http://luminous.asgaard.co.uk/index.php/docs/show/cache">cache documentation</a>.</p>
  89. <h1>Licensing</h1>
  90. <p>Luminous is distributed under the LGPL but includes a bunch of stuff which is
  91. separate.</p>
  92. <ul>
  93. <li>Everything under src/ and languages/ is part of Luminous.</li>
  94. <li>Everything under tests/regression/<em>/</em> is real source code taken from various
  95. projects, which is used only as test data. It is all GPL-compatible, but
  96. is distributed under its own license. This directory is only present in
  97. the git repository and is not part of any stable distribution archives.</li>
  98. <li>We also include jQuery which is provided under its own license.</li>
  99. </ul>
  100. </body>
  101. </html>