SLIDE 1
Recent Development Directions for makeinfo Patrice Dumas - - PowerPoint PPT Presentation
Recent Development Directions for makeinfo Patrice Dumas - - PowerPoint PPT Presentation
Recent Development Directions for makeinfo Patrice Dumas pertusus@gnu.org GHM 2011 Texinfo and the GNU project Texinfo is the official documentation format for the GNU project Syntax similar with T EX, with structural markup,
SLIDE 2
SLIDE 3
Table of Contents
texi2html and makeinfo: from collaborative competition to rewrite The Texinfo Parser
SLIDE 4
“Recent” makeinfo development until 2008 2000 2005 2010 4 . : H T M L 4 . 1 : H T M L s p l i t , D
- c
b
- k
, X M L 4 . 7 : H T M L X r e f 4 . 1 1 : i 1 8 n 4 . 1 3
SLIDE 5
In parallel with texi2html
2000 2005 2010 L . C
- n
s : s t a r t K . B e r r y O . B a c h m a n n : c u s t
- m
i z a t i
- n
D . R . P r i c e P . D u m a s : p a r s e r , H T M L X r e f M e d i a w i k i
SLIDE 6
texi2html in texinfo
◮ lilypond manual switches to texi2html ◮ July 2008 decision to switch to texi2html in texinfo if made
compatible with makeinfo
◮ September 2008 last texinfo release with C makeinfo installed ◮ June 2010 last stand alone texi2html release, in texinfo source
tree
◮ November 2010 possibility of a first release with texi2html as
makeinfo Selling points: customization (design) Problematic points: speed and design.
SLIDE 7
The new Texinfo Parser development
◮ September to November 2010 a Texinfo Parser is developped ◮ November 2010 decision to use the Parser in next release! ◮ March 2011 enhanced Info backend done ◮ August 2011 HTML backend done
Selling points: correctness, customization and design. Problematic point: speed.
SLIDE 8
Table of Contents
texi2html and makeinfo: from collaborative competition to rewrite The Texinfo Parser
SLIDE 9
The Parser and backends
◮ The Parser parses the Texinfo code into a tree ◮ Additional information is gathered on the tree, like sectioning
and nodes trees
◮ Backends convert the tree to an output format ◮ Perl modules and a command (makeinfo/texi2any) ◮ First level of customization through “customization variables”.
Example USE ACCESSKEY
◮ Convert::HTML fully customizable with hashes and functions
SLIDE 10
The Texinfo tree
Common keys for tree element cmdname the @-command name if corresponding to a command type element type, in general not present with cmdname text a text fragment args array of arguments in @-command brace, or line, or menu entry contents array, all purpose container, holding paragraph content, argument content, block command content parent the parent element extra placeholder for any other information Other keys with line numbers, and directions for sectioning commands and nodes.
SLIDE 11
Example of tree
@quotation Text @@ @code{c} @end quotation { ’cmdname ’ = > ’ quotation ’ , ’ contents ’ = > [ { ’ type ’ = > ’ empty line after command ’ } ’ t e x t ’ = > ’ ’ } , { ’ type ’ = > ’ paragraph ’ , ’ contents ’ = > [ { ’ t e x t ’ = > ’ Text ’ } , { ’cmdname ’ = > ’@ ’ } , { ’ t e x t ’ = > ’ ’ } , { ’cmdname ’ = > ’ code ’ , ’ args ’ = > [ { ’ type ’ = > ’ brace command arg ’ ’ contents ’ = > [ { ’ t e x t ’ = > ’ c ’ } ] } ] } , { ’ t e x t ’ = > ’ ’ } ] } ] }
SLIDE 12
HTML customization
Functions references called for elements. Defined in customization files.
$commands conversion { ’ quotation ’ } = \&my quotation ; sub my quotation ( $$$$$ ) { my $ c o n v e r t e r = s h i f t ; # opaque
- b j e c t
my $cmdname = s h i f t ; # the @−command cmdname my $command = s h i f t ; # the t r e e
- b j e c t
my $args = s h i f t ; # formated arguments a r r a y my $content = s h i f t ; # formatted content my $ r e s u l t = ’ ’ ; i f ($command−>{ ’ e x t r a ’ } and $command−>{ ’ e x t r a ’}−>{ ’ authors ’ }) { $ r e s u l t = ’ With author ’ ; } $ r e s u l t .= ’ pre ’ i f ( $converter − >i n p r e f o r m a t t e d ( ) ) ; $ r e s u l t .= $args −>[0]−>{ ’ normal ’ } i f ( $args − >[0]); return $ r e s u l t . $content ; }
SLIDE 13