Author: jmorliaguet Date: Sun Oct 23 13:07:57 2005 New Revision: 28550 Added: z3lab/z3ecm/trunk/src/ecm/Makefile (contents, props changed) z3lab/z3ecm/trunk/src/ecm/doc/ z3lab/z3ecm/trunk/src/ecm/doc/z3ecm-logo.png (contents, props changed) z3lab/z3ecm/trunk/src/ecm/doc/z3ecm_doc.css (contents, props changed) z3lab/z3ecm/trunk/src/ecm/utilities/ z3lab/z3ecm/trunk/src/ecm/utilities/rst2html (contents, props changed) Log:
- added Makefile to generate html docs with z3ecm css / logo Added: z3lab/z3ecm/trunk/src/ecm/Makefile ============================================================================== --- (empty file) +++ z3lab/z3ecm/trunk/src/ecm/Makefile Sun Oct 23 13:07:57 2005 @@ -0,0 +1,13 @@ + +.SUFFIXES: .txt .html + +.txt.html:: + utilities/rst2html --stylesheet-path doc/z3ecm_doc.css $< + +all: docs + +docs: cpsskins + + +.PHONY: cpsskins +cpsskins: cpsskins/example1/README.html Added: z3lab/z3ecm/trunk/src/ecm/doc/z3ecm-logo.png ============================================================================== Binary file. No diff available. Added: z3lab/z3ecm/trunk/src/ecm/doc/z3ecm_doc.css ============================================================================== --- (empty file) +++ z3lab/z3ecm/trunk/src/ecm/doc/z3ecm_doc.css Sun Oct 23 13:07:57 2005 @@ -0,0 +1,186 @@ +/* z3ecm_doc.css */ +/* $Id: $ */ + +body { + font: 90% Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + background: #ffffff; + color: black; + margin: 2em; + padding: 2em; +} + +div.header { + padding-top: 20px; + font-size: 120%; + background: url(z3ecm-logo.png) no-repeat 100% 0; + height: 55px; +} + +div.header hr.header { + display: none; +} + +div.footer { + margin-top: 3em; +} + +.contents { + padding: 0.6em; + margin-top: 0.5em; +} + +p.topic-title a { + text-decoration: none; + font-size: 120%; + font-weight: bold; +} + +a[href] { + color: #000066; + background-color: transparent; + text-decoration: none; +} + +a[href]:hover { + color: #000066; + background-color: transparent; + text-decoration: underline; +} + +h1 a[href] { + text-decoration: none; + color: #046; + background-color: transparent; +} + +a.strong { + font-weight: bold; +} + +img { + margin: 0; + border: 0; +} + +p { + margin: 0.5em 0 1em 0; + line-height: 1.5em; +} +p a { + text-decoration: underline; +} +p a:visited { + color: purple; + background-color: transparent; +} +p a:active { + color: red; + background-color: transparent; +} +a:hover { + text-decoration: none; +} +p img { + border: 0; + margin: 0; +} + +h1, h2, h3, h4, h5, h6 { + color: #003a6b; + background-color: transparent; + font: 100% Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + margin: 0; + padding-top: 0.5em; +} + +h1 { + font-size: 180%; + margin-bottom: 0.4em; + margin-top: 1em; +} +h2 { + font-size: 150%; + margin-bottom: 0.6em; +} +h3 { + font-size: 130%; + margin-bottom: 0.3em; +} +h4 { + font-size: 110%; + font-weight: bold; +} +h5 { + font-size: 100%; + font-weight: bold; +} +h6 { + font-size: 80%; + font-weight: bold; +} + +ul a, ol a { + text-decoration: underline; +} + +dt { + font-weight: bold; +} +dt a { + text-decoration: none; +} + +dd { + line-height: 1.5em; + margin-bottom: 1em; +} + +legend { + background: #ffffff; + padding: 0.5em; +} + +form { + margin: 0; +} + + +dl.form { + margin: 0; + padding: 1em; +} + +dl.form dt { + width: 30%; + float: left; + margin: 0; + padding: 0 0.5em 0.5em 0; + text-align: right; +} + +input { + font: 100% Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + color: black; + background-color: white; + vertical-align: middle; +} + +abbr, acronym, .explain { + color: black; + background-color: transparent; +} + +q, blockquote { +} + +code, pre { + font-family: monospace; + display: block; + padding: 0.8em; + border: 1px solid #999; + background-color: #f3f0e0; + color: #000; + overflow: auto; + border-radius: 5px; + margin: 1.3em; +} Added: z3lab/z3ecm/trunk/src/ecm/utilities/rst2html ============================================================================== --- (empty file) +++ z3lab/z3ecm/trunk/src/ecm/utilities/rst2html Sun Oct 23 13:07:57 2005 @@ -0,0 +1,72 @@ +#!/usr/bin/env python2.4 + +import errno +import os +import sys + +try: + __file__ +except NameError: + __file__ = sys.argv[0] + +here = os.path.dirname(os.path.realpath(__file__)) +top = os.path.dirname(here) +src = os.path.join(top, "src") + +if src not in sys.path: + sys.path.insert(0, src) + +cssfn = os.path.join(top, "doc", "style", "rest.css") + +# Insert some arguments into the command line to define the default +# behavior: +sys.argv[1:1] = [ + "--no-generator", + "--no-datestamp", + "--pep-references", + "--rfc-references", + "--link-stylesheet", + # Using --stylesheet-path causes docutils to create a relative + # link from the output file to the stylesheet; we don't have to + # figure it out ourselves. + "--stylesheet-path", cssfn, + ] + +from docutils.core import default_description, Publisher + + +class MyPublisher(Publisher): + + __source = None + + def set_source(self, source=None, source_path=None): + self.__source = source_path + Publisher.set_source(self, source, source_path) + + def set_destination(self, destination=None, destination_path=None): + src = self.__source + if src is None: + if destination_path is None and self.settings._destination is None: + src = self.settings._source + if src: + dest = os.path.splitext(src)[0] + ".html" + Publisher.set_destination(self, None, dest) + else: + Publisher.set_destination(self, destination, destination_path) + + +if sys.stdout.isatty(): + publisher = MyPublisher() +else: + publisher = Publisher() + +publisher.set_components("standalone", "restructuredtext", "html") +try: + publisher.publish() +except IOError, e: + # This suppresses a traceback when shoving data into a pipe and it + # doesn't all get read; mostly helpful when piping directly into a + # pager like "more" or "less" and quiting before the pager reads + # everything. + if e.errno != errno.EPIPE: + raise -- http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins