// -- macro declarations: start reading with first headline +BC:\B<\C<__body__>> +CX:\C<\X<__body__>> +ILLT:\LOCALTOC{type=linked depth=1} // -- end of "preface" =0.452 It turned out that 0.451 was still untestable under new developer releases of \C (5.9.5) and above because \C was changed to use \C. Many thanks to Andreas König who figured out which exact developer version change caused the new behaviour, for starting a dialog with the core team and for suggesting a patch to work around the new behaviour of \C under \C control. The suggested patch is applied in this update. This update affects the test suite \I. =0.451 This version is similar to 0.45 in function, it fixes the test suite on UNIX systems. Thanks to Andreas König who triggered me to publish this fix. =0.45 =Fixes * The chapter delimiter parameter of the \CX tag was documented as \C, not \Celimiter>. =0.44 \ILLT =Features * New basic tag \CX. The tag collects index entries of a chapter range (and all included subchapters) or the whole document. The stream contains all the tag options. Generator based converters can rely on additional informations, which include a list of all index entries in the chapter range specified, and a quick ranking - a unified list of indexed phrases and their occurence number. * \CX shows an example implementation for \C<\\INDEXCLOUD> in generator based converters. As SDF cannot paint clouds, the tag is transformed into an ordered ranking list. * \C<\\INDEXCLOUD> implementations in traditional backend based converters are more expensive and depend on the converters internal index management and data structures, so they can vary. \C shall show one possible implementation in future versions. * New value for \CX<\\INCLUDE>'s \CX option: \CX works like \CX, but embeds the file contents as a standard block (which is parsed), instead of as a verbatim block like \C. Parsing an example file is especially handy when working with (highlighting) paragraph filters. =Fixes * \X generator had not been adapted to several of the last stream format updates. * Code passed to \CX<_cnd_> was not accepted if it evaluated to "false" in Perl. Now the valid "0" is handled correctly. =0.43 \ILLT ==Features \ILLT ===Import filter API for the INCLUDE and EMBED tags PerlPoint supports import filters for other formats since package version 0.38, via tag option \C: \\INCLUDE{type=pp ifilter='pod2pp' file="file.pod"} Nevertheless, this could be simplified. With the new option C this can be written as \\INCLUDE{type=pp import=pod file="file.pod"} , given a module \C is installed (note: see the \C distribution for this module). The import module API is new and requires the module to define a function \C, with the same interface as functions for \C. In fact, \C is a shortcut for \C. With \C<\\INCLUDE>, the import option can use the \I as the source format. This is enforced by using a true numeric value for this option, instead of a string: \\INCLUDE{type=pp import=1 file="file.pod"} When both \C and \C are used together \C is ignored. ===Automatic import of entire files The new standard import filter API is used to allow automatic import of source files in other formats. Import is requested by the special prefix \C, like in > perlpoint ... \Bsource.pod With the prefix, PerlPoint treats the file extension (\C) as the name of the source format, searches for the related import module (\C>, again the format is all uppercased in the module name by convention) and invokes it automatically. This feature applies to all existing converters automatically. ===Misc * new option \BC<-version> for \C and \C, thanks to Achim Grolms for the suggestion; * the default file type for C<\\INCLUDE> and the default language for \C<\\EMBED> are \C now; * all generator based converters now accept the new option \C<-acceptedFormat>, which specifies languages to be accepted in included files or embedded snippets (with \C<\\INCLUDE> or \C<\\EMBED>); * parser: slight code optimizations; =0.42 The main intention of this update is to allow the production of better structured results (like correct XHTML). On the way to there, fixes and improvements were made. There should be no incompatibility with 0.41. \ILLT ==Features * Tag authors can declare their tags as standalone now. If the parser finds a text paragraph is occupied by such a tag entirely, the paragraph "wrapper" is removed from the stream. This allows to produce better output for tags that are transformed into something that does not fit into a paragraph. (We had this before for images and a few other special tags, but now this is a general mechanism.) Standalone tags not used standalone have no special effect. * Likewise, if all that is found in a paragraph is an embedded area (\C<\\EMBED{...} ... \\END_EMBED>, the wrapping paragraph directives are removed from the stream. * \C tags now get an \C option by default unless they define their own (the default is "Image"). * \C now reads option files from the start directory, allowing to have a \C<.perlpoint> file in a project tree. ==Fixes * statistics for list shifters did not work; * macro default parameters were not documented! ==Misc * dummy tokens inserted by the parser now are special strings that are filtered out by the backend module, the old string solution injected empty tokens into the stream; =0.41 This is a light update performed with the introduction of \C. No adaptations should be required except for the name change from \C to \C. As \CX is intended to be one converter for many formats, it is now renamed to \CX. It does \I mean other \C converters are out of support in any way which they are not. The idea just came up when thinking about a binary package built with pp (from \C), for which a name of "perlpoint" seems appropriate and memorable. ==Features * \C provides a new option \C<-mainstream> which allows to specify an alternative name for the document stream "main" (as a usage example, this helps to produce S5 slides which require DIV areas with certain names) * main document stream now produces entry and leave point as well, allowing to format this stream a special way in the target format (again, S5 is an example of how this can be used) ==Fixes * Generator classes did ignore the parsers nested table configuration, therefore no generator based converter could provide nested table support. Fixed. ==Misc * Updated \C and \C. * Prepared for use with \C. * Took care to let the distribution pass more Kwalitee (CPANTS) tests. =0.40 This update has two parts. First, it is a feature update. It has a few incompatible changes (see below), but should require only slight adaptations of existing converters. All converters should continue to run or should be adapted soon (as I know there is an adapted Converters package on the way). Second, 0.40 introduces an extended framework, which in this release is in \I because of lacking tests and incomplete docs. Nevertheless, it is well tested in production and should be save to use. Read on for all the details! \LOCALTOC ==Features There are lots of new features, most of all an extended framework which should make it much easier to write converters. The new parts are just \I of the "old" framework which remains in action (and is used by the new parts), so converters using the traditional interface should continue to run. ==Extended framework This version introduces a new converter, \BC ("template driven output"), and a new part of the module framework, the \C hierarchy, which implement a very generic and general converter approach. See the new section "The formatter approach" in "Writing converters" for details about this new model. Here are a few highlights: * Object oriented extension design. * Separation of general function, language specific actions and formatting. * A clear, simple to use, entity based interface for subclassing of only a few methods to overwrite. * All the basic work - dealing with parser, stream, backend and backend events - is already done by \C. * Easy to extend. Generator authors just add formatting. * Every subclass can add additional options. * Every subclass can add additional help portions. * As formatting is determined by the formatter subclass, several templating systems can be used in parallel by just switching the template engine. A general template layer is provided. * \I generators can use styles. * General style format with parts for configuration, templates, docs and screenshots. * Subclasses can be defined even in a style, so a style can come with its own formatters and template systems if necessary. * Most of the docstreaming and index work is now done a central place, so all generators can use it and do not have to deal with it themselves. * \I, and existing converters will continue to run, as the old part of the framework is the base of the new part. The new generator part just adds an additional level of abstraction, making it easier to focus on the target format and layout. ===New SDF generator As a reference implementation, the functionality of \C was reimplemented in the generator model. To produce SDF this way, invoke \C with option \C<-target SDF>. ===First pure XML generator(s) Well, we already had the demo converter that produced XML for PPresenter, but now a \I implementation is available, implemented with the new generator approach. To produce XML, invoke \C with option \C<-target XML>. Best of all, if the result does not meet your needs, it is easy to control entity translation by options. If this is not sufficient, it is easy to write a modified converter by subclassing \C. See \C for an example and "Writing converters" for instructions. Various formatters are available to produce XHTML, paged XHTML and AxPoint. These are published as standalone CPAN packages, watch the PerlPoint namespace or the project side on SourceForge. ===Further reading To learn more about the new features and generators, please read via \C * the docs of \C; * the \I of \C, activated by option \C<-help>, which adapts itself to the \C<-target>, \C<-formatter> and \C<-template> options: Here are a few example calls (each call on one line): pp2tdo -target SDF pp2tdo -target XML pp2tdo -target XML -formatter XHTML pp2tdo -target XML -formatter XHTML::Paged pp2tdo -target XML -formatter XHTML::Paged -templatetype Traditional -templatesAccept XML/XHTML::Paged pp2tdo -target XML -formatter AxPoint ... ... and have a look at the example template provided in the \C subtree. ==Incompatibel changes for users * Empty (reset) variables will no longer be replaced by empty strings. This might become a problem - such variables were occasionally used to start generated text paragraphs, as by Pod::PerlPoint's pod2pp, which wrote: $__pod2pp__empty__= ${__pod2pp__empty__}Converted POD text ... To work around this, use the new optional dot start for text paragraphs: .Converted POD text ... And please install an updated version of Pod::PerlPoint, please ;-) * The first chapter now \I a headline. Comments and all paragraphs not producing visible content (like macro definitions, code fragments and variable asignments) can appear \I the first headline. ==Incompatible changes of the converter API * Modified \I. Anchors now store the absolute number of the page they are defined in. As this is an internal interface, this does not affect document authors. On the other hand, converters will have to be adapted \I they make use of anchors (as far as I know, mostly converters of this package do, which \I adapted as necessary). * \C added to the list of standalone tags (which are stripped of of an enveloping text paragraph if they are its only contents); * \C<\\A> and \C<\\F> are basic tags now, which means they are available to all converters. The original meaning of "F" was \I<\Bont>, but can be generalized now (to "formatting" or something like that). In fact, it formats a selected text, and it is up to the converters how to tranform the various options. (As with \C<\\FORMAT>, conventions will help to establish documents that are portable between converters.) * \BC<\\A> now checks if it is the innermost tag/macro. This \I break existing sources. ==Tutorial Beginning with this release, a tutorial is part of the package. Being in an early state till it already describes the PerlPoint basics. Please have a look. Comments are appreciated. ==Various * Anchor objects now can produce "arbitrary" anchor names on request. * The \I<\\REF> tag now provides the absolute chapter number of the related anchor, in the internal option \C<__chapter__>. * Backends can register a handler for \I directives (\C). This slows down operation, but allows central prehandling of all stream parts where necessary. * Headlines provide additional data: their full and shortcut pathes as well as level and page number pathes, plus variables that are valid when the chapter is complete (for templates). * New warning if the maximum columns number is detected in another line than the first table line (which is the base of normalization). * New parser option \C treats semantic errors as critical, causing the parser to terminate immediately (as after syntactic errors). * New parser option \C excludes comments from the stream. * Input filters can access the source file by a variable \C<$main::_ifilterFile> now. * \I: the absolute number of the page the tag is used on. * Table directives provide additional hints: \C<__maxColumns__> and \C<__titleColumns__>. * New directive DIRECTIVE_DPOINT_TEXT now encloses definition point explanations in the stream. * Text paragraphs can be started by an (optional!) dot now: .Text begins. This is mostly useful when \I PerlPoint from other sources, to make sure the first characters of the converted text will not be interpreted as special PerlPoint characters. * As Clinton Pierce's Perl Projector seems no longer to be supported, the demo converter \C and the module \C were removed from the distribution. ==Bugfixes * A subtile bug could cause parser crashes when an included document contained just a macro without trailing newlines, in a deeper nesting level. The parser now behaves more robust in this area. Thanks to Heike Metz who reported the crash. * Docstream "main" was ignored like any other docstream if working in the "docstream ignore" mode. * Undefind variables were expanded. Fixed. Note: this might turn out to be an incompatible change for you, if you unset an empty variable in order to get an empty string (like Pod::PerlPoint did): $empty= ${empty}Text starts here ... To work around this, use the new optional dot start for text paragraphs instead: .Text starts here ... * There was a general error in variable handling, which caused wrong resolving of backslash preceeded variables in several cases. Thanks to Lorenz for the bug report. * When continuing an ordered list after returning from a nested list, the continued list was treated as "new". This was not really a bug as it was treated as a new list, but continuation would have been more intuitive - now it is there. * The \C option of \CX<\\REF> can handle backslashed commata now - it was not possible before to use headlines with commata as alternatives. =0.39 This update moves a tag (\C<\\X>) from converter definitions to the basic tags. To make use of the new functionality, you need to update to adapted converters. Alternativelely and as a workaround, go to the definition lib, e.g. \C, and delete the definition of the \C<\\X> tag. (Please note that full support of the new index features \I updated converters.) ==Bugfixes * Guarded variables were \I if set up. Oops. Fixed, test added. * \C did not print tables ... * The parser now automatically adds \I composite anchors for a headline, not only for the full headline path. This allows to use partial links like \C or \C for a headline with the full path \C. ==Changes * \BC<\\X> became a base tag like it is in POD. Many thanks to Lorenz who implanted it into PerlPoint with his converters. The tag is defined in \C now. Converters still defining it by their own should be adapted (unless they want to overwrite the basic definition). * \BC<\\X> now checks if it is the innermost tag/macro. * New basic tag \BC provides a full index structure. See \C for details. * Adapted perlpoint-hilit19.lisp to Emacs 21.x. Unfortunately it enforces a warning, but nevertheless does what expected. Might be someone with Emacs Lisp experience can fix this? * Parser change to run under perl 5.8 without errors: \C. Does it work under older perls as well? ==Features ===Index based references Introducing new "index based references". What's this? Imagine a document collection by many authors. It would be nice to cross link related articles. This requires knowledge of all the document parts and would usually be arranged by an informed document manager, or by using technologies like Topic Maps or the like. In any case, it takes time. But what if the collection is frequently updated, or when it is impossible to instrument them for Topic Maps or similar technologies, or if there is neither person nor time to investigate all the stuff in detail? Then you could use this (still experimental) feature of \I. The idea is that index entries point to documents/chapters with substantial information about the index entry. Documents/chapters matching in their index entries are probably content related. In linking to other documents or chapters speaking about the same indexed issues, or to a relevant percentage of the base documents (indexed) issues, one can build cross references automatically. To do so, the package now provides a new base tag \BC which builds a list of related pages. Options specify if the keyword base should be filled with entries from the start chapter only, or shall include all subchapters. Likewise, one can specify if only the index entries at other \I pages should be taken into account, or if \I should be scanned, too. Finally, there's an option to configure a minimal match threshold (absolutely or by percentage). Converters can take the provided chapter list and present them as they like. The appropriate tests and docs were added. ==Docs * The documentation now mentions explicitly that list indentation is reset \I by any subsequent non list paragraph. Thanks to Marcus Holland-Moritz for suggesting this. =0.38 This is maintenance update for paragraph filters. If you are using paragraph filters, it is strongly recommended to upgrade. But hopefully the new features make it worth to update for others, too ;-) The POD input feature, for example. Or any language you like. Read below. There are no incompatibilities between \REF{name="0.37"}<0.37> and 0.38. All PerlPoint sources which passed 0.37 should pass 0.38 as well. All converters should continue to work. ==Bugfixes * Paragraph filters did remove guarded backslashes (\C<\\\\>) and guarded ">" characters (\C<\\>>). Improved. * Paragraph filters restored the original source with bodies for bodyless tags, fixed. * Paragraph filters did not reinsert all backslashes (they handled the first occurence only) when restoring the original source. * Paragraph filters inserted backslashes into verbatim paragraphs when restoring the original source (thanks to Lorenz for the report). * Empty headlines could cause errors and infinite parser loops. * \C: removed occasional warnings displayed without real reason. Fixed a \C usage bug. ==Changes * Tags are streamed with an additional information. Both opening and closing directives now provide a body hint telling a backend programmer if the tag has a body or not. * The lexer makes use of precompiled patterns now, but it seems not to affect the performance of parsing. * \C<\\INCLUDE>, \C<\\EMBED> and \C<\\TABLE> now support the \C<_cnd_> option, like tags defined externally. * Embedded parts and included files can be preprocessed by the new "input filters" - snippets of PerlPoint author defined Perl code transforming the included or embedded parts before they are processed as usual. This is a generic implementation of sourcefile import. For example, it is possible to process POD sources directly now. Here is a simple filter that does the job: \\EMBED{lang=perl} use Pod::PerlPoint 0.03; sub pod2pp { my ($pod2pp, $result)=(new Pod::PerlPoint()); $pod2pp->output_string(\\$result); $pod2pp->parse_string_document(@main::_ifilterText); $result; } \\END_EMBED * Or try the new demo source file, \C, with your favourite PerlPoint converter. (Make sure the cache is deactivated and you are using \C<-active -safe ALL>. Depending on your system, this is a CPU, memory and time consuming job producing over 12.000 pages when processed with perl 5.8.0.) * Demo converters \C, \C and \C got the usual interface (supporting traces etc.). * New trace switch \C<\X> avoids removal of temporary files (which are new as well - and written when on includes files via input filters). ==pp2sdf * Brackets (\C<[]>) seem to have a special meaning in SDF: \C evaluates their contents by \C, which causes a lot of confusion in (Perl) example paragraphs - as a workaround, all opening brackets in blocks are now written as \C<\\[>. * Anchor and links names (in \C and \C specifications) are enclosed by Perls \C operator now, in the hope to avoid trouble with quotes in the anchor. (But what about parantheses in an anchor name now? It seems to work.) =0.37 This is a maintenance update. It can replace version 0.36 transparently except for verbatim block paragraph filters and \C output handling. See next section for details. ==Incompatible changes * Paragraph filters intended to be applied to verbatim paragraphs need to be adapted: they now receive the \I paragraph text \I the enclosing heredoc parts (e.g. \C<< and matching \C). * Extended headline stream interface. This only effects converter authors, but not really, because there are just two \I parameters now. See below. * \BC now needs an explicit result file setup by the new option \C<-sdffile>. Previous versions wrote to \C. ==Bugfixes * \C: \BC<\\SEQ> did not set an anchor when the \C option was specified. * A combination of \C<\\REF>, \C<\\SEQ> and activated cache caused trouble illustrating open tasks in the implementation both of finish hooks and anchor objects. This is fixed, see \REF{type=linked name="0.37 | Features | Cache"} below for details. * For grammatical reasons, paragraph filters applied to blocks or lists could cause trouble in detection of the subsequent paragraph. This is fixed. * Filtered paragraphs were cached but are made potentially dynamic in an unpredictable way by the filter(s). So they are cached no longer. * Filtering of headlines and verbatim blocks was not really fully supported yet. Improved. ==Features \LOCALTOC{type=linked} ===Document streams Robert Inder asked how to achieve an HTML layout where notes are placed below the slide context. When we discussed several ideas, I thought it might be useful to have a general solution which I called \I<"document streams">. Thanks, Robert! So what is a document stream? Consider the following layout: ------------------------------------- | header navigation | ------------------------------------- | | | Title | | | | Introduction text, points etc. | | | ------------------------------------- | | | | Here we are | Here we are | | talking about | talking about | | subtheme 1. | subtheme 2. | | | | ------------------------------------- | notes | ------------------------------------- | trailer navigation | ------------------------------------- The kernel parts can be easily generalized into a more abstract scheme: ------------------------------------- | | | main stream | | | ------------------------------------- | | | | item 1 stream | item 2 stream | | | | ------------------------------------- | stream 3 | ------------------------------------- This may be used in many ways - to compare software or hardware items, to place reader hints besides a main text, to write about the lifes of two or more individuals and present certain life parts in parallel, and so on. But how to distinguish document streams in a PerlPoint document? Well, here are the simple rules: * Every headline (re)enters the main stream. * \I enter certain streams. They are a new one line paragraph type, beginning with a \BC<~> character and ending with the line (like comments do): =Main stream Bla bla \B<~The first docstream> Blu blu \B<~The 2nd doc stream> Bli bli ==Back to main stream Converters need to add docstream support, so currently only \C provides a first (reference) implementation. \I But to implement generally useful methods in the framework, the parser can be set up to transform all docstream entry points into headlines (at a sublevel of the current headline level) or to ignore all document streams at all (except of the main stream). More, docstreams can be skipped more selectively as well: the parsers \C method provides a new parameter \BC to pass the parts to be ignored. When an ignored docstream is entered, all subsequent document parts till the next entry point (or headline) are completely ignored (including conditions - take care). Finally, \I start directives now provide a list of docstreams used in this certain chapter - allowing converter authors to adapt the chapters layout dynamically. See "Writing converters" for details. ===\\INCLUDE Now it's easy to use a central repository of (macro / variable / code / filter / document) libraries: * \BC<\\INCLUDE> now searches pathes specified by an environment variable \BC (similar to \C, shells, linkers etc.) if the specified file cannot be found directly. In the tradition of \C and \C, pathes are delimited by (optional whitespaces and) semicolons. path1\B<;>path2\B<;> path3 \B<;> path4\B<;>path5 * The new C path feature is available immediately with this package version, regardless of converter adaptations. * Converters can pass a new parameter \C to the parsers method \C. The argument of \C should be a reference to an array filled by converter options. I suggest a new conventional option \I<\C<-includelib>> to be invoked multiple times (in the tradition of \C<-I> options available for \C and various compilers). * \C<-includelib> needs converter adaptations, so please use \C till updated converters appear. Pathes specified via \C<-includelib> (or the internal representation \C, respectively) are searched \I pathes specified via \C. * Pathes of included files are resolved now - circular inclusions caused by links pointing to the same file can be detected earlier this way. As a side effect, the resulting absolute file names improve error messages. ===Cache * Paragraphs containing tags using finish hooks are no longer cached. A tag finished after parsing makes the whole paragraph depending on something that cannot be cached on base of the parsed text. * Anchors defined by a cached paragraph are cached now as well - and restored after a cache hit. * The implementation of the mentioned last point required an extension of the internal cache format. Cache files made by versions prior 0.37 will be rebuilt automatically next time they are used. ===pp2sdf * Avoiding more backslashes in paragraphs starting with an SDF command. * New option \BC<-result> to specify an output file. * Supports document streams by three modes: docstreams can be ignored, entry points can be made headlines, or \C can produce one document per docstream. * Provides new conventional converter options \BC<-includelib>, \BC<-docstreaming> and \BC<-skipstream>. ===Misc * Slightly improved the \C file. * \BC now takes a \I of flag names and checks if at least one of the flags is set (implicit \I condition). This makes it more handy to write combined conditions. Thanks to Helmut Steinbach to make me thinking about this. old: ? flagSet('a') or flagSet('b') or flagSet('all') new: ? flagSet(qw(a b all)) * \C was extended by a logging mode to trace newly added anchors. * Added tests of condition interface functions (currently \C and \C). * Improved headline tests. * Added paragraph filter tests. * Paragraph filter functions can access the type of the paragraph using the new variable $main::_pfilterType. * Empty text paragraphs are no longer made part of the stream. * Blocks were streamed with a final newline, improved. * Demos \C and \C auto-anchor headlines now (so \C<\\REF> can be used). * New headline shortcuts. Thanks to Robert Inder who asked for them. A shortcut is a plain string appended to the headline title, separated by a "~". \I =A very long headline which may not fit into the navigation bars \B<~ \I> * Updated \C extensions for Emacs (in the \C directory). * Updated docs. =0.36 This is a major update - in the sense that it modifies a lot of internals, especially stream handling. Nevertheless, it's almost completely compatible with earlier versions of the package (and the few \REF{name="Summary: Incompatible changes" type=linked} most likely do \I affect existing converters). So \I While working on this version, I began to make use of the modified internals myself. As a result, there are various new \I features as well. See section "\REF{name="Visible Changes" type=linked}" below for all details. Internals are described in chapter "\REF{name=Internals type=linked}". \I> (included in CPAN package \C - do \I install the still available standalone distribution of \C). You may have to update \C as well. ==Bugfixes * Several very slight fixes in calls of \C (these bugs caused no errors). * \C embedded native SDF incorrectly into the produced result. Thanks to Lorenz for the bug report. * \C: unintended SDF recognitions caused by ">" characters are now avoided by generating ">" as "{{CHAR:gt}}" (outside verbatim blocks). * If the only contents of a table cell was a \C<0>, this number was removed. Fixed. * If a macro overwrote a tag with the same name and a (parsing) hook, the tag hook was invoked when the macro had been used. * Tag parsing hooks received tag options instead of the tag body. * Helmut Steinbach found that the closing sequences of verbatim blocks made by Active Content were not recognized correctly. This could be fixed. * Investigating the previous point I found that is was also impossible to dynamically make a usual example block or a paragraph that starts with a tag or macro. This is now fixed as well. * Internal bugfix in macro body reparsing. The bug could cause infinite parsing loops. ==Internals This chapter can be safely skipped by "pure" PerlPoint users which might like to continue with chapter "\REF{name="0.36 | Visible Changes" type=linked}". This chapter describes these news: \LOCALTOC{type=linked} ===PerlPoint::Backend, stream format \B<\I> I do not know of any direct stream access in a converter, but \I anyone did access the stream directly, he will need to adapt his code. Code using \C does \I need to be adapted. The stream is still a stream basically, but with additional structural hints stored in parallel, which are currently a stream of headline index numbers. This way I hope to stay with the performance advantages of a stream while enabling things like chapter inspection and arbitrary chapter navigation. For example, \C 0.11 in fact needs to process the stream twice because it needs the whole picture of the headline structure when building slides. Now it would be possible to inspect headlines in the first pass \I, and to process \I tokens in the 2nd pass then. This is a common task - \C might be modified or not, but future converters can definitely make use of this. (And there's an even better and faster way now to grab the TOC, see below.) To make use of the new structure, \C provides several new methods: * \C now works in \I. By default, it processes all tokens as usual. This is called the "token mode". In \I, it processes \I. Switch modes by \BC - even from within a callback! * Navigate within the stream: \BC goes back to the very beginning, while \BC allows you to jump to a certain chapter. * Get the number of all headlines by \BC, and the number of the current chapter by \BC. * The stream data structure is now bound to a backend object while \C is running. If navigation methods, \C or \C shall be called outside \C - which means outside a callback - \BC can be used to perform this binding manually. * Instead of using \C, converter authors may prefer to process the stream step by step having full control (e.g. to use the stream while presenting instead of in format translation). This is possible by using \C, sequential calls of \BC and finally \BC. The new backend method \BC uses the new features to provide a table of contents. If called for a certain chapter, all subchapters are listed. The reported depth can be limited. # get the complete \I $toc=$backend->\B; # get a list of all \I $subchapters=$backend->toc($backend->currentChapterNr); # get a list of the subchapters \I (do not list the complete tree, if there # are more levels) $subchapters=$backend->toc($backend->currentChapterNr, \B<1>); All backend extensions are documented both in \C's POD and in the converter tutorial. Hopefully. ===More stream enhancements * Headline start directives provide the full headline title (plained, which means without possibly used tags) as new data. * Unordered and description list directives now reserve a parameter at the position where \I directives traditionally pass a list startup level. This parameter is currently unused. * All list directives provide four new additional parameters to give converter authors a hint about subsequent or preceeding \I. For reasons of stream construction, hints about \I level shifts are provided in list \I directives \I, while hints about \I level shifts are provided in list \I directives \I. (But these are exactly the places where these informations can help, so symmetry is the only thing lost here.) This feature is intended to help a converter to build really \I lists. (In PerlPoint, a list level shift implicitly closes a previous list, but this is different in various target languages.) * Parser and backend now interact via directive hints. This is an internal interface. For example, it is used to flag that a tag and / or its contents should be skipped (see below). ===New finish hook to complete tags With the new tag declarations by module introduced by version \REF{name="0.34" type=linked}, it became possible to hook into tag parsing. Now there's another hook to \I a tag \I parsing - this means, when all input informations are available. The new \C<\\REF> macro makes use of this feature to verify links and to complete itself by linked content. The new hook interface is quite similar to parsing hooks except that it does not provide informations only available at parsing time (like the tag body). See \C for a detailed doc. ===New hook return codes PARSING_IGNORE and PARSING_ERASE Tag \I hooks can return two new codes: * \BC causes the parser to ignore the tag. The result is just the body. * \BC removes the tag \I which means together with all its content. See the new basic tag \\HIDE for an example. Finish hooks can return these codes as well, with exactly the same effect. (The tag remains streamed (as well as its body), but will be bypassed by the backend.) See \C for a detailed doc. ===Hooks can now be interchanged It is now possible to use hooks of a "foreign" tag (declared by another tag module) in your own tag hooks. This helps to emulate other tags, for example if an \I (tag and option names) shall be preserved but the \I shall be used. To invoke a foreign hook, call \C anywhere in your own hook, passing tag name, hook type and parameters, like so: $rc=PerlPoint::Tags::call('TAG', 'hook', @_); If the tag is not registered, or has no hook of the specified type, an undefined value is supplied, otherwise the return code of the invoked function. ===New anchor management The parser can relieve converters from anchor management partially now. This is an \I. * A new minimal class \BC provides basic anchor collection services. Addresses and related values can be added and queried. * The parser maintains a \C object. * On request, headline titles (stripped off of tags) are automatically added to the parsers anchor collection. (This is inspired by the automatic headline anchors idea by Lorenz, built into \C for versions and already imitated by \C. Why not make it a general feature?) To activate this feature call \C with \C set to a true value. * The parsers anchor collection object is passed to all tag hooks (both parsing and finishing ones), where the collection can be extended (most probably by parsing hooks) or queried (supposedly by finish hooks). This is the complete management for now. The parsers collection is \I made part of the stream. It's just a help to verify links at parsing time, and to insert named values into the stream. The new \C<\\REF> macro uses the parsers anchor collection to resolve values not available at parsing time, like sequence numbers generated by the new \C<\\SEQ> tag. Again: with this feature (and tag finish hooks), it becomes easy to reference strings defined \I than the reference. ===Summary: Incompatible changes Various incompatible modifications might have been mentioned before, but it might be useful to have a check list: * The stream format was \I extended, both in structur and semantics. \C manages this for you. (And you already used it, didn't you? ;-) * List shift paragraphs are no longer streamed by opening \I closing directives. There's only an \I directive from now on. * Tag (parsing) hooks have a modified interface: the tag body is now passed by reference, no longer as a list. This was necessary to add new parameters to the interface. * Tag completion directives in the stream no longer provide exactly the same informations as corresponding start directives, because the new finish hooks are only invoked for startup directives. So, if a tag finish hook modifies tag options, this will affect the startup directive only. (Let me know if this causes problems.) * Likewise, headline start directives in the stream now provide more informations than related completion directives: the full (plained) headline title is only provided with the startup hint. * \C<\\TABLE> tags are streamed with additional informations about the separators used (options \C and options \C). If they were made from a table \I, there's an additional option \C<_paragraph_> set to 1. These informations are intended to be used when a paragraph is retranslated for a \REF{name="New type of active contents: paragraph filters" type=linked}. ==Visible Changes While the modified internals are especially of converter authors interest and do not affect existing documents, there are already \I features in this version implemented on base of the new internals which \I find your interest and help you in writing documents. These new features include: \LOCALTOC{type=linked} Please see the \REF{name="0.36 | Misc" type=linked}<"Misc"> section below for more visible changes which are not based on the modified internals. ===More active content: tags and macros can be made optional If a tag or macro has an option \BC<_cnd_>, the parser treats this option as a \I to activate the tag/macro or not. The condition is evaluated as Active Content. If Active Content is disabled, the condition defaults to "false". \\IMAGE{_cnd_="$illustrate" src="piegraph.gif"} Unfortunately, because it is done via option, only tags and macros \I options can be made conditional. So, \\I{_cnd_="$italics"} cannot be written because of a parsing error. That's bad. If anyone has an idea for a well fitting general solution, please let me know. (Hint for converter authors: the condition option is stripped off of the options hash if the condition (and therefore the tag) turns out to be valid. You cannot evaluate it yourself again.) ===New basic tag \\LOCALTOC \BC<\\LOCALTOC> inserts all subsections of the current chapter (in requested depth). Simply say: =Parent chapter In this chapter: \B<\\LOCALTOC> ==Subchapter 1 ===Subchapter 1.1 ==Subchapter 2 , and a converter will produce results according to \I source: =Parent chapter In this chapter: \B<* Subchapter 1> \B<* Subchapter 1.1> \B<* Subchapter 2> ==Subchapter 1 ==Subchapter 2 I missed something like this tag for a long time, indeed. Think of all the empty pages produced by headlines which just collect various subchapters, but without own text. It is possible to limit the subhierarchy depth taken into account (suppress the display of subchapter 1.1 in the example above by setting \C to 1), to format the produced list in various ways (ordered, unordered, with chapter numbers) and even to make the chapter titles hyperlinks to their related chapters (if supported by the target format). The transformation has to be done \I. As I know, the tag shall be supported by \C<\PP::Converters> 0.12. For now, you may get an impression by using \C which as a reference implementation is already supporting \C<\\LOCALTOC>. ===New basic tag \\SEQ Generates the next value of a certain sequence "type" which is declared by option: \\SEQ{type=example}, \\SEQ{type=example}, \\SEQ{type=example} will produce \C<1, 2, 3>, while \\SEQ{type=example}, \\SEQ{type=image}, \\SEQ{type=table} results in \C<1, 1, 1> (provided no sequence was started before). It is possible to name the generated number, which makes it easy to reference it. Naming is done by option \BC. \SEQ{type=image name="Blue water"} (Note: Converter authors have to deal with this tag a special way because the number is passed by a generated tag \I