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
$ pip install git+https://github.com/attakei/sphinx-revealjs
$ pip install git+https://github.com/attakei/sphinx-revealjs

Usage

  1. Add extension to your sphinx conf.py
extensions = [
'sphinx_revealjs',
]
extensions = [
    'sphinx_revealjs',
]
extensions = [ 'sphinx_revealjs', ]
  1. Write your presentation source by reST, and build
$ make revealjs
$ make revealjs
$ 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
=====
Title
=====

Section 1
=========

content 1

Section 2
=========

content 2
===== Title ===== Section 1 ========= content 1 Section 2 ========= content 2

It can convert this

<span><section></span>
<span><h1></span>Title<span></h1></span>
<span></section></span>
<span><section></span>
<span><h2></span>Section 1<span></h2></span>
<span><div></span>content 1<span></div></span>
<span></section></span>
<span><section></span>
<span><h2></span>Section 2<span></h2></span>
<span><div></span>content 2<span></div></span>
<span></section></span>
<span><section></span>
  <span><h1></span>Title<span></h1></span>
<span></section></span>
<span><section></span>
  <span><h2></span>Section 1<span></h2></span>
  <span><div></span>content 1<span></div></span>
<span></section></span>
<span><section></span>
  <span><h2></span>Section 2<span></h2></span>
  <span><div></span>content 2<span></div></span>
<span></section></span>
<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
=====
Title
=====

Section 1
=========

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

content body

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

content body
===== Title ===== Section 1 ========= content 1.1 ----------- content body content 1.2 ----------- content body

to

<span><section></span>
<span><h1></span>Title<span></h1></span>
<span></section></span>
<span><section></span>
<span><section></span>
<span><h2></span>Section 1<span></h2></span>
<span></section></span>
<span><section></span>
<span><h3></span>content 1.1<span></h3></span>
<span><div></span>content body<span></div></span>
<span></section></span>
<span><section></span>
<span><h3></span>content 1.2<span></h3></span>
<span><div></span>content body<span></div></span>
<span></section></span>
<span></section></span>
<span><section></span>
  <span><h1></span>Title<span></h1></span>
<span></section></span>
<span><section></span>
  <span><section></span>
    <span><h2></span>Section 1<span></h2></span>
  <span></section></span>
  <span><section></span>
    <span><h3></span>content 1.1<span></h3></span>
    <span><div></span>content body<span></div></span>
  <span></section></span>
  <span><section></span>
    <span><h3></span>content 1.2<span></h3></span>
    <span><div></span>content body<span></div></span>
  <span></section></span>
<span></section></span>
<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 分享
Put blinders on to those things that conspire to hold you back, especially the ones in your own head.
不要去想那些阻碍你的事,尤其是那些自己想象出来的事
评论 抢沙发

请登录后发表评论

    暂无评论内容