blob: 09658bddf2a475af702da5a351a086697a6d886c (
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="//google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
<script src="//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 CLI demonstration.
<h2>Quick Start</h2>
Execute the actual CLI operations:
<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 CLI input and output into a <div class="cli-demo"> or <pre class="cli-demo"> in an HTML page. Mark the parts that are manually typed with <span class="cli-demo-input">.
<pre class="prettyprint" style="width: 700px; margin: 1em 0px;">
<html>
<head> ... </head>
<body>
<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>
</body>
</html>
</pre>
Include the JS and CSS files in the header and execute the plugin:
<pre class="prettyprint" style="width: 700px; margin: 1em 0px;">
<html>
<head>
<link href="css/cli-demo.css" rel="stylesheet" type="text/css"/>
<script src="//code.jquery.com/jquery.js"></script>
<script src="js/cli-demo.js"></script>
<script>
$(function() {
$(".cli-demo").cli_demo();
});
</script>
</head>
<body>
...
</body>
</html>
</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>
|