README 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. $Id$
  2. texinfo/tp/README
  3. Copyright 2011, 2012, 2013, 2014, 2015 Free Software Foundation, Inc.
  4. Copying and distribution of this file, with or without modification,
  5. are permitted in any medium without royalty provided the copyright
  6. notice and this notice are preserved.
  7. Texinfo::Parser (hence the directory name tp) is a Perl module for
  8. parsing Texinfo code into a tree representing the Texinfo code
  9. structure.
  10. These other modules and libraries are required (all have been standard
  11. parts of Perl for years, at least since 5.7.3):
  12. Carp, Config, Data::Dumper, Encode, File::Basename, File::Spec
  13. Getopt::Long, Unicode::Normalize, Storable
  14. It also uses the less widely-available modules:
  15. Locale::Messages, Unicode::EastAsianWidth, Text::Unidecode
  16. For these, internal versions are included, and are installed and used as
  17. part of Texinfo (not disturbing the Perl installation at all).
  18. To run the tests you also need:
  19. Test::More, Data::Compare, Test::Deep
  20. On Debian-based distros, Test::More is part of perl-modules and thus
  21. installed with perl, the packages corresponding to the other modules
  22. are named:
  23. libdata-compare-perl libtest-deep-perl
  24. The tests are in the subdirectories t/ and test/. The tests in t/ test
  25. the Perl modules used by the makeinfo command, and the tests in test/
  26. test the command itself.
  27. This module is part of GNU Texinfo. A standalone Perl module may also be
  28. produced from within the the Texinfo tree, using
  29. ./maintain/prepare_perl_standalone_module_archive.sh
  30. The resulting module, although standalone, should always be regenerated
  31. from the sources in Texinfo, to avoid divergence of sources.
  32. If you want to delve into making a new backend, the documentation in
  33. tp/Texinfo/Convert/Converter.pm is a good starting point, as it
  34. describes the existing backends and other places to look. To do a good
  35. job, expect to spend a lot of time making it do the right thing with the
  36. existing tests.
  37. tp builds a complicated parse tree. It can output a lot of debug
  38. information about the tree, and what it's doing generally. For example,
  39. these commands output the tree (in different forms):
  40. makeinfo -c DUMP_TREE=1 -c TEXINFO_OUTPUT_FORMAT=parse document.texi
  41. makeinfo -c TEXINFO_OUTPUT_FORMAT=debugtree document.texi
  42. In addition (or instead) setting the DEBUG configuration variable will
  43. dump more information about what it's doing.