This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Dirty Models Sphinx extension

Sphinx extension for dirty models

About

Sphinx extension to help developers to write documentation of applications which use Dirty Models.

Features

  • Describe each field with real type.
  • All field types defined on Dirty Models are documented.
  • Use prefixed (doc comment using #: before field) or suffixed (Multiline doc string after field) documentation for each field.
  • Document read only fields.
  • Document default value for each field.
  • Document datetime format on those fields.
  • Able to set a prefix text in model signature.
  • Able to set a prefix text in fields signature.
  • Able to document field type as annotation or as field directive.
  • Able to add models to toctree.
  • Able to add model attributes to toctree.

Changelog

Version 0.4.1
  • Fix installation.
Version 0.4.0
  • Document default timezone on TimeField and DatetimeField.
  • Document forced timezone on DatetimeField.
  • Minor fixes.
  • Fix nested classes.
  • Document EnumField.
Version 0.3.0
  • Added option to add models to toctree.
  • Added option to add model attributes to toctree.
  • Added option to set prefix model signature.
  • Added option to set prefix model field signature.
  • Added option to use field type as annotation.
  • Added fields to index.
  • Changed default value label to Default value.

Issues

  • Latex manual document class builder fails when model attributes are in toctree. That is because it creates a fake sections with same ids and remove after toctree is created. So, latex builder does not found references when it try to create links.

Installation

Just use pip to install it:

$ pip install dirty-models-sphinx

And add to Sphinx extensions to your project.

Warning

autodoc extension (included in Sphinx) is required.

conf.py file:

extensions = [
    'sphinx.ext.autodoc',
    'dirty_models_sphinx'
]

Configuration

It is possible to modify Dirty Models Sphinx extension behavior using configuration in conf.py file.

dirty_model_add_classes_to_toc

If it is True Dirty Models classes will be added to table of content. Default: True.

dirty_model_add_attributes_to_toc

If it is True Dirty Models class attributes will be added to table of content, only if classes were added. Default: True.

dirty_model_class_label

It defines a prefix text for Dirty Model class signatures. It is possible to use None in order to avoid prefix. Default: 'Model'.

dirty_model_property_label

It defines a prefix text for Dirty Model class field signatures. It is possible to use None in order to avoid prefix. Default: 'property'.

dirty_model_field_type_as_annotation

If it is True field type will be shown as annotation to attribute. Otherwise, if it is False, field type will be shown as field directive. Default: True.

Usage

Just use regular autodocumenter:

.. automodule:: models
    :members:
    :show-inheritance:

Future

Release History

Release History

0.4.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.4.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.3.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.2.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
dirty-models-sphinx-0.4.1.tar.gz (7.6 kB) Copy SHA256 Checksum SHA256 Source Nov 7, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting