Skip to main content

A Django app to generate documentation from behave tests.

Project description

Django-docme

Django-docme is a python library to generate user documentation automatically. For that it uses the behavior tests written with Behave.

Basic usage

On environment.py, write like this:

#imports
from docme import docme

#Hooks definitions like: before_all, after_scenario, etc.

options = {"output-formats": ["pdf"]}
docme.auto_doc(locals(), "App name", options)

The options variable provides the configuration parameters for generating the documentation. Possible parameters are:

  • output-formats -> provide output documentation formats. Available formats are: 'pdf' e 'html'.
  • step_vertical_html -> path to custom html file to document vertical formatted steps. This is optional.
  • step_horizontal_html -> path to custom html file to document horizontal formatted steps. This is optional.
  • css_file -> path to custom css file to customize the documentation style. This is optional.

Marks on features files

To guide the documentation process, it is necessary to create markups in the files that describe the features. The markings are added to the names of the features, scenarios and steps as shown below:

Feature: showing off behave:docme
 Feature descripton

 Scenario: run a simple test:docme
    Scenario description
    Given we have behave installed:docme:vertical
    """
       Text that describes what the step does.
    """
    When we implement a test
    Then behave will test it for us!:docme

The possible markings are:

  • :docme -> Indicates that the element (features, scenarios and steps), must be documented.
  • :vertical -> This mark is exclusive for steps. By default, the step is displayed horizontally in the documentation. A screenshot of the browser is displayed on the left side and its title and description on the right. With this mark, the step indicate to be displayed vertically, that is, the scrrenshot above and title and description below.
  • :dumpme -> Exclusive for scenarios, this markup provides a sql dump after run scenario.
  • :before -> Exclusive for scenarios with :dumpme mark, this markup provides a sql dump before run scenario.
  • :notitle -> Exclusive for steps, indicates that the title will not be displayed in the documentation.

Steps tables

Some steps do interactions with forms. The fields and values of this interaction are sometimes expressed through the steps tables. These tables can be documented as shown below.

Scenario: some scenario
   Given that I log in:docme:withformexample
     | name:label   | department:value  |
     | username     | username_value    |
     | password     | password_value    |

As can be seen in the example, to document tables steps it is necessary to add the flags :docme and :withformexample to the step name. In addition, it is necessary to indicate the column with the field name, using the flag :label and the column with the field value, using the flag :value.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-docme-0.1.1.tar.gz (127.2 kB view details)

Uploaded Source

Built Distributions

django_docme-0.1.1-py3.7.egg (165.4 kB view details)

Uploaded Source

django_docme-0.1.1-py3-none-any.whl (166.3 kB view details)

Uploaded Python 3

File details

Details for the file django-docme-0.1.1.tar.gz.

File metadata

  • Download URL: django-docme-0.1.1.tar.gz
  • Upload date:
  • Size: 127.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.5

File hashes

Hashes for django-docme-0.1.1.tar.gz
Algorithm Hash digest
SHA256 43d420000545aab271426930c92cdc733f798a0d9028af5183360eb277cceb9c
MD5 84e11c6cf06f35cdd89347ca6029efa0
BLAKE2b-256 06830db8436a4c220f1d868fa5b7ae751ccc6740f9a7c8f10c5d086be91a516b

See more details on using hashes here.

File details

Details for the file django_docme-0.1.1-py3.7.egg.

File metadata

  • Download URL: django_docme-0.1.1-py3.7.egg
  • Upload date:
  • Size: 165.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for django_docme-0.1.1-py3.7.egg
Algorithm Hash digest
SHA256 43c0e8db7b5604415911c82db54a39164464f8f957674e1c84347e914755df2a
MD5 5072da6fc5626ed33cda9aecae93443d
BLAKE2b-256 a482f64c1b974ead57ab9f7f26c2b67c784430c34b5f881fcac143de9b750e7d

See more details on using hashes here.

File details

Details for the file django_docme-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: django_docme-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 166.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.0

File hashes

Hashes for django_docme-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9b44b626b7e9defd3c1be6d9f548f9f3003a247909ed181cdb60f362622f6a
MD5 9299529c5fbf872e054c6645da48f9e6
BLAKE2b-256 4ab45af597d2654bae972235c7edf395c5790f38ed8eb63e53bd4766eed7be27

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page