Template slide deck
First subheading
Second subheading
.. rst-class:: setup
Setup
For this example you should download:
- CodeQL for Visual Studio Code
- A CodeQL database
Note
Some notes about the project.
.. rst-class:: Agenda
Agenda
- Item 1
- Item 2
- Item 3
- Item 4
- Item 5
Text
If you don't specify an rst-class, you default to the 'basic' slide design.
You can fit about this much text on a slide:
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Code sample
Use a .. code-block:: directive to include a code snippet.
Specify the language after the directive to add syntax highlighting.
import cpp from AddExpr a, Variable v, RelationalOperation cmp where a.getAnOperand() = v.getAnAccess() and cmp.getAnOperand() = a and cmp.getAnOperand() = v.getAnAccess() select cmp, "Overflow check."
Columns and graphs
.. container:: column-left sets up a column on the left of the slide.
.. container:: column-right sets up a column on the right of the slide.
Code can be included in columns:
import cpp from IfStmt ifstmt, Block block where block = ifstmt.getThen() and block.isEmpty() select ifstmt, "This if-statement is redundant."
Graphs can be built from text using a .. graphviz directive.
See the source file for details.
.. graphviz::
digraph {
graph [ dpi = 1000 ]
node [shape=polygon,sides=4,color=blue4,style="filled,rounded", fontname=consolas,fontcolor=white]
a [label=<tainted<BR /><FONT POINT-SIZE="10">ParameterNode</FONT>>]
b [label=<tainted<BR /><FONT POINT-SIZE="10">ExprNode</FONT>>]
c [label=<x<BR /><FONT POINT-SIZE="10">ExprNode</FONT>>]
d [label=<x<BR /><FONT POINT-SIZE="10">ExprNode</FONT>>]
a -> b
b -> {c, d}
}
.. rst-class:: background2
Purple background
Subheading on purple slide
Including snippets
rst snippets can be included using:
.. include:: path/to/file.rst
Code snippets can be included using:
.. literalinclude:: path/to/file.ql
:language: ql
:emphasize-lines: 3-6
Specify the language to apply syntax highlighting and the lines of the fragment that you want to emphasize.
Further details
- For more information on writing in reStructuredText, see https://docutils.sourceforge.io/rst.html.
- For more information on Sphinx, see https://www.sphinx-doc.org.
- For more information about hieroglpyh, the Sphinx extension used to generate these slides, see https://github.com/nyergler/hieroglyph.
- For more information about creating graphs, see https://build-me-the-docs-please.readthedocs.io/en/latest/Using_Sphinx/UsingGraphicsAndDiagramsInSphinx.html.