Directives¶
sphinx-revealjs
provides some directives to customize presence and behaviors.
For customize presentation¶
Sphinx can manage multiple documents,
so that sphinx-revealjs
can build multiple presentation slides.
If you want to configure one presentaion from some, use this directive into your source.
- .. revealjs-slide::¶
Write
revealjs-slide
directive on directly below of title header.Note
Directive based customize has options less than conf based because implementation restrict.
- :theme: (string)¶
Override
revealjs_style_theme
.
- :google_font: (string)¶
Override
revealjs_google_fonts
, but it can specify only one.
- :conf: (JSON-string or no-value)¶
Override
revealjs_script_conf
, but single line only.
Usage:
Presentation title ================== .. revealjs-slide:: :theme: moon Section ------- Content
For customize sections¶
If you want to change behavior of sections, use these directives.
- .. revealjs-section::¶
To change behavior per section, write directive per section.
- :data-XXX:¶
This directive can accept attribute as same as Reveal.js
section
tags.
Usage:
Write
revealjs-slide
directive on directly below of section title header.Title ===== Section ------- .. revealjs-section:: :data-background-color: #009900
- .. revealjs_section::¶
Alias of
revealjs-section
for backward compatibility.Note
This will be dropped when version 2.x
- .. revealjs-break::¶
If you want to transition section with keeping title,
revealjs-break
can use.Usage:
Write
revealjs-break
to point of want to split section.Title ===== Section ------- Content 1 .. revealjs-break:: Content 2(next slide)
- :data-XXX:¶
It accepts attributes as same as
revealjs-section
.
- :notitle:¶
If it is set in directive, next section page does not display title.
- .. revealjs_break::¶
Alias of
revealjs-breaK
For backward compatibility.Note
This will be dropped when version 2.x
For interactive contents¶
- .. revealjs-code-block::¶
This is extends of
code-block
direcrive for presentation.If you want to use
data-line-number
attributes in code-block.- :data-line-numbers: (string or no value)¶
Code highlighting pattern. See Reveal.js document
Example:
.. revealjs-code-block:: python :data-line-numbers: 1 def hello(): print("world")
- .. revealjs-fragments::¶
Note
There are cases not working regular.
Inject
fragment
attribute into objects. Referer to “Fragments” from Reveal.jsExample:
Write block as directive that you want to present as fragments.
.. revealjs-fragments:: * First * Second * Third
See demo
- .. revealjs_fragments::¶
Alias of
revealjs-fragments
for backward compatibility.Note
This will be dropped when version 2.x