Commit graph

81 commits

Author SHA1 Message Date
Fred Drake
080c1b5af6 bwrite(), ewrite(): Helpers for diagnostic output; essentially the
same as sys.stderr.write(), but bwrite() will make it
		bold if stderr is a tty (for visibility).

		Use these everywhere instead of accessing
		sys.stderr.write() directly.

find_all_child_elements():  Find all elements by type name that are
		immediate children of another.

cleanup_synopses():  Receive both the document and fragment objects as
		parameters; if only the document is passed, synopsis
		information is never found since it's in the fragment!

build_para():	Add a chunk of code to ensure that a newline always
		follows the </para> end-tag.  Not really important, but
		makes presentation consistent for authoring/
		maintenance.

fixup_bifuncindexes_chunk(): Use find_all_child_elements() instead of
		find_all_elements() so we don't work with too many
		levels at once; that could cause DOM exceptions with
		the <elem>.removeChild() method.
1999-08-02 14:46:15 +00:00
Fred Drake
4fbdf9779c Mostly minor changes.
Removed some obsolete commented-out code.

Merged BaseConversion into Conversion since there's only one
conversion process now.

Remove push/pop of output stream; it's no longer needed.
1999-08-02 14:35:25 +00:00
Fred Drake
d158b85896 This doesn't need to do nearly as much for the new conversion, so
simplify.
1999-08-02 14:32:46 +00:00
Fred Drake
031e222499 A few small improvements to the conversion. 1999-08-02 14:32:11 +00:00
Fred Drake
eac8abee4e Ripped out the old conversion. 1999-07-29 22:42:27 +00:00
Fred Drake
865e9ff98e Added a few more passes through the document fragment. Not actually
very interesting.
1999-07-29 22:23:19 +00:00
Fred Drake
96e4a06fa6 Massive changes.
Separate the Conversion class into a base and a subclass; the subclass
is pretty minimal but the separation is useful for....

NewConversion:  New class that implements a somewhat different
		approach to the conversion.  This uses a table of
		instances (rather than tuples) that have more
		information than the tuples used for the older
		conversion procedure.  This allows a lot more control
		over the conversion, and it seems to be pretty
		stable.

TableEntry,
Parameter:	New classes that are used to build the conversion
		specification used by NewConversion.

TableParser:	xmllib.XMLParser subclass that builds a conversion
		specification from an XML document.

load_table():	Convenience function that loads a table from a file.

main():  Added flags --new and --old; these select which conversion is
	 used.  The default is --new.

Several fixes have been made in the old conversion as well; these were
done before writing & switching to the new conversion, and should be
archived.

The next checkin of this file will discard the old conversion; is is
kept in this checkin to allow it to be retrieved if needed, and to
avoid lossing the bugfixes that have been made to it in the interim.
1999-07-29 22:22:13 +00:00
Fred Drake
2394c98c05 Minor updates. 1999-07-29 22:14:09 +00:00
Fred Drake
ada2de67b3 Use the (new) buildFragment() method of the EsisBuilder rather than
implementing it all here.
1999-07-29 22:13:31 +00:00
Fred Drake
f032cdbb24 Some minor cleanup. 1999-07-29 22:03:52 +00:00
Fred Drake
bc2285eb60 Conversion specification, used by a new path through latex2esis.py.
The specific markup conversion is coded here instead of an even more
cryptic table in the code of latex2esis.py.
1999-07-29 22:03:11 +00:00
Fred Drake
478a265057 Minor update. 1999-07-29 22:01:39 +00:00
Fred Drake
06c5a8b52e Make the default target xml instead of sgml. 1999-07-22 13:57:12 +00:00
Fred Drake
7dbde51f97 Make the default target xml instead of sgml.
Use a temporary file to pass results from latex2esis.py to
docfixer.py; this makes for better error detection by make (if the
first pipeline stage fails, make wasn't catching it).
1999-07-22 13:56:51 +00:00
Fred Drake
0eb7b2a659 Enhanced docstring and some comments.
_begin_macro_rx:  Fixed RE that didn't properly allow a space after
		  the name of the macro.  This affects the conversion
		  of the tutorial.
1999-05-19 17:37:37 +00:00
Fred Drake
c4811d8208 Modify to perform "---" to "&mdash;" conversion outside of
verbatim-like environments.  The list of verbatim-like environments is
a defined by a variable in main().
1999-05-18 17:34:51 +00:00
Fred Drake
c41e1e5f5e Remove the "---" to "&mdash;" conversion; this is wrong in verbatim
environments.  Move the conversion to esis2sgml.py.
1999-05-18 17:33:01 +00:00
Fred Drake
e779d4f03b Lots of adjustments to deal with the document content now being stored
in a fragment rather than the main document object.
1999-05-10 19:36:52 +00:00
Fred Drake
54fb7fb9d0 Some more fixes.
Add controls for some of the esoteric indexing macros.
1999-05-10 19:36:03 +00:00
Fred Drake
2697694e4a ExtendedEsisBuilder.push(): Override inherited definition. We don't
want to push nodes into the document, but into a document
	fragment, since we're not necesarily working with something
	that's well-formed.
1999-05-07 21:14:28 +00:00
Fred Drake
f79acbdaa1 Fix some bugs introduced in the previous checkin. 1999-05-07 21:12:21 +00:00
Fred Drake
96c00b0b5e Define & use a Conversion object. It's still really ugly, but at
least there's a token object in here now!  ;-)
1999-05-07 19:59:02 +00:00
Fred Drake
87a42cd61b Add support for <platform>, some cleanup of module section after
creating the <moduleinfo>.
1999-03-11 17:35:12 +00:00
Fred Drake
93d762fc7a Mark <verbatim> elements that represent interactive sessions; these
become <interpreter-session> elements.
1999-02-18 16:32:21 +00:00
Fred Drake
997eec7cca Minor adjustments to reflect esis2sgml.py changes.
Added "esis" target to only generate the ESIS data.
1999-02-18 16:31:05 +00:00
Fred Drake
607aed7a2c Some adjustments, mostly to make it more general. 1999-02-18 16:30:16 +00:00
Fred Drake
3618c14f72 Use a common definition for $(SUBMAKE) instead of repeating everything
all over the place.
1999-02-15 16:50:28 +00:00
Fred Drake
7281b3b779 Updated comments on version of XML package needed. 1999-01-29 22:35:23 +00:00
Fred Drake
1dd152d036 Added support to handle \versionadded in a reasonable way. 1999-01-29 22:12:29 +00:00
Fred Drake
279ca75a5b Be a little smarter on some attribute values, making an assumption about
the DTD.
1999-01-29 21:35:50 +00:00
Fred Drake
3a7ff998ac fixup_descriptors(): Change the way we look for descriptor nodes;
this takes 5 minutes off the conversion of the whole tree by
	reducing the number of tree-traversals from 14 to 1.
1999-01-29 21:31:12 +00:00
Fred Drake
666e60095b Added the Doc/sgml/ directory to the tarball. 1999-01-29 21:22:55 +00:00
Fred Drake
cb65781d93 Rewrite code that converts the little descriptor environments to build
the right <signature>s and <description>.  This seems to work a lot
better now!
1999-01-29 20:55:07 +00:00
Fred Drake
75930b31e2 Added table entries for \funcline and \funclineni. 1999-01-29 20:09:27 +00:00
Fred Drake
fdfd50f815 Convert <version> to &version;. 1999-01-29 16:29:25 +00:00
Fred Drake
7dab6affba Update the docstring.
Lots of changes to get the paragraph marking to work, and not go into
an infinite recursion.

Start to rationalize markup of method signatures; not complete.

find_all_elements():  similar to getElementsByTagName(), but operates
	on the not-quite-legal fragments we deal with here.
	Simplifies several individual transforms.

fixup_sectionauthors():  Convert \sectionauthor items to <author> just
	after the <section>'s <title>.
1999-01-28 23:59:58 +00:00
Fred Drake
3f3b09657f Added table entries for \methodline, \methodlineni. 1999-01-28 23:49:37 +00:00
Fred Drake
1453a8caf9 Constructor arguments for classes should be called <args>. 1999-01-28 23:10:48 +00:00
Fred Drake
a49a4eabbf Add "term" to AUTOCLOSE. 1999-01-22 22:48:24 +00:00
Fred Drake
43278f01dc convert(): Added parameter "autoclose", which should be a sequence of
general identifiers for which closing tags will be omitted
	when SGML is generated.  This can be used to tell the markup
	generator to drop stuff like </para>.  Note that it needs to
	be possible for the closing tag to *always* be omitted for it
	to be included in "autoclose".

main():  Added command-line option "-a" / "--autoclose" to set the
	list of general identifiers passed to the convert() function
	as the "autoclose" parameter.  The list may only be specified
	once (not additive) and GIs should be comma-separated.  The
	default list includes only "para".
1999-01-20 20:35:05 +00:00
Fred Drake
0a5b8de5e2 Modified the "sgml" and "xml" targets to stop if the sub-makes fail in
any subdirectory; don't continue with remaining subdirs.

Added "api", "ext", "lib", "mac", "ref", and "tut" targets to only do
submakes in those directories.  This is just a lot easier to use than
to cd into the subdir and use make.rules directly.
1999-01-20 17:26:56 +00:00
Fred Drake
4259f0db04 create_module_info(): If there's a \moduleauthor, move it to an
<author> inside the <moduleinfo> element.

Fix problems with paragraph identification.
1999-01-19 23:09:31 +00:00
Fred Drake
36dfe58694 isnmtoken(), istoken(): Fix to ensure the regex has to match the
entire attribute value.

Add ability to save list of "empty" elements to a file -- enabled by
constant in the code.
1999-01-19 23:03:04 +00:00
Fred Drake
2664db9f76 handle_labels(): Fix problem for document fragments containing more
than one "root" that prevented all the <label id=...> items
	from being promoted to id attributes on the enclosing chapter/
	section/... properly.
1999-01-19 21:46:48 +00:00
Fred Drake
d6ced7d199 convert(): Change the element name remapping to convert <refmodule>
to <module link>.
1999-01-19 17:11:23 +00:00
Fred Drake
f82e4ab617 format_attrs(): Attempt a bit more minimization for SGML output. 1999-01-19 17:10:31 +00:00
Fred Drake
589bc63e84 Add a "tarball" target. 1999-01-14 22:35:05 +00:00
Fred Drake
6038f54b74 Adjust so that we are no longer using special entities for well-known
names.  These are too much of a pain for occaissional authors.
1999-01-14 21:44:56 +00:00
Fred Drake
3effeedad3 Shorten the name of the <rfc> "number" attribute to "num". 1999-01-14 21:18:52 +00:00
Fred Drake
d24167baf2 Make <rfc> no longer an empty element but a container. The text
currently generated by the LaTeX and LaTeX2HTML processes is generated
here as well, making it more flexible in the SGML version.

Reduce the <args> element so that <optional> goes away; just use
square brackets to indicate what's optional.  This makes it easier to
read than the LaTeX, and the processor can do any checking it needs to
in order to make sure it's legit.  Possible shortcoming: DSSSL
processors may need more explicit markup.  Can probably hack around it
for this case, but we'll see.
1999-01-14 21:18:03 +00:00