sphinx-revealjs

Based version

1.0.0

Released

2020-12-27

Overview

What is this?

Sphinx extension to build Revealjs presentation

Features

  • Convert sections from reStructuredText directly

  • Select theme from default themes

Convert sections from reStructuredText directly

Adjust section structure

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>

reStructuredText comments are used as speaker notes

From:


.. This is comment in reStructuredText

To:


<section>
  <aside class="notes">
    This is comment in reStructuredText
  </aside>
</section>

code-block as reveal.js code block

Directive for meta of section

Inject background color


.. revealjs_section::
    :data-background-color: #009900

Inject background image


.. revealjs_section::
    :data-background-image: _static/icon-attakei.jpg
    :data-background-size: contain

Inject background video


.. 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

Inject background iframe


.. revealjs_section::
    :data-background-iframe: https://slides.com
    :data-background-interactive:

Transition settings(before)


.. revealjs_section::
    :data-transition: none

Transition settings(after)


.. revealjs_section::
    :data-transition: fade

Background image transition


.. revealjs_section::
    :data-background-image: _static/icon-attakei.jpg
    :data-background-size: contain
    :data-background-transition: zoom

Keep title without duplicated written

First section

Keep title without duplicated written

Second section


.. revealjs_break::

Third section.

You can hide section title


.. revealjs_break::
    :notitle:

Support features

Fragments

This is support fragment with groups.

  • First

  • Second

  • Third

Plugins

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!

Usage

Installation

You can install from PyPI.


$ pip install sphinx-revealjs

Configure

Edit conf.py to use this extension


extensions = [
    "sphinx_revealjs",
]

Write source

Write plain reStructuredText


My Reveal.js presentation
=========================

Agenda
------

* Author
* Feature


Author: Who am I
================

Own self promotion

Content
=======

Build

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.

Other examples

Within this pages

Enjoy writing reST as presentation

Please star!

Star