DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Rendering on docs.typo3.org

When you upload your extension to the TER, the associated Sphinx/reStructuredText-based documentation gets automatically rendered on https://docs.typo3.org under https://docs.typo3.org/typo3cms/extensions/extension-key/.

For instance, this documentation gets rendered to https://docs.typo3.org/typo3cms/extensions/sphinx/.

In addition, a zip archive is automatically created for each combination of version and language and contains a copy of the HTML output (a.k.a. "static layout" within this extension) and its PDF counterpart (if activated, see below). Archives are stored within https://docs.typo3.org/typo3cms/extensions/extension-key/packages/ extension-key-version-language.zip. E.g.,

The list of available packages can be seen on https://docs.typo3.org/typo3cms/extensions/sphinx/packages/packages.xml (you may of course replace segment /sphinx/ with any other extension key).

Caution

Files and URIs are generated lower-case and with dashes instead of underscores. This means that a documentation with language (or to be exact locale) fr_FR will be accessible using fr-fr instead.

Topics in this chapter

PDF rendering

The PDF of your documentation is rendered using the LaTeX builder from Sphinx (see Rendering PDF from reStructuredText if needed) and should be explicitly activated for your extension. To do so, open file Settings.yml (at the root of your documentation folder) and make sure it contains following configuration options (lines 6 to 15):

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
conf.py:
  copyright: 2013-2015
  project: Sphinx Python Documentation Generator and Viewer
  version: 2.3
  release: 2.3.0
  latex_documents:
  - - Index
    - sphinx.tex
    - Sphinx Python Documentation Generator and Viewer
    - Xavier Perseguers
    - manual
  latex_elements:
    papersize: a4paper
    pointsize: 10pt
    preamble: \usepackage{typo3}

Lines 7 to 11 define options for value latex_documents which determines how to group the document tree into LaTeX source files. This is a list of tuples: startdocname, targetname, title, author, documentclass, where the items are:

startdocname

Document name that is the "root" of the LaTeX files. All documents referenced by it in TOC trees will be included in the LaTeX file too.

Warning

Always use Index here.

targetname

File name of the LaTeX file in the output directory.

Warning

Always use your extension key followed by .tex here.

title
LaTeX document title. This is inserted as LaTeX markup, so special characters like a backslash or ampersand must be represented by the proper LaTeX commands if they are to be inserted literally.
author
Author for the LaTeX document. The same LaTeX markup caveat as for title applies. Use \and to separate multiple authors, as in: 'John \and Sarah'.
documentclass

Normally, one of manual or howto (provided by Sphinx).

Tip

To keep TYPO3 branding, you should always use manual here.

Lines 12 to 15 should be kept as-this. Line 15 is actually the "trigger" for PDF rendering.

When activated, your PDF gets automatically rendered on https://docs.typo3.org under https://docs.typo3.org/typo3cms/extensions/extension-key/_pdf/. E.g., https://docs.typo3.org/typo3cms/extensions/sphinx/_pdf/.

Please read chapter Customizing the rendering for further information on LaTeX configuration options.

Multilingual documentation

Multilingual exension manuals are supported by both this extension and https://docs.typo3.org. If you want to translate your documentation, kickstart a new Sphinx project (incl. Settings.yml) within directory Documentation/Localization.locale.

Tip

You may reuse assets such as Includes.txt or images from the main documentation under directory Documentation but not the other way around, so you cannot reuse assets from a translated manual within the main (English) manual.

Locales

Unless for the few prefixes which are already "locales", https://docs.typo3.org expects a locale and not a language code to be used; so make sure to extend the prefix accordingly. E.g., a French documentation (prefix fr) should be extended either to fr_FR (French France) or fr_CA (French Canada). See our list of suggestions below.

Your translated exension manual will get rendered to https://docs.typo3.org/typo3cms/extensions/sphinx/fr-fr/ (HTML) and https://docs.typo3.org/typo3cms/extensions/sphinx/fr-fr/_pdf/ (PDF).

Caution

Files and URIs are generated lower-case and with dashes instead of underscores. This means that a documentation with locale fr_FR will be accessible using fr-fr instead.

The list of supported languages for Sphinx is:

Prefix Name Suggested Locale
bn Bengali bn_BD
ca Catalan ca_ES
cs Czech cs_CZ
da Danish da_DK
de German de_DE
es Spanish es_ES
et Estonian et_EE
eu Basque eu_ES
fa Iranian fa_IR
fi Finnish fi_FI
fr French fr_FR, fr_CA
hr Croatian hr_HR
hu Hungarian hu_HU
id Indonesian id_ID
it Italian it_IT
ja Japanese ja_JP
ko Korean ko_KR
lt Lithuanian lt_LT
lv Latvian lv_LV
mk Macedonian mk_MK
nb_NO Norwegian Bokmal nb_NO
ne Nepali ne_NP
nl Dutch nl_NL
pl Polish pl_PL
pt_BR Brazilian Portuguese pt_BR
ru Russian ru_RU
si Sinhala si_LK
sk Slovak sk_SK
sl Slovenian sl_SI
sv Swedish sv_SE
tr Turkish tr_TR
uk_UA Ukrainian uk_UA
zh_CN Simplified Chinese zh_CN
zh_TW Traditional Chinese zh_TW

Best practices

When translating a documentation, you may be tempted to translate everything, including directory and file names. Although this sounds reasonable at first sight, we advise you not to do so.

In fact, best practices show that if you keep the original directory and file names, you let readers quickly switch back and forth from a chapter to its translation on https://docs.typo3.org because the language switch (currently hidden in the "version" dropdown) simply searches for the same relative URI in the translated documentation. If it finds the same document, it will go to the very same chapter (but translated!) otherwise it will go to the start page.

This is depicted by the following figure. The second navigation bar (French documentation) shows that directory and file names have been preserved. It is thus possible to switch from the original, in English, to the French translation by prefixing the URI segment fr-fr/. In the third navigation bar however, the directory and files names have been translated as well, making it impossible to match chapters with their translated counterparts:

Translating URI segments

Let visitors edit manual on GitHub

In case your extension is hosted on GitHub, you may want to let visitors of https://docs.typo3.org edit the documentation of your extension by pressing a button "Edit me on GitHub":

Link to edit the chapter on GitHub

This button is not shown by default. To make the button visible, you need to specify the relative URI of your GitHub project repository and the branch you want to use for documentation changes (typically "master") in the configuration file Documentation/Settings.yml in your repository:

1
2
3
4
5
6
7
8
conf.py:
  copyright: 2013-2015
  project: Sphinx Python Documentation Generator and Viewer
  version: 2.3
  release: 2.3.0
  html_theme_options:
    github_repository: xperseguers/t3ext-sphinx
    github_branch: master

where xperseguers/t3ext-sphinx is the relative URI in http://github.com/xperseguers/t3ext-sphinx.

The button will be visible the next time you publish your extension to TER.

Note

Every official TYPO3 manual, guide and reference is using this option, making it a breeze to contribute if you spot a typo or wish something got rephrased or better explained.

Multilingual manual

In case you are providing a multilingual documentation as described above, the translation may of course be easily edited on GitHub as well.

For this to work, the configuration file Documentation/Localization.locale/Settings.yml should provide an additional option github_sphinx_locale:

1
2
3
4
5
6
7
8
9
conf.py:
  copyright: 2013-2015
  project: Générateur et visionneuse de documentation Sphinx Python
  version: 2.3
  release: 2.3.0
  html_theme_options:
    github_repository: xperseguers/t3ext-sphinx
    github_branch: master
    github_sphinx_locale: fr_FR