Abstract
Usage and implementation of a utility program to generate listings of text files in PDF format.
This publication is available in Web form and also as a PDF document.
Please forward any comments to tcc-doc@nmt.edu.
Table of Contents
BOUND_MARGINUNBOUND_MARGINNARROW_MARGINCOL_GAPFONT_ASPECTODD_MASTEREVEN_MASTERREPEAT_MASTERODD_BEFOREEVEN_BEFOREHEADING_EXTENTMONO_FAMILYMONO_FONTHEAD_SIZEHEAD_FAMILYHEAD_FONTPAGE_NO_GAPHAIRLINE_WIDELEFT_RULE_PADOVERFLOW_COLORWRAPPER_PROPSOVERFLOW_INDENTOUT_BLOCK_PROPSmain(): Main logic of listextsetupLayout(): Configure the page
layoutflowSetup(): Build the XSL-FO layoutbuildMasters(): Set up the page
formatsaddFlow(): Populate the page-sequence elementbuildStatic(): Set up page headingswrapFlow: Add a styling block-containerfatal(): Fatal error loggingclass Args: Command line
argumentsclass BodyLayout: Page geometryclass InputFile: Input sliced to fitInputFile.genBlocks(): Generate contained
blocksInputFile.__init__(): ConstructorInputFile.__readFile(): Slice up the
input linesInputFile.__readLine(): Process one input
lineInputFile.__trimLine(): Implement length
changesInputFile.__sliceLine(): Cut an input line
into output linesInputFile.__findBreaks(): Implement
--breakInputFile.__genChunks(): Bracket the
chunks separated by break stringsInputFile.__addChunk(): Add one chunk
of lines to the column structureInputFile.__delBlankCols(): Suppress
entirely blank columnsInputFile.__genCols(): Find the columns in
the block listInputFile.__anyNonblank(): Does this
column contain any nonblank lines?class Heading: Information for the running
headHeading.__init__(): ConstructorHeading.__getModTime(): Find the file's
modification timeHeading.__getPaths(): Set up the directory
path and file nameHeading.rightContent(): Render a
right-hand page headingHeading.leftContent(): Render a left-hand
page headingHeading.__buildStatic(): Build a header's
static-contentclass OutBlock: One output blockOutBlock.__init__(): ConstructorOutBlock.setBreak(): This block starts a
new columnOutBlock.isBreak(): Does this block
start a new column?OutBlock.__makeBlock(): Build the block elementOutBlock.renderLine(): Render
textOutBlock.renderChar(): Translate one
character to XSL-FOclass FirstBlock: Block for the first or
only lineclass OverflowBlock: Overflow continuation
blockThe author relies heavily on paper listings of ordinary text files, even here in the 21st Century, long past the time when the Paperless Office was supposed to be a reality. Aside from their archival value, sometimes there is no monitor big enough to display all the resources one needs during software design; paper listings on a big physical work table can greatly extend the virtual workspace.
General requirements:
Show the input file's absolute path name and the timestamp of its last modification on each page.
Provide a variety of font sizes, interline spacing, and multi-column output so that wrapped lines can be minimized, yet display wrapped lines in a way that minimizes interference with the perception of indentation in the input file. Omit columns that contain only empty lines or lines consisting entirely of whitespace.
For characters that are not normally printable, display their codes instead in a format different than any ordinary character. We will use a tiny font to display the two-character hexadecimal code for each character in the space usually occupied by a single character.