Giter Site home page Giter Site logo

sphinx-jsondomain's Introduction

Sphinx JSON Domain

image

image

image

I was surprised that this didn't already exist somewhere when I wanted to describe a JSON document outside of using sphinxcontrib-httpdomain to document one of my APIs. This extension simplifies describing structured JSON documents using a new Sphinx domain.

.. json:object:: Github User

   What Github's API thinks a user looks like.

   :property string login: the user's login
   :property integer id: Github assigned unique user identifier
   :property string avatar_url: url to user's selected avatar image
      or the empty string
   :property string gravatar_url: url to the user's gravatar image
      or the empty string

This will format to something pretty and make references to :json:object:`Github User work as expected. See the `online examples_ for a better idea of what is possible.

Quick Start

Install sphinx and the sphinx-jsondomain package:

$ python3 -mvenv env
$ env/bin/pip install -q sphinx sphinx-jsondomain

Set up the sphinx documentation root and build your documentation set:

$ env/bin/sphinx-quickstart -p my-project -r 0.0 -v 0.0.0 \
> -a 'Dave Shawley <[email protected]>' --quiet docs
$ env/bin/sphinx-build -b html docs build/sphinx/html

Now, find the extensions definition in docs/conf.py and add sphinxjsondomain to the end. Add a json:object directive to docs/index.rst and run sphinx-build again to see the results.

sphinx-jsondomain's People

Contributors

boolangery avatar dave-shawley avatar jeremierapin avatar vhenriet-sfy avatar

Watchers

 avatar

Forkers

vhenriet-sfy

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.