Code Monkey home page Code Monkey logo

sphinx-variations's Introduction

sphinx-variations

A Sphinx extension that allows project maintainers to create multiple variations of their documentation, based on its usage of the .. only directive. Each variation contains a Sphinx tag and a friendly name.

How to Use

Installing

sphinx-variations is available on PyPi:

python3 -m pip install sphinx-variations

After installing the package, list the extension in your Sphinx project's conf.py.

extensions = [..., 'variations']

Configuration

To create multiple variations for your docs, a list of tags to use as variations can be inserted into your conf.py file:

variations = [( [tagname], [friendly name] )]

For example:

variations = [('python', 'Python'),
              ('cpp', 'C++')]

The above will cause two copies of the documentation text to be made, each in a directory with the tag name. Static files are not copied between the two variations, but are shared between them.

Template Variables

This extension also provides two template variables, variations and currentvariation.

variations contains the complete list of variations in the same format specified above, and currentvariation contains the tuple for the current variation.

These variables can be used to create links between the different variations of your documentation, for example.

License

MIT, see LICENSE.

sphinx-variations's People

Contributors

rdb avatar treamology avatar

Watchers

 avatar  avatar  avatar

sphinx-variations's Issues

Cannot install from source distribution

Because the setup.py imports __version__ from the module, which imports Sphinx, it is impossible to install from source distribution without Sphinx first being installed. Even a setup_requires will not work here because it won't be able to get to the point where it's defined without Sphinx.

I would suggest either having a separate variations/__version__.py that does not import Sphinx, or having the version number in two places.

Does not work with latex builder

When using make latexpdf, the following error message is generated:

  File "/usr/lib/python3.7/site-packages/sphinx/writers/latex.py", line 2486, in unknown_visit
    raise NotImplementedError('Unknown node: ' + node.__class__.__name__)
NotImplementedError: Unknown node: VariationNode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.