docs/documentation_style_guide.md
Guidelines to go by when writing or editing any Yii documentation.
This needs to be expanded.
Blocks use the Markdown > Type: . There are four block types:
Warning, for bad security things and other problemsNote, to emphasize key concepts, things to avoidInfo, general information (an aside); not as strong as a "Note"Tip, pro tips, extras, can be useful but may not be needed by everyone all the timeThe sentence after the colon should begin with a capital letter.
When translating documentation, these Block indicators should not be translated.
Keeps them intact as they are and only translate the block content.
For translating the Type word, each guide translation should have a blocktypes.json file
containing the translations. The following shows an example for German:
{
"Warning:": "Achtung:",
"Note:": "Hinweis:",
"Info:": "Info:",
"Tip:": "Tipp:"
}
yii\base\Modelyii\base\Model::$validatorsyii\base\Model::validate()[[]] to generate links to the API documentation. E.g. [[yii\base\Model]], [[yii\base\Model::$validators]], or [[yii\base\Model::validate()]].The following are some scripts that help find broken links and other issues in the guide:
Find broken links (some false-positives may occur):
grep -rniP "\[\[[^\],']+?\][^\]]" docs/guide*
grep -rniP "[^\[]\[[^\]\[,']+?\]\]" docs/guide*
The names of the translators will be listed among the guide authors in the
rendered versions of the guide.
Therefor in each guide directory for a different language than english a translators.json file
should be created that contains an array of names of the people who have participated in the translation.
[
"Jane Doe",
"John Doe"
]
If you have contributed a significant part to the translation, feel free to send a pull request adding your name.