sphinx-revealjs provides some directives to customize presence and behaviors.
For customize presentation¶
Sphinx can manage multiple documents,
sphinx-revealjs can build multiple presentation slides.
If you want to configure one presentaion from some, use this directive into your source.
- .. revealjs-slide::¶
revealjs-slidedirective on directly below of title header.
Directive based customize has options less than conf based because implementation restrict.
- :theme: (string)¶
- :google_font: (string)¶
revealjs_google_fonts, but it can specify only one.
This option is not work in v2.x. It will removed in v3.x
- :conf: (JSON-string or no-value)¶
revealjs_script_conf, but single line only.
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.
This directive can accept attribute as same as Reveal.js
sectiontags. For more information, please see Reveal.js documentation.
This may be not completed all attributes for Reveal.js. If you find missing attribute, pleas post issues or pull-requests into GitHub.
revealjs-slidedirective on directly below of section title header.
Title ===== Section ------- .. revealjs-section:: :data-background-color: #009900
- .. revealjs-break::¶
If you want to transition section with keeping title,
revealjs-breakto point of want to split section.
Title ===== Section ------- Content 1 .. revealjs-break:: Content 2(next slide)
It accepts attributes as same as
If it is set in directive, next section page does not display title.
For interactive contents¶
- .. revealjs-code-block::¶
This is extends of
code-blockdirecrive for presentation.
If you want to use custom attributes in code-block.
.. revealjs-code-block:: python :data-line-numbers: 1 def hello(): print("world")
- :data-ln-start-from: (integer)¶
Set number of first-line in code block. When this is assigned, display line numbers even if
data-line-numbersis not set.
.. revealjs-code-block:: python :data-ln-start-from: 3 print(datetime.datetime.now()) Please see `Reveal.js document <https://revealjs.com/code/#line-number-offset-4.2.0>`_.
- .. revealjs-literalinclude::¶
This is extends of
literalincludedirecrive for presentation.
If you want to use custom attributes in literalinclude.
External attributes are same from
- .. revealjs-fragments::¶
There are cases not working regular.
fragmentattribute into objects. Referer to “Fragments” from Reveal.js
You can see demo to know usage.
- :custom-effect: (string)¶
When it is set, inject as custom class. You can customize behavior of fragments transitions with CSS.
Write block as directive that you want to present as fragments.
.. revealjs-fragments:: * First * Second * Third
- .. revealjs-notes::¶
When you write this section, inner text are as content of Speaker View.
If you write some directives on same-level, Reveal.js uses first direcrive only.
You must be careful for comment block when you set
conf.py. Reveal.js recoginzes first
<aside>element as content of speaker-view, so you may not see directive content as notes.
.. revealjs-notes:: This content output into <aside> element on <section>.