Contributing¶
Basic guidelines¶
- Fork the project from https://github.com/mondeja/pug-mixins
- Download the source code from github with
git clone https://github.com/<your-user>/pug-mixins.git
or manually fromhttps://github.com/<your-user>/pug-mixins/archive/master.zip
. - Install python dependencies with
pip install -r requirements.txt
. - Fix a bug or create a new feature (and write tests if this is your case).
- Run tests with
make tests
orpytest test
. If something is broken, fix it. - Write documentation for this new features if necessary and build it. See doc/ – Writing documentation.
- Commit your changes and pull
git pull origin master
. - Make a pull request from the github interface. See CI testing for your pull request. If something is broken, fix it and restart the pull request.
See also
Project directories tree¶
src
: Source code of the project. All mixins are catalogued by folders according to their use, not by html tags.doc
: Project documentation. See doc/ – Writing documentation.test
: Project tests wrote withpytest
. See test/ – Testing.scripts
: Useful scripts. You can see here a python script calleddoc_prebuild.py
that loads source code mixins and insert on documentation through jinja2 renderization.
doc/
– Writing documentation¶
Documentation for each new module must be located at doc/source/_templates/
. This folder has the same directories structure of src/
. If you see the existing templates you will observe that mixins source code are included by their name, replacing -
caracters with _
and enclosed by double {
and }
caracters.
Build steps¶
The script located at scripts/prebuild_doc.py
render all source code mixins in their respective files. Execute it normally or use make doc-prebuild
(Linux/Mac users).
Generated output files will be located at doc/source/user_guide/modules/
. This files need to be referenced from doc/source/user_guide/reference.rst
toctrees.
So the build documentation process involves 2 steps, first prebuild with previously explained script and the build process with sphinx
. You can execute this 2 steps secuentially running make doc-build
.
Mixins structure¶
Please, respect documentation structure for each mixin. These must include, at least, the next information in order:
- Source code of the mixin.
- Mixin documentation (description, attributes…)
- Usage example with:
- Input example.
- HTML output of that example.
- Renderization output.