File: readme.html

package info (click to toggle)
libjs-jush 2.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 992 kB
  • sloc: javascript: 6,929; php: 12; makefile: 7
file content (54 lines) | stat: -rw-r--r-- 3,351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>JUSH - JavaScript Syntax Highlighter</title>
<link rel="stylesheet" media="(prefers-color-scheme: dark)" href="demo-dark.css">
<body>

<h1>JUSH - JavaScript Syntax Highlighter</h1>
<p>Highlights the full stack of PHP application starting with HTML, PHP, SQL and JavaScript code and ending with HTTP headers, <code>php.ini</code> settings or database variables.</p>
<ul>
<li><a href="demo.html">Demo</a></li>
<li><a href="sql.html">SQL highlighter for various databases</a></li>
<li><a href="tests.html">Tests</a></li>
<li><a href="https://jush.sourceforge.io/">Homepage</a></li>
</ul>

<h3>Features</h3>
<ul>
<li>Highlights and links documentation in spaghetti code like nothing else: <code class="jush">&lt;span style="font: small;"&gt;&lt;?php mysql_query("SELECT 1"); ?&gt;&lt;/span&gt;</code>.</li>
<li>Supported languages: everything related to PHP: HTML5, JS, CSS 3, SQL including variables (multiple dialects), <code>php.ini</code> directives, HTTP and e-mail headers, Apache config. Anything could be embedded into each other, e.g. <code class="language-php">header("Content-Type: text/html")</code> or <code class="language-css_pro">color: expression(parentNode.style.color)</code>.</li>
<li>Allows using HTML tags in source code (could be used for pointing out important parts): <code class="language-php">echo "This part is <b>important</b>."</code>. Produces overlapping HTML tags in this case though.</li>
<li>Performance is a priority.</li>
<li><code class="language-htm">&lt;textarea&gt;</code> <a href="textarea.html">syntax highlight</a>.</li>
</ul>

<h3>Installation instructions</h3>
<ol>
<li>Copy <a href="jush.css">jush.css</a> and <a href="jush.js">jush.js</a> into your directory.</li>
<li>Add following snippet before the <code class="jush">&lt;/body&gt;</code> tag in HTML file:
<pre><code class="jush">&lt;script src="jush.js"&gt;&lt;/script&gt;
&lt;script&gt;
jush.style('jush.css');
jush.highlight_tag('code');
&lt;/script&gt;
</code></pre>
All <code class="jush">&lt;code class="jush"&gt;</code> tags will be highlighted. Language is determined by the class name beginning with "jush-" (e.g. <code class="jush">&lt;code class="jush-js"&gt;</code>). Default language is <code>htm</code>. It is also possible to use <code class="jush">&lt;code class="language-*"&gt;</code>.
</li>
<li>If you want to enable dark mode, call <code class="jush-js">jush.style('jush-dark.css')</code>. To enable it only based on user preferences, call <code class="jush-js">jush.style('jush-dark.css', '(prefers-color-scheme: dark)')</code>.</li>
</ol>
<p>Alternativelly call <code class="jush-js">jush.highlight(language, text)</code> to syntax highlight single text.</p>

<h3>Command-line help reference</h3>
<p>It is also possible to use JUSH for opening the appropriate documentation in a browser. On Windows, it is possible to run:</p>
<pre>Syntax: WScript jush-help.wsf filename line column [tabsize] [word]
Example: WScript jush-help.wsf readme.html 2 2
</pre>
<p>The example should open a browser with documentation of the <code class="jush">&lt;html&gt;</code> tag which is at position 2:2 of this file.</p>

<script src="jush.js"></script>
<script>
jush.style('jush.css');
jush.style('jush-dark.css', '(prefers-color-scheme: dark)');
jush.highlight_tag('code');
</script>