GNU TeXmacsUser manualReferenceAboutEnglish
Web site, search and API documentation

1.The web site generator

The TeXmacs web site is built from a directory tree of TeXmacs documents by

progs/doc/tmweb.scm

. The entry points are

tmweb-convert-dir, tmweb-update-dir

Convert, or update, the tree tm-dir into html-dir. They are called by the command line options -W in out and -U in out (see command line options).

tmweb-convert-dir-keep-texmacs, tmweb-update-dir-keep-texmacs

The same, but the .tm files are copied as well.

tmweb-interactive-build, tmweb-interactive-update, open-website-builder

Interactive variants which ask for the two directories; the last one opens a dialog and remembers the directories in the preferences website:src-dir and website:dest-dir. They are declared lazily in

init-texmacs.scm

but no menu calls them.

tmweb-convert-directory enumerates all files below the source directory. Every .tm file is exported to HTML (or XHTML, if the preference texmacs->html:mathml is on) with export-buffer-main, at the same relative place in the destination; the auxiliary data are generated first (with-aux). All other files (images, style sheets, …) are copied, except backup files, files below hidden directories and version control directories. Missing destination directories are created. In update mode a file is only converted or copied if the destination is missing or older than the source (url-newer?); a known problem of url-newer? with the file attribute cache can make updates skip changed files (see the system layer).

The HTML conversion itself is described in the HTML export; the web pages use the tmweb styles, whose packages add the navigation bars and the classification of pages (tmweb-insert-classifiers).

2.Full text search

Help\(\rightarrow\)Search\(\rightarrow\)Documentation and the neighbouring entries call docgrep-in-doc, docgrep-in-src and docgrep-in-recent (

progs/doc/docgrep.scm

). They open tmfs://grep/type=type&what=words, whose handler collects the candidate files and ranks them:

doc

All files *.xx.tm and *.xx.tmml of $TEXMACS_DOC_PATH for the current output language xx.

Scheme, Styles, C++, All code

The Scheme files, style files and C++ sources (the latter under $TEXMACS_SOURCE_PATH/src).

recent, texts

The 50 most recent files, or the documents in $TEXMACS_FILE_PATH.

Each file is scored by the C++ routine search_score (

src/src/System/Files/file.cpp

, glue system-search-score): the scores of the individual words are multiplied, a word counts ten times more when it is a whole word, and in .tm files occurrences inside tag names do not count while occurrences in name, tmstyle, explain-macro and a few other tags count more. Words are lower cased and, for .tm files, converted to the escaped Cork form used in the files. The result page lists the matching files with their titles (help-file-title), sorted by score in percent of the best one. The lists of files are cached per path and pattern for the whole session.

3.Finding the documentation of an item

progs/doc/tmdoc-search.scm

finds the explain block which documents a given item, that is, whose header contains the item in the corresponding markup: tmdoc-search-tag for a tag (explain-macro or markup), tmdoc-search-style for a style or package (tmstyle or tmpackage), tmdoc-search-parameter for an environment variable (var-val or src-var) and tmdoc-search-scheme for a Scheme function (scm with the function name at the start). It first selects the files of the help path which contain the corresponding markup as a string (url-grep) and then searches their trees; if nothing is found for the output language, English files are searched. These routines are used by the contextual help of the focus toolbar (

generic/generic-doc.scm

) and by the macro editor (

source/macro-widgets.scm

).

4.The API documentation

The tmfs://apidoc/ pages (Help\(\rightarrow\)Scheme extensions\(\rightarrow\)Browse modules documentation, Browse symbols documentation, and the module and symbol browsers of the developer menu) show, for Scheme functions and macros, their documentation together with their source code and module. The documentation comes from a cache of explain blocks (

progs/doc/apidoc-collect.scm

):

The C++ routines exported to Scheme are documented separately in the glue auto-documentation. That file and

progs/prog/glue-symbols.scm

are generated from the glue declarations by

src/src/Scheme/Glue/build-auto-doc

(with

make-apidoc-doc.scm

and

make-apidoc-module.scm

); see the glue generator.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".