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
Add this to settings.py ''' AUTO_DOC = True ''' This flag controls the generation of documentation
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.
Metadata
Release files for django-docme 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_docme-0.1.6-py3-none-any.whl | Python 3 | none | any | Details for django_docme-0.1.6-py3-none-any.whl |
Release files / django_docme-0.1.6-py3-none-any.whl
| Download URL | django_docme-0.1.6-py3-none-any.whl |
|---|---|
| Size | 167.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f66f1b52b82ce3ce7028deb02a0b9b60a9ae5533b7d307a22cd0577220fb56af
|
|
BLAKE2b-256 checksum How to use checksums |
2852adcd930863066d5c949fb3f7e902dfa83472cc00610bb168e824f655a603
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for django-docme 0.1.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.