Package: rst2html5-tools
We all love rst and the ability to generate any format, but the rst2html tool generates really basic html and css.This tool will generate newer, nicer, more readable markup and provide ways to modify the output with extensions like nice css
thanks to twitter’s bootstrap css or online presentations with deck.jsget itvia pip:pip install rst2html5-toolslocally:git clone https://github.com/marianoguerra/rst2html5.git
cd rst2html5
git submodule init
git submodule update

sudo python setup.py installuse itto generate a basic html document:rst2html5 examples/slides.rst > clean.htmlto generate a set of slides using deck.js:rst2html5 --deck-js --pretty-print-code --embed-content examples/slides.rst > deck.htmlto generate a set of slides using reveal.js:rst2html5 --jquery --reveal-js --pretty-print-code examples/slides.rst > reveal.htmlto generate a set of slides using impress.js:rst2html5 --stylesheet-path=html5css3/thirdparty/impressjs/css/impress-demo.css --impress-js examples/impress.rst > output/impress.htmlto generate a page using bootstrap:rst2html5 --bootstrap-css --pretty-print-code --jquery --embed-content examples/slides.rst > bootstrap.htmlto higlight code with pygments:rst2html5 --pygments examples/codeblock.rst > code.htmlnote that you will have to add the stylesheet for the code to actually highlight, this just does the code parsing and html transformation.to embed images inside the html file to have a single .html file to distribute
add the –embed-images option.post processors support optional parameters, they are passed with a command
line option with the same name as the post processor appending “-opts” at the
end, for example to change the revealjs theme you can do:rst2html5 --jquery --reveal-js --reveal-js-opts theme=serif examples/slides.rst > reveal.htmlyou can also pass the base path to the theme css file:rst2html5 --jquery --reveal-js --reveal-js-opts theme=serif,themepath=~/mytheme examples/slides.rst > reveal.htmlit will look at the theme at ~/mytheme/serif.cssoptions are passed as a comma separated list of key value pairs separated with
an equal sign, values are parsed as json, if parsing fails they are passed as
strings, for example here is an example of options:--some-processor-opts theme=serif,count=4,verbose=true,foo=nullif a key is passed more than once that parameter is passed to the processor as a list of values, note that if only one value is passed it’s passed as it is, the convenience function as_list is provided to handle this case if you want to always receive a list.to add custom js files to the resulting file you can use the –add-js post processor like this:rst2html5 slides.rst --add-js --add-js-opts path=foo.js,path=bar.jsthat command will add foo.js and bar.js as scripts in the resulting html file.Pretty Print Code Notesenable it:--pretty-print-codeadd language specific lexers:--pretty-print-code-opts langs=clj:erlangNote: you have to pass both options when passing opts to prettify like this:--pretty-print-code --pretty-print-code-opts langs=clj:erlangthat is, the name of the languages separated by colons, available lexers at the
moment of this writing are:apollobasiccljcssdarterlanggohslispllvmluamatlabmlmumpsnpascalprotordrscalasqltcltexvbvhdlwikixqyamlyou can see the available lexers under html5css3/thirdparty/prettify/lang-*.jsRevealJs Notesto print pass –reveal-js-opts printpdf=true, for example:rst2html5 --jquery --reveal-js --reveal-js-opts printpdf=true examples/slides.rst > reveal-print.htmlthis can be used to open with chrome or chromium and print as pdf as described here:https://github.com/hakimel/reveal.js#pdf-exportMath SupportUse themathrole and directive to include inline math and block-level equations into your document:When :math`a \ne 0`, there are two solutions to :math:`ax^2 + bx + c = 0`
and they are

.. math::

   x = {-b \pm \sqrt{b^2-4ac} \over 2a}Both of these support a basic subset ofLaTeXsyntax.By default,MathJaxis used for displaying math. You can choose a different output format using the--math-outputcommand line option:--math-outputmathjaxuses MathJax (the default)--math-outputhtmlwill use plain HTML + CSS--math-outputmathmlwill useMathML--math-outputlatexoutputs raw LaTeXIf you use MathJax, you can use the--mathjax-urland-mathjax-configcommand line options to configure a custom MathJax JavaScript URL and to provide a file with a custom MathJax configuration, respectively.If you use HTML + CSS output, you can use the--math-csscommand line option to configure a custom math stylesheet.Note that the old MathJax postprocessor (activated using--mathjax) has been deprecated.see ityou can see the examples from the above commands here:http://marianoguerra.github.com/rst2html5/output/clean.htmlhttp://marianoguerra.github.com/rst2html5/output/reveal.htmlhttp://marianoguerra.github.com/rst2html5/output/deck.htmlhttp://marianoguerra.github.com/rst2html5/output/impress.htmlhttp://marianoguerra.github.com/rst2html5/output/bootstrap.htmlexample of video directivehttp://marianoguerra.github.com/rst2html5/output/videos.htmltest itWe usetoxto run our test suite. After installingtoxyou can execute the tests by runningtoxin the project’s root directory.The test cases can be found inhtml5css3/tests.py.want to contribute ?clone and send us a pull request!git clone https://github.com/marianoguerra/rst2html5.git
cd rst2html5
git submodule update --init
python setup.py developnote to self to releaseupdate version on setup.pypython setup.py sdist upload