1.3.0
2021-07-11
Sphinx extension to build Revealjs presentation
Convert sections from reStructuredText directly
Select theme from default themes
From:
Title
=====
First section
-------------
Content 1
^^^^^^^^^
Content 2
^^^^^^^^^
To:
<section>
<h1>Title</h1>
</section>
<section>
<section>
<h2>First section</h2>
</section>
<section>
<h3>Content 1</h3>
</section>
<section>
<h3>Content 2</h3>
</section>
</section>
From:
.. This is comment in reStructuredText
To:
<section>
<aside class="notes">
This is comment in reStructuredText
</aside>
</section>
.. revealjs-section::
:data-background-color: #009900
.. revealjs-section::
:data-background-image: _static/icon-attakei.jpg
:data-background-size: contain
.. revealjs-section::
:data-background-video: https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.mp4,https://s3.amazonaws.com/static.slid.es/site/homepage/v1/homepage-video-editor.webm
.. revealjs-section::
:data-background-iframe: https://slides.com
:data-background-interactive:
.. revealjs-section::
:data-transition: none
.. revealjs-section::
:data-transition: fade
.. revealjs-section::
:data-background-image: _static/icon-attakei.jpg
:data-background-size: contain
:data-background-transition: zoom
First section
Second section
.. revealjs-break::
Third section.
You can hide section title
.. revealjs-break::
:notitle:
Enable animations for each revealjs-section and revealjs-break:
echo 'First part of my command'
Enable animations for each revealjs-section and revealjs-break:
echo 'First part of my command'
echo 'Second part of my command'
Highlight source code per line, using the revealjs-code-block directive:
.. revealjs-code-block:: console
:linenos:
:data-line-numbers: 1|2|3,4
echo 'First part of my command'
echo 'Second part of my command'
echo 'Third part of my command'
echo 'Forth part of my command'
echo 'First part of my command'
echo 'Second part of my command'
echo 'Third part of my command'
echo 'Forth part of my command'
This is support fragment with groups.
.. revealjs-fragments::
* First
* Second
* Third
First
Second
Third
bundled plugins can use just write conf.py
revealjs-script_plugins = [
{
"name": "RevealNotes",
"src": "revealjs4/plugin/notes/notes.js",
},
]
This is used RevealNotes plugin, Please press S key to try it!
Supporting math renderer from sphinx.
Example to use sphinx.ext.mathjax
(recommended)
.. math::
\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{aligned}
You can use math plugin of Reveal.js
Source:
revealjs-script_plugins = [
{
"name": "RevealMath",
"src": "revealjs4/plugin/math/math.js",
}
]
.. raw:: html
\[\begin{aligned}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{aligned} \]
You can use math plugin of Reveal.js
Output:
\[\begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned} \]You can use other extensions to render html.
You can install from PyPI.
$ pip install sphinx-revealjs
Edit conf.py to use this extension
extensions = [
"sphinx_revealjs",
]
Write plain reStructuredText
My Reveal.js presentation
=========================
Agenda
------
* Author
* Feature
Author: Who am I
================
Own self promotion
Content
=======
This extension has custom builder name revealjs
.
If you make docs as Reveal.js presentation, you call make revealjs
.
$ make revealjs
This presentation is made from source.
Please star!
Star