    Copyright 2001-2006, 2009-2013
      Free Software Foundation, Inc.

    Copying and distribution of this file, with or without modification,
    are permitted in any medium without royalty provided the copyright
    notice and this notice are preserved.

This file gives an overview of the directories and the main files of
the groff source distribution.


1) The top directory.

  BUG-REPORT    A template for bug-reports.
  ChangeLog     Log of the changes in the different groff versions.
  COPYING       The GNU General Public License (GPL).
  FDL           The Free Documentation License (FDL).
  INSTALL       Information on compiling and installing groff.
  INSTALL.gen   Generic information on configuration and compiling.
  LICENSES      Licensing information.
  MANIFEST      The file you are reading.
  MORE.STUFF    Useful stuff in other packages.
  NEWS          Recent user-visible changes in groff.
  PROBLEMS      Tips to handle known critical situations.
  PROJECTS      Long-term additions to groff.
  README        Availability and contact information for groff.
  README.MinGW  Build information for MinGW.
  TODO          Things planned for future groff versions.

  All other files in the top directory are related to the configuration,
  compilation, and install processes.  


2) The directory structure

./arch          Data that is special for different architectures.
  djgpp         Data special for the 32-bit DOS compiler djgpp.
  misc          Data needed for various platforms.

./contrib       Part of groff, but maintained by other people.
  chem          A preprocessor (for pic) to produce chemical structure
                diagrams.
  eqn2graph     Convert equations created with EQN into different
                graphical formats.
  gdiffmk       An improved implementation of the diffmk command to mark
                differences between groff/nroff/troff files.
  grap2graph    Convert grap diagraps into different graphical formats.
  groffer       A wrapper to conveniently view roff files.
  hdtbl         A sophisticated table macro package.
  mm            The groff mm macro package.
  mom           The groff mom macro package.
  pdfmark       A package to add PDF marks to groff documents, together
                with a shell script (pdfroff) for easy creation of PDF
                documents.
  pic2graph     Convert PIC diagrams into different graphical formats.

./doc           Manuals and tutorials to groff aspects.

./font          Device information and fonts.
  devX100       100dpi device for X Window System.
  devX100-12    100dpi device with narrower font (for 12pt base font).
  devX75        75dpi device for X Window System.
  devX75-12     75dpi device with narrower font (for 12pt base font).
  devascii      Text device for ASCII output.
  devcp1047     EBCDIC device.
  devdvi        TeX DVI device.
  devhtml       HTML device.
  devlatin1     Text device for latin-1 (ISO 8859-1) output.
  devlbp        Device for Canon CAPSL laser printers.
  devlj4        Device for HP Laserjet 4, PCL 5, and compatible printers.
  devps         PostScript device.
  devpdf        PDF device.
  devutf8       Text device for Unicode output.
  util          Utility programs.

./m4            M4 macro files used creating the configure script.

./man           Some groff manual pages of more general character.

./src           Everything written in programming languages.

./src/devices   The postprocessors.
  grodvi        TeX DVI output.
  grohtml       HTML output.
  grolbp        Canon printers.
  grolj4        HP Laserjet 4, PCL 5, and compatible printers.
  grops         PostScript output.
  gropdf        PDF output.
  grotty        Text output.
  xditview      A groff (pre)viewer for the X Window system.

./src/include   The *.h C/C++ include files.

./src/libs      C++ code common to several parts of the groff sources.
  gnulib        Auxiliary functions copied from the `gnulib' repository.
  libbib        Library of bibliographic functions.
  libdriver     Parser for intermediate output and postprocessor code.
  libgroff      Library for general support functions used everywhere.
  libxutil      Utility functions for xditview and xtotroff.
  snprintf      An implementation of snprintf() and friends.

./src/preproc   Preprocessors.
  eqn           Mathematical formulae.
  grn           Gremlin pictures.
  html          The preprocessor part of grohtml.
  pic           Diagram drawer.
  preconv       Input encoding conversion.
  refer         Bibliographic references.
  soelim        File inclusion using tmac path.
  tbl           Tables.

./src/roff      Front-end programs.
  groff         Wrapper around troff.  This is the main user program.
  grog          Guess groff command line options.
  nroff         Emulate classical nroff text formatter.
  troff         Main roff formatter program.

./src/utils     Utility programs around groff.
  addftinfo     Add information to old troff font files for use with groff.
  afmtodit      Create font description files for the PostScript device.
  hpftodit      Create font description files for the LJ4 device.
  indxbib       Make inverted index for bibliographic databases.
  lkbib         Search bibliographic databases.
  lookbib       Interactively search bibliographic databases.
  pfbtops       Translate a PostScript font in PFB format to PFA.
  tfmtodit      Create font description files for TeX DVI device.
  xtotroff      Create font description files for xditview.

./tmac          Macro files.


3) Documentation

The groff documentation is scattered upon several places.

- The main directory contains documents related to the groff source.
  The README file contains the information needed to get the groff
  package, report bugs, and contact the developers.

- The man-page of each program (section 1) is kept in the source
  directory of the program.

- The man-pages for the other sections are found in `src/man'.

- Documentation in other formats are located in the `doc' directory,
  including the groff info file, tutorials, and manuals.

Man-pages have source files ending in `.man'.  Running `make' processes
the files and uses `.n' as the new file extension.  In both cases it is
difficult to quickly decide into which section the man-page shall go. 
Here is a shell command (to be called from the top directory of the
groff source tree) that finds all man-pages and writes the section
number after each file name:

  find -type f \
  | grep '[.]man$' \
  | sort \
  | xargs grep -e '^[.]TH ' \
  | sed -e 's/^\(.\+\): *\.TH.*@MAN\(.*\)EXT@.*$/\1 \2/'


4) The roff parser

The parsing of the roff language is done by troff.  The input is converted
to tokens in `src/roff/troff/input.cpp' and transformed into `nodes' by
`src/roff/troff/env.cpp' and `src/roff/troff/node.cpp'.  From these, the
intermediate output is generated (also in `node.cpp').


5) Postprocessing

The parser for the intermediate output and the postprocessing is in
`src/libs/libdriver/input.cpp'.  This is used by all postprocessors.
