Extension guidelines
These are the rules that govern MoinMoin development:
- Be portable at all times, at the very least to Win32 and Unix.
- Keep the simple nature of page storage, if there are performance issues, add transparent caching / indexing.
- Contributions without accompanying user documentation for the feature are not acceptable.
Contributions without sufficient docstrings and comments are not acceptable. Sufficient means on the level of the existing code base, i.e. higher than you might be used to.
Also see MoinDev/CommonTasks.
Code layout
See also CodingStyle.
Use make check-tabs in the toplevel moin src directory. This will call tabnanny and show you all tabs in your code. Eliminate all these warnings before sending in patches or doing commits,
The code should contain complete docstring documentation, and I prefer code where the inner workings of functions are explained with short inline comments. See the existing code base for examples (though I freely admit there's dark corners in the code).
I18N issues
When writing code containing user interface texts, consider this:
- normal code always uses english texts
those texts have to be marked by using _("literal text")
dynamic portions of these texts are inserted by using something like:
always use %(namedvar)s replacements, never simple ones like %s
do not use "request.getText" directly, always do "_ = request.getText" before using "_(...)" (if we ever switch to standard gettext, this is important, besides "_" cluttering the code much less)
please do not use locals() as psyco does not support code using it
CSS Guidelines
For Moin2 guidelines, see Moin2CSSStyleGuide.