This directory contains sgml2 an simple sgml to "anything" converter. * Remark This is a very early release. I hope someone finds it as useful as I do. If so, please, give me feedback, so I can decide to do further development with respect to the public or my own purpose. Feel free to email me as jw@ibch50.inf.ti-dresden.de . * What is it good for? Sgml2 is to convert sgml-files to "anything", where "anything" means any document-description by ascii-files (like say TeX, roff, lout and so on). The output can be depending of the values of options of sgml-tags and may in-/exclude parts depending whether an option is set or not. Entity-definition like > can be converted to any other representation. A magical (yet hard-coded) input-cooking is done for regular text (outside of markups) for easy encoding accented characters or things like > and &. It is close to the german.sty from LaTeX. (see below) Sgml2 does not check a document against a DTD, nor accept tag-abbreviation (yet). * How does it work? o Sgml2 needs a configuration-file which is used to determine what tag-names are known and how the affect the output. At this time only a config-file for HTML exist (File-name html). The Format is described at top of this File. It supports most HTML+ -tags and some self-defined for my own use (JW as a comment, ADDR and BIBL as an address- and bibliographi-database and some more). Values of options assigned to Markups are represented by $(optionname) in this file, and Text only to be included if otion optname is set may be included ans %optname(text). see html. More the configuration-file determines which Entity's are converted to other representations o Magical character-cooking on input is done for: * german character like "a -> ä to "s ->szlig; * "> -> > * "< -> < * "& -> & * "" -> " Any not recognized sequence is treated unchanged. o The environment-variable SGML2LIB is used to locate the configuration-file after looking up the current directory. o To perform a conversion do: sgml2 config-file-name < infile > outfile for instance: sgml2 html < example.sgml > example.html * How to install? Simply make a directory sgml2, cd into it, un-tar the archive and type make. Then you may strip the resulting sgml2 and move it to a directory in your path. For customization you may adjust the field "theDirs" of char* at top of the File main.c. These are the prefixes (and order of them) used by sgml2 to locate it's configuration-file. The configuration-file(s) should be moved to a location referenced there or by the envionmentvariable SGML2LIB. If you don't have bison your yacc may complain about mrkprint.y for any unknown reason (as on my AIX/RS 6000). For that case or if you don't have yacc anyway the files mrkprint.c and sgml2.c are provided, which are really mrkprint.tab.c and sgml2.tab.c from the bison-output. So you can adjust the makefile and continue with these files as source. * Things to do in the future: Feel free to email me what you would like most to see in a future release. - set up some files for conversion to TeX, lout, [gn]roff, man. (Please could some good soul do this for me at least for roff and man. I know almost nothing about them.) - add option -n to supress output except for special requested. - add option "-r tagname" to select the range <tagname> to </tagname> for (non)printing. - add the option "-t tagname" to select the output-representation of <tagname> for (non)printing. - extend the syntax of tagname for -t and -r to somthing like tagname%optionname=value to restrict the selection to tags with tagname and the option otionname set to value. (This would let you select single Addresses or blibliographies from a database-file.) - add the option "-o filename" to select an output-filename - add input-files (instead of stdin) - anything else? Suggestions? - it's at this time partially quick and dirty programmed; clean-up