For the past many years we have had 2 and sometimes 3 simultaneous different versions of documentation for template functions. These versions weren't kept in sync. Some versions were wrong. The multiple versions created extra work for translators. In addition, the version visible in the template tester was unformatted so complex documentation such as for format_date() was hard to read.
We have now completed the changes so that:
The documentation on the web won't be updated until the next calibre release (not preview).
Translators and documentation editors:
The documentation uses an invented markup language "Formatter Function Markup Language" (FFML), a subset of BBCODE (used by MobileRead) and RST (sphinx web documentation). Both HTML and RST can be generated from FFML. It is documented in the FFML processing code (calibre.utils.ffml_processor.py), and inside calibre by pushing the (new) "General Information" button in the template tester.
A simple editor/viewer is available in calibre for documentation either while editing or translating. There is no requirement to use it, but doing so might help avoid formatting errors. This viewer/editor is available in two ways:
We have now completed the changes so that:
- the one-true version of the documentation is the one shown in the template tester.
- the web documentation is generated from the documentation in the template tester.
- the template tester shows formatted documentation, with for example code samples and bulleted lists.
- a document browser dialog is available from the template tester via a "Documentation" button.
The documentation on the web won't be updated until the next calibre release (not preview).
Translators and documentation editors:
The documentation uses an invented markup language "Formatter Function Markup Language" (FFML), a subset of BBCODE (used by MobileRead) and RST (sphinx web documentation). Both HTML and RST can be generated from FFML. It is documented in the FFML processing code (calibre.utils.ffml_processor.py), and inside calibre by pushing the (new) "General Information" button in the template tester.
A simple editor/viewer is available in calibre for documentation either while editing or translating. There is no requirement to use it, but doing so might help avoid formatting errors. This viewer/editor is available in two ways:
- Using a shell with the command
all on one line. For the moment this works if you are running from source. It will work with calibre binaries after the next release/preview.Code:calibre-debug -c "from calibre.gui2.dialogs.ff_doc_editor import main; main()"
- By defining a keyboard shortcut in calibre for the action "Open the template documenation editor" in the Miscellaneous section of Preferences / Keyboard shortcuts. There isn't a default shortcut. For my use I set the shortcut to Ctrl+Alt+D.






