4
/* pprint.h -- pretty print parse tree
6
(c) 1998-2003 (W3C) MIT, ERCIM, Keio University
7
See tidy.h for the copyright notice.
11
$Date: 2003/05/24 15:55:02 $
19
Block-level and unknown elements are printed on
20
new lines and their contents indented 2 spaces
22
Inline elements are printed inline.
24
Inline content is wrapped on spaces (except in
25
attribute values or preformatted text, after
26
start tags and before end tags
30
#define PREFORMATTED 1
37
/* The pretty printer keeps at most two lines of text in the
38
** buffer before flushing output. We need to capture the
39
** indent state (indent level) at the _beginning_ of _each_
40
** line, not the end of just the second line.
42
** We must also keep track "In Attribute" and "In String"
43
** states at the _end_ of each line,
46
typedef struct _TidyIndent
53
typedef struct _TidyPrintImpl
62
TidyIndent indent[2]; /* Two lines worth of indent state */
66
void PPrintDocument( TidyDocImpl* doc );
69
#if SUPPORT_ASIAN_ENCODINGS
70
/* #431953 - start RJ Wraplen adjusted for smooth international ride */
71
uint CWrapLen( TidyDocImpl* doc, uint ind );
74
void InitPrintBuf( TidyDocImpl* doc );
75
void FreePrintBuf( TidyDocImpl* doc );
77
void PFlushLine( TidyDocImpl* doc, uint indent );
78
void PCondFlushLine( TidyDocImpl* doc, uint indent );
80
void PPrintScriptStyle( TidyDocImpl* doc, uint mode, uint indent, Node* node );
82
/* print just the content of the body element.
83
** useful when you want to reuse material from
86
** -- Sebastiano Vigna <vigna@dsi.unimi.it>
89
void PrintPreamble( TidyDocImpl* doc ); /* Between these 3, */
90
void PrintBody( TidyDocImpl* doc ); /* you can print an entire document */
91
void PrintPostamble( TidyDocImpl* doc ); /* or you can substitute another */
92
/* node as body using PPrintTree() */
94
void PPrintTree( TidyDocImpl* doc, uint mode, uint indent, Node *node );
96
void PPrintXMLTree( TidyDocImpl* doc, uint mode, uint indent, Node *node );
99
#endif /* __PPRINT_H__ */