![]() |
The documentation system | ![]() |
The documentation of TeXmacs, including the present text, consists of ordinary TeXmacs documents in the directory
src/TeXmacs/doc/
(installed as $TEXMACS_PATH/doc). They are written in the tmdoc style, linked together by traverse blocks, and shown in the help browser, compiled into books, converted into the TeXmacs web site, scanned for the documentation of Scheme functions and macros, and searched. This chapter describes how these pieces are implemented.
How to write documentation as an author (meta information, the traversal tags, the explain environments, conventions for file names) is explained in contributing to the TeXmacs documentation. The tmfs://help/, tmfs://apidoc/ and tmfs://grep/ handlers are listed in the TeXmacs file system handlers. The present chapter does not repeat these texts.
styles/documentation/texmacs/tmdoc.ts
) loads the package doc, which combines four packages: tmdoc-markup (markup for names, files, links and explain), tmdoc-gui, tmdoc-traversal (titles, copyright, license and the traversal tags) and tmdoc-framed. In the editor, the traversal tags simply render as lists of hyperlinks.
Documentation files are looked up in $TEXMACS_DOC_PATH, which contains $TEXMACS_HOME_PATH/doc, $TEXMACS_PATH/doc and the doc directories of all plug-ins. Each page exists in one file per language, name.xx.tm; the language of the user interface selects the file, with English as fallback.
The Help menus call load-help-buffer, load-help-article or load-help-book, which open tmfs://help/type/… URLs. For the types other than normal, the handler expands the page: it follows its traverse branches recursively and concatenates all pages into one document, turning page titles into sectional headings.
The web site generator (
doc/tmweb.scm
) converts a directory tree of documents to HTML; the full text search (
doc/docgrep.scm
) and the search for the documentation of a tag, style or function (
doc/tmdoc-search.scm
) scan the help path; the API documentation (doc/apidoc*.scm) builds a cache of all explain blocks for Scheme functions and macros, and the glue generator produces the reference of the C++ routines exported to Scheme.
Paths are relative to
src/TeXmacs/
.
styles/documentation/texmacs/tmdoc.ts
The tmdoc style: page layout, fonts and the code markup (verbatim, scm, cpp, …).
packages/documentation/doc.ts, packages/documentation/standard/tmdoc-*.ts
The documentation packages;
tmdoc-web.ts
and
tmdoc-web2.ts
are used by the web site styles tmweb and tmweb2 (and by the Mathemagix documentation styles),
scheme-api.ts
by the API pages. The style tmmanual is used for compiled books.
progs/doc/help-funcs.scm
The help path, resolution of help files by language, load-help-buffer and friends.
progs/doc/help-menu.scm
The Help menu.
progs/doc/tmdoc.scm
Expansion into articles and books, the tmfs://help/ handler, tmdoc-include.
progs/doc/tmdoc-edit.scm,
tmdoc-menu.scm,
tmdoc-kbd.scm,
tmdoc-drd.scm,
tmdoc-markup.scm
Editing support for documentation documents.
progs/doc/tmweb.scm
The web site generator.
progs/doc/docgrep.scm,
progs/doc/tmdoc-search.scm
Searching.
The API documentation of Scheme symbols and modules.
progs/utils/test/test-convert.scm
Building the PDF manuals (build-manual).
src/src/Scheme/Glue/build-auto-doc,
make-apidoc-doc.scm,
make-apidoc-module.scm
The generator of
doc/devel/scheme/api/glue-auto-doc.en.tm
and
progs/prog/glue-symbols.scm
.