Skip to content

prometheusresearch-archive/sphinxcontrib-jsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sphinxcontrib.jsx

JSX (JavaScript superset used in React) extension for Sphinx.

Installation

% pip install sphinxcontrib-jsx

Usage

Add sphinxcontrib.jsx to extensions in conf.py:

...
extensions = ['sphinxcontrib.jsx']
...

Now you can use jsx directive in your documentation:

.. jsx::

  var x = <div>Hello!</div>

Snippet above will be shown as literal block and automatically executed on page load.

If you don't want to show source and only execute script, add hidesource options:

.. jsx::
  :hidesource:

  var x = <div>Hello!</div>

Alternatively if you only want to show source and not execute script, use showsourceonly option:

.. jsx::
  :showsourceonly:

  var x = <div>Hello!</div>

To activate ES6 transforms use harmony option:

.. jsx::
  :harmony:

  <ul>
    {children.map(item => <li>{item}</li>)}
  </ul>

To strip type declarations from source code use striptypes option:

.. jsx::
  :striptypes:

  var x: Number = 1

About

Sphinx JSX directive extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages