Sphinx extension to generate Reveal.js presentation from plain reST

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)

attakei / sphinx-revealjs

Sphinx builder to revealjs presentations

sphinx-revealjs

图片[1]-Sphinx extension to generate Reveal.js presentation from plain reST - 拾光赋-拾光赋
图片[2]-Sphinx extension to generate Reveal.js presentation from plain reST - 拾光赋-拾光赋

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.


View on GitHub

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>

原文链接:Sphinx extension to generate Reveal.js presentation from plain reST

© 版权声明
THE END
喜欢就支持一下吧
点赞5 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容