summaryrefslogtreecommitdiffstats
path: root/index.html
blob: 8be8e99114472968335c53509c5b237c611689a4 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>CLI Demo</title>
    <link href="https://google-code-prettify.googlecode.com/svn/trunk/styles/sunburst.css" rel="stylesheet" type="text/css" />
    <link href="css/cli-demo.css" rel="stylesheet" type="text/css" />
    <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
    <script src="http://code.jquery.com/jquery.js"></script>
    <script src="js/cli-demo.js"></script>
    <script src="js/init.js"></script>
    <style>
body {
    font: small sans-serif;
}
    </style>
</head>
<body>
<h1>CLI Demo</h1>

<h2>Overview</h2>

This jQuery plugin provides a simple way to create animations of terminal activities for demonstration purposes.

<h2>Quick Start</h2>

Execute the actual operations in the terminal:
<pre class="prettyprint" style="width: 700px; margin: 1em 0px;">
$ ls /usr/lib
anaconda-runtime  games  locale     rpm       sendmail.postfix
ConsoleKit        gcc    python2.6  sendmail  yum-plugins
$ ls /var/lib
alternatives  dhclient          nfs       random-seed  stateless
authconfig    games             plymouth  rhsm         udev
cs            logrotate.status  polkit-1  rpm          up2date
dbus          misc              postfix   rsyslog      yum
$  
</pre>

Copy and paste the content of the terminal into a &lt;div class="cli-demo"&gt; in an HTML page. Mark the parts that are manually typed with &lt;span class="cli-demo-input"&gt;.

<pre class="prettyprint" style="width: 700px; margin: 1em 0px;">
&lt;html&gt;
&lt;head&gt; ... &lt;/head&gt;
&lt;body&gt;

&lt;div class="cli-demo"&gt;$ &lt;span class="cli-demo-input"&gt;ls /usr/lib&lt;/span&gt;
anaconda-runtime  games  locale     rpm       sendmail.postfix
ConsoleKit        gcc    python2.6  sendmail  yum-plugins
$ &lt;span class="cli-demo-input"&gt;ls /var/lib&lt;/span&gt;
alternatives  dhclient          nfs       random-seed  stateless
authconfig    games             plymouth  rhsm         udev
cs            logrotate.status  polkit-1  rpm          up2date
dbus          misc              postfix   rsyslog      yum
$ &lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</pre>

Include the JS and CSS files in the header and execute the plugin:

<pre class="prettyprint" style="width: 700px; margin: 1em 0px;">
&lt;html&gt;
&lt;head&gt;
    &lt;link href="css/cli-demo.css" rel="stylesheet" type="text/css"/&gt;
    &lt;script src="http://code.jquery.com/jquery.js"&gt;&lt;/script&gt;
    &lt;script src="js/cli-demo.js"&gt;&lt;/script&gt;
    &lt;script&gt;
$(function() {
    $(".cli-demo").cli_demo();
});
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    ...
&lt;/body&gt;
&lt;/html&gt;
</pre>

Result:

<div class="cli-demo">$ <span class="cli-demo-input">ls /usr/lib</span>
anaconda-runtime  games  locale     rpm       sendmail.postfix
ConsoleKit        gcc    python2.6  sendmail  yum-plugins
$ <span class="cli-demo-input">ls /var/lib</span>
alternatives  dhclient          nfs       random-seed  stateless
authconfig    games             plymouth  rhsm         udev
cs            logrotate.status  polkit-1  rpm          up2date
dbus          misc              postfix   rsyslog      yum
$ </div>

<h2>Examples</h2>

<ul>
<li><a href="examples/basic.html">Basic</a></li>
<li><a href="examples/MediaWiki.html">MediaWiki</a></li>
</ul>

<h2>Repository</h2>
<pre>
git://fedorapeople.org/home/fedora/edewata/public_git/cli-demo.git
</pre>

</body>
</html>