Skip to content

Commit ec9ca68

Browse files
author
james
committed
docs: add template slide deck
1 parent 7fa7f2d commit ec9ca68

File tree

2 files changed

+174
-1
lines changed

2 files changed

+174
-1
lines changed

docs/language/ql-training-rst/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ QL training and variant analysis examples
1010
:maxdepth: 1
1111
:hidden:
1212

13-
./**/*
13+
./**/*
14+
template
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
.. Template for rst slide shows
2+
3+
4+
.. Key points:
5+
- Each heading marks the start of a new slide
6+
- The default slide style is a plain white-ish background with minimal company branding
7+
- Different slide designs have been preconfigured. To choose a different layout
8+
use the appropriate .. rst-class:: directive. For examples of the different designs,
9+
see the template below.
10+
- Additional notes can be added to a slide using a .. note:: directive
11+
- Press P to access the additional notes on the rendered slides.
12+
- Press F is go into full screen mode when viewing the rendered slides.
13+
14+
15+
.. Title slide. Includes the deck title, subtitles, and the company logo
16+
17+
===================
18+
Template slide deck
19+
===================
20+
21+
.. container:: subheading
22+
23+
First subheading
24+
25+
Second subheading
26+
27+
.. container:: semmle-logo
28+
29+
Semmle :sup:`TM`
30+
31+
.. Set up slide. Include link to QL4E snapshots required for examples
32+
33+
.. rst-class:: setup
34+
35+
Setup
36+
=====
37+
38+
For this example you should download:
39+
40+
- `QL for Eclipse <https://help.semmle.com/ql-for-eclipse/Content/WebHelp/install-plugin-free.html>`__
41+
- A snapshot
42+
43+
.. note::
44+
45+
Some notes about the project, perhaps a link to the project page on LGTM.
46+
47+
.. Agenda slide. Explaining what is to be covered in the presentation
48+
49+
.. rst-class:: Agenda
50+
51+
Agenda
52+
======
53+
54+
- Item 1
55+
- Item 2
56+
- Item 3
57+
- Item 4
58+
- Item 5
59+
60+
61+
Text
62+
====
63+
64+
If you don't specify an rst-class, you default to the 'basic' slide design.
65+
66+
You can fit about this much text on a slide:
67+
68+
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
69+
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
70+
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
71+
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
72+
eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident,
73+
sunt in culpa qui officia deserunt mollit anim id est laborum.
74+
75+
Code sample
76+
===========
77+
78+
Use a ``.. code-block::`` directive to include a code snippet.
79+
Specify the language after the directive to add syntax highlighting.
80+
81+
.. code-block:: ql
82+
83+
import cpp
84+
85+
from AddExpr a, Variable v, RelationalOperation cmp
86+
where
87+
a.getAnOperand() = v.getAnAccess() and
88+
cmp.getAnOperand() = a and
89+
cmp.getAnOperand() = v.getAnAccess()
90+
select cmp, "Overflow check."
91+
92+
Columns and graphs
93+
==================
94+
95+
.. container:: column-left
96+
97+
``.. container:: column-left`` sets up a column on the left of the slide.
98+
99+
``.. container:: column-right`` sets up a column on the right of the slide.
100+
101+
Code can be included in columns:
102+
103+
.. code-block:: ql
104+
105+
import cpp
106+
107+
from IfStmt ifstmt, Block block
108+
where
109+
block = ifstmt.getThen() and
110+
block.isEmpty()
111+
select ifstmt, "This if-statement is redundant."
112+
113+
114+
.. container:: column-right
115+
116+
Graphs can be built from text using a ``.. graphviz directive``.
117+
See the source file for details.
118+
119+
.. graphviz::
120+
121+
digraph {
122+
graph [ dpi = 1000 ]
123+
node [shape=polygon,sides=4,color=blue4,style="filled,rounded", fontname=consolas,fontcolor=white]
124+
a [label=<tainted<BR /><FONT POINT-SIZE="10">ParameterNode</FONT>>]
125+
b [label=<tainted<BR /><FONT POINT-SIZE="10">ExprNode</FONT>>]
126+
c [label=<x<BR /><FONT POINT-SIZE="10">ExprNode</FONT>>]
127+
d [label=<x<BR /><FONT POINT-SIZE="10">ExprNode</FONT>>]
128+
a -> b
129+
b -> {c, d}
130+
}
131+
132+
.. You can indicate a new concept by using a purple slide background
133+
134+
.. rst-class:: background2
135+
136+
Purple background
137+
=================
138+
139+
Subheading on purple slide
140+
141+
Including snippets
142+
==================
143+
144+
rst snippets can be included using:
145+
146+
.. code-block:: none
147+
148+
.. include:: path/to/file.rst
149+
150+
Code snippets can be included using:
151+
152+
.. code-block:: none
153+
154+
.. literalinclude:: path/to/file.ql
155+
:language: ql
156+
:emphasize-lines: 3-6
157+
158+
Specify the language to apply syntax highlighting and the lines of the fragment that you want to emphasize.
159+
160+
Further details
161+
===============
162+
163+
- For more information on writing in reStructuredText, see http://docutils.sourceforge.net/rst.html.
164+
165+
- For more information on Sphinx, see https://www.sphinx-doc.org.
166+
167+
- For more information about hieroglpyh, the Sphinx extension used to generate these slides, see https://github.com/nyergler/hieroglyph.
168+
169+
- For more information about creating graphs, see https://build-me-the-docs-please.readthedocs.io/en/latest/Using_Sphinx/UsingGraphicsAndDiagramsInSphinx.html.
170+
171+
172+
.. The final slide with the company details is generated automatically.

0 commit comments

Comments
 (0)