Weave

weave

Perhaps FunnelWeb's weakest aspect is its typesetting facility.

Align table of contents: When FunnelWeb generates a table of contents, the section numbers are not quite aligned with the start of the controlling heading above them.table of contents

Typesetting strength: It should be possible to specify the level of typesetting strength for headings so that short documents do not look overdone when typeset. A new pragma would be good for this.strengthtypesetting

Typeset a portion: Sometimes it is desirable to typeset just a portion of a program. A command line option could be added to do this. The option could accept as its argument, a string containing a list of section numbers or heading names.

Generic typesetter option: In addition to building in a number of different versions of Weave, one for each popular typesetter, it would be possible to add a special generic format where the typeset output is expressed in terms of ıFunnelWeb macros. The user could then specify macro definitions for a non-supported typesetter and run the output through FunnelWeb Tangle to get a typeset file in a format suitable for the unsupported typesetter.typesettergeneric

Suppression of include files: It should be possible to specify in the input file that particular included files not appear in the typeset output. Currently, the fact that an inclusion has occurred is not even represented in the typeset output. Suppression of inclusions is particularly necessary where a library of macros has been included at the top of each of a group of source files.include filesuppression

Cross reference of identifiers: WEB provides a list of identifiers and a list of all the definitions in which they are used. A similar feature could be added to FunnelWeb.crossreferences

Support for non-printables: Currently FunnelWeb does not provide support for typesetting the special @(num) sequences. This should be added.

Support for @+ sequences: Currently Weave does not see @+ sequences as such. Instead it perceives them as ordinary EOLs. However, there are arguments for typesetting them specially.

Typeset text in macro bodies: One of the much-loved features of WEB is the way that it allows the user to switch recursively between document and program formats. FunnelWeb does not allow this, but should. In FunnelWeb, the delimiters @{ and @} are already used consistently to delimit macro text. The @[ and @] sequences have been reserved for the delimitation of documentation text.

Non-tt typesetting: The current version of FunnelWeb sets all its macro text in tt font. This is both a blessing and a curse. It is a blessing because it connects the reader directly to the code, with no complicated intermediary. It is a curse because it looks ugly compared to the beautifully typeset programs produced by other literate programming tools.

The difficulty with adding such beautiful typesetting is that it is necessarily language-specific. Keywords and syntax differ from language to language and it would not be easy to come up with a set of language independent rules.

One approach is to write a set of Weave back-ends, one for each language. Another approach is to ıgenerate back ends. This is the approach taken in the ıSpider systemRamsey89.spider In the ıSpider system, the programmer writes production rules for converting lexical components of the program text into typesetter instructions. The ıSpider program reads these rules and generates a new version of WEB suited for the target language.

For FunnelWeb a slightly different system is proposed in which Spider-like rules appear in the input file and are used directly by Weave to perform the typesetting. An intermediate abstract typesetting language could be used so that the productions can be made language specific, but not typesetter specific.