wiki:en/doc-guidelines
developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Version 5 (modified by afroxav, 11 years ago) (diff)

--

Documentation Guidelines

Here is a summary of the guidelines for the english documentation. You are free to apply or not these guidelines in the other language.

General writing

There is simple trick that you use when writing documentation. You need to make sure that the content is reader-friendly, so avoid putting to many technical terms: don't talk about Unix sockets when talking of database, even if they are mentioned in the API. Write your documentation as if the reader remember only half of what he read on the preceding pages, but remembers everything from the current page. Be mindful, and don't over-simplify the documentation: advanced users won't like it.

As always, be careful for grammar and spelling mistake. Write in regular, international english and don't use colloquial terms. Always preview your changes, to double check for errors.

Inline code

There are many guidelines for inline code. However, following them will create a consistent look in the documentation

Files and folders

For files and folders referenced inside text, use the inline code syntax. You simply add @@F@ before the path and @@ after. This will make the paths easily identifiable.

@@F@The/path/of/the/file.php@@

Function names

To specify a function name inside a paragraph, surround it with . This will make the function name bold, and catch the eye easier.

**jelixClass::function**
**function** of the jelixClass

Jelix terms

All Jelix-specific terms should be in italics. This will separate generic terms from Jelix-specific terms. Surround the terms with .

//jelix term//

Example code

Example code is code that is used as example, and that could be directly used in a website. First, you need to surround the code with the <code code_type> </code> tags. The most used code types are php, html and ini.

<code html>
<p>A html paragraph</p>
</code>
<code php>
$var = $this->param('var');
</code>
<code ini>
[section]
key = something
</code>
  • Use a single language in the example code. Since most of the documentation was originally a translation from the french docs, examples sometime mix english and french. They should all be edited to include only english.
  • Be consistent in you examples. Use the same examples throughout the whole page. This will make comprehension of the concepts easier.
  • Use 4 spaces to indent the examples. Never use the tab character.
  • Indent the code using the 1TBS coding style.
  • Use clear variable names. Instead of using a variable called $x, use on called $numberOfResultProcessed.
  • Use CamelCase. By enforcing a strict naming convention, code can be consistent.