DEV Community

loading...

Sphinx extension to generate Reveal.js presentation from plain reST

attakei profile image kAZUYA tAKEI ・1 min read

I create Sphinx extension to convert Reveal.js presentation from plain reStructuredText. please try it, if you match want to write Reveal.js by Sphinx(reStructuredText)

GitHub logo attakei / sphinx-revealjs

Sphinx builder to revealjs presentations

sphinx-revealjs

https://travis-ci.org/attakei/sphinx-revealjs.svg?branch=master

Sphinx extention with theme to generate Reveal.js presentation

Orverview

This extension generate Reveal.js presentation from standard reStructuredText.

It include theses features.

  • Custom builder to translate from reST to reveal.js style HTML
  • Template to be enable to render presentation local imdependent

Installation

$ pip install sphinx-revealjs

Usage

  1. Create your sphinx documentation

  2. Edit conf.py to use this extension

    extensions = [
        'sphinx_revealjs',
    ]
  3. Write source for standard document style

  4. Build sources as Reveal.js presentation

    $ make revealjs

Change logs

See it

Futures

  • Index template as none presentation
  • CDN support

Copyright

Apache-2.0 license. Please see LICENSE.




If you want to see source and output, click these links. These are pair of simple reST source and generated presentation.

Installation and usage

Installation

$ pip install git+https://github.com/attakei/sphinx-revealjs

Usage

  1. Add extension to your sphinx conf.py
extensions = [
    'sphinx_revealjs',
]
  1. Write your presentation source by reST, and build
$ make revealjs

Concepts

  • Use default nodes and directives as more as possible
  • Manage multiple presentations in one Sphinx documentation
    • and, can switch themes per documents

Supporting features in reST

  • Section (convert reveal.js section)
  • Comment (use for speaker note)
  • Code block (convert reveal.js style code block)
  • And other directives (inherit Sphinx HTML5 builder)

Short examples for convert

Your write source like this..

=====
Title
=====

Section 1
=========

content 1

Section 2
=========

content 2

It can convert this

<section>
  <h1>Title</h1>
</section>
<section>
  <h2>Section 1</h2>
  <div>content 1</div>
</section>
<section>
  <h2>Section 2</h2>
  <div>content 2</div>
</section>

Of course, support nested section.

from

=====
Title
=====

Section 1
=========

content 1.1
-----------

content body

content 1.2
-----------

content body

to

<section>
  <h1>Title</h1>
</section>
<section>
  <section>
    <h2>Section 1</h2>
  </section>
  <section>
    <h3>content 1.1</h3>
    <div>content body</div>
  </section>
  <section>
    <h3>content 1.2</h3>
    <div>content body</div>
  </section>
</section>

Discussion (0)

Forem Open with the Forem app