-
Notifications
You must be signed in to change notification settings - Fork 1
/
including_code.html
203 lines (139 loc) · 4.52 KB
/
including_code.html
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>The TriBase RoR course</title>
<!-- metadata -->
<meta name="generator" content="S5" />
<meta name="version" content="S5 1.1" />
<meta name="presdate" content="20050728" />
<meta name="author" content="Jonathan Gross" />
<meta name="company" content="BiolData ltd." />
<!-- configuration parameters -->
<meta name="defaultView" content="slideshow" />
<meta name="controlVis" content="hidden" />
<!-- style sheet links -->
<link rel="stylesheet" href="../ui/default/slides.css" type="text/css" media="projection" id="slideProj" />
<link rel="stylesheet" href="../ui/default/outline.css" type="text/css" media="screen" id="outlineStyle" />
<link rel="stylesheet" href="../lib/stylesheets/print.css" type="text/css" media="print" id="slidePrint" />
<link rel="stylesheet" href="../ui/default/opera.css" type="text/css" media="projection" id="operaFix" />
<link rel="stylesheet" href="../lib/stylesheets/pressie.css" type="text/css" />
<!-- S5 JS -->
<script src="../ui/default/slides.js" type="text/javascript"></script>
<!-- Syntax Highlighter -->
<link rel="stylesheet" href="../dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css"></link>
</head>
<body>
<div class="layout">
<div id="controls"><!-- DO NOT EDIT --></div>
<div id="currentSlide"><!-- DO NOT EDIT --></div>
<div id="header"></div>
<div id="footer">
<h2>Copyright © 2008 Jonathan Gross</h2>
</div>
</div>
<div class="presentation">
<div class="slide">
<h1>Including Code in Slides</h1>
</div>
<div class="slide">
<h1>Including Code in Slides</h1>
<ul>
<li>Write code under <code>code/</code></li>
<li>Include it in your slides using <code>:code</code> directives</li>
</ul>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
:code code/myfile.rb
</pre></div>
<ul>
<li>The entire contents of <code>code/myfile.rb</code> will be included in the slide</li>
</ul>
</div>
<div class="slide">
<h1>Including Parts of a Source File</h1>
<ul>
<li>In the source file, use comments containing <code>START:sometag</code> and <code>END:sometag</code></li>
</ul>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
class SomeClass
#START:useful-method
def my_method
puts "hello world"
end
#END:useful-method
end
</pre></div>
<ul>
<li>In the slide, reference the tag in square brackets after the file name</li>
</ul>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
:code code/myfile.rb[useful-method]
</pre></div>
</div>
<div class="slide">
<h1>Merge Multiple Fragments</h1>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
#START:constructor
class SomeClass
def initialize
# ...
end
#END:constructor
def other_methods...
end
#START:constructor
end
#END:constructor
</pre></div>
</div>
<div class="slide">
<h1>Override Code Language and/or <span class="caps">CSS</span> Class</h1>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
:code code/file.xxx[section lang=name class=name]
</pre></div>
<ul>
<li>can appear in any order</li>
<li><code>lang=</code><em>anything supported by SyntaxHighlighter</em>
<ul>
<li>look in <code>dp.SyntaxHighlighter/Scripts</code>)</li>
</ul>
</li>
<li><code>class=code-large | code-normal | code-small | code-tiny | code-supertiny</code></li>
</ul>
</div>
<div class="slide">
<h1>Embedding Code Inline</h1>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
:inlinecode
code that
goes inline in slides
:endinlinecode
</pre></div>
<ul>
<li><code>:inlinecode</code> optionally takes <code>lang=xxx</code> and <code>class=xx</code></li>
</ul>
<div class="code-normal">
<pre name="code" class="ruby:nogutter:nocontrols">
:inlinecode lang=ruby
puts "Hello World!"
:endinlinecode
</pre></div>
</div>
<!-- Syntax Highlighter -->
<script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shCore.js"></script>
<script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shBrushCpp.js"></script>
<script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shBrushRuby.js"></script>
<script language="javascript" src="../dp.SyntaxHighlighter/Scripts/shBrushXml.js"></script>
<script language="javascript">
dp.SyntaxHighlighter.ClipboardSwf = '/flash/clipboard.swf';
dp.SyntaxHighlighter.HighlightAll('code');
</script>
</div>
</body>
</html>