Recent Development Directions for makeinfo Patrice Dumas - - PowerPoint PPT Presentation

recent development directions for makeinfo
SMART_READER_LITE
LIVE PREVIEW

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-1
SLIDE 1

Recent Development Directions for makeinfo

Patrice Dumas pertusus@gnu.org

GHM 2011

slide-2
SLIDE 2

Texinfo and the GNU project

◮ Texinfo is the “official” documentation format for the GNU

project

◮ Syntax similar with T

EX, with structural markup, for technical manuals

◮ competition:

Docbook benefits of XML, but lots of markup L

AT

EX presentation markup Asciidoc less structured

◮ two converters:

texi2dvi, texi2pdf plain T EX to convert to dvi, ps, pdf makeinfo, texi2html, texi2any converts to Info, HTML, Docbook, Texinfo XML

slide-3
SLIDE 3

Table of Contents

texi2html and makeinfo: from collaborative competition to rewrite The Texinfo Parser

slide-4
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
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
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
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
SLIDE 8

Table of Contents

texi2html and makeinfo: from collaborative competition to rewrite The Texinfo Parser

slide-9
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
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
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
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
SLIDE 13

The future

◮ a release as soon as possible (docbook, Texinfo XML) ◮ @node and @menu automatic generation ◮ re-enable math formatting through latex2html/tex4ht ◮ maybe revive Mediawiki, roff outputs ◮ finish L AT

EX backend

◮ epub, odp? ◮ use m4 to preprocess the Texinfo ◮ more simple math commands, and math environments