:- module(pretty_printer).
:- export pretty_print_term / 5.
:- export pretty_print_open / 3.
:- export pretty_print_close / 1.
:- export pretty_print / 4.
:- export pretty_print / 3.
:- export pretty_print / 2.
:- export pretty_print / 1.
:- comment(summary, "This library pretty-prints a file in different formats.").
:- comment(desc, html("This library prints a file in different formats. It can either produce \n<ul>\n<li><b>txt</b>\n\ttext only format, reformatting the input</li>\n<li><b>html</b>\n\thtml format with syntax coloring and navigation</li>\n</ul>\n")).
:- comment(author, "H. Simonis").
:- comment(copyright, "Cisco Systems, Inc.").
:- comment(date, "$Date: 2006/09/23 01:55:00 $").
:- comment(pretty_print / 1, [summary : "Print a file in html format", amode : pretty_print(++), args : ["Files" : "a filename (atom or string), or a list of filenames"], desc : html("\nThe system prints the contents of the file given as the argument as an\noutput file in html format.  This is one of the possible formats\nsupported by the pretty printer (see <b>pretty_print/2</b>).  The system\nautomatically adds the extension <i>.html</i> and places the result in a\nsubdirectory called 'pretty' relative to the source file.  Syntax coloring\nis used to highlight different language features, and a uniform formatting\nof the source code is used.\n<p>\nAs the clauses are read with the normal Prolog read routine, comments\nwithin clauses are lost, but comments and spacing between clauses is\npreserved.\n<p>\nHyperlinks are used for documented builtin predicates, as well as\npredicates defined in the same file.  For a built-in, the hyperlink\nwill lead to the manual page of the predicate, for other predicates\nthe link points to the first definition of the predicate.  The\nhyperlinks to the builtins are based on the installation directory of\nEclipse, so that the resulting output will normally not work on a\nmachine where eclipse is installed in a different directory.\n<p>\nIf a list of several files is given, an additional index page index.html\nwith links to the individual pretty-printed source files will be generated.\n<p>\nThe pretty printer does not check for undefined predicates or\npredicates that are defined in included files.\n<p>\nThe colours used are similar to those used by the EMACS Eclipse mode.\nColours are used more consistently than in the EMACS editor, as the\nsource text is parsed completely.\n<p>\nYou can modify the colour scheme by modifying the style sheet\nstyle.css which is located in the directory where the .html files get\ngenerated (by default the subdirectory 'pretty').  The pretty-printer\nwill generate a default style sheet file if none exists, but not touch\nany existing one.\n<p>\n"), eg : "\n?- pretty_print(simple').\n", see_also : [pretty_print / 2]]).
:- comment(pretty_print / 2, [summary : "Print a file in one of different formats", amode : pretty_print(++, ++), args : ["Files" : "a filename (atom or string), or a list of filenames", "Options" : "A list of Name:Value pairs"], desc : html("<P>\n    The system prints the contents of the file given as the argument as an\n    output file in different formats. See pretty_print/1 for the general\n    description.\n</P><P>\n    This predicate allows the following options to modify the results:\n<DL>\n    <DT>format (default:html)<DD>\n\tPossible values are 'html' or 'txt'.  The 'html' format\n\tproduces html output with syntax coloring and navigation\n\tlinks.  The output file goes into a directory 'pretty' and has\n\tthe suffix .html.  The 'txt' format produces pure text output. \n\tThe output file goes into a directory 'pretty' and has the\n\tsuffix .txt.\n    <DT>outdir (default:pretty)<DD>\n    \tThe location of the generated files. This can be an absolute or\n\ta relative pathname (in Eclipse's generic pathname syntax, atom\n\tor string). If it is a relative pathname, it is interpreted as\n\treative to the location of the input source file.\n    <DT>style (default:pretty)<DD>\n    \tPossible values are 'pretty' or 'coverage'. Selects one of two\n\tpredefined styles for html output. The latter is a less colourful\n\tform intended for code coverage output.\n    <DT>inline_css (default:off)<DD>\n    \tPossible values are 'off' or 'on'. If 'on', the html output will\n\tuse an inlined style sheet instead of an external one. This is\n\tprovided for browsers that have problems with including style sheets.\n    <DT>css_span (default:span)<DD>\n    \tPossible values are 'span' or 'font'. If 'font', the html output will\n\tnot emit span tags. This is provided for browsers that do not yet\n\tsupport HTML 4.x.\n    <DT>link_back (default:\"\")<DD>\n    \tA string in html format that gets inserted as a link to a parent\n\tpage into the generated pretty-printed source index.html page.\n</DL>\n</P>\n"), see_also : [pretty_print / 1]]).
