Thread: [Epydoc-commits] SF.net SVN: epydoc: [1323] trunk/epydoc
Brought to you by:
edloper
From: <ed...@us...> - 2006-08-24 18:47:32
|
Revision: 1323 Author: edloper Date: 2006-08-24 11:47:28 -0700 (Thu, 24 Aug 2006) ViewCVS: http://svn.sourceforge.net/epydoc/?rev=1323&view=rev Log Message: ----------- - Added screenshots to homepage - Use a local (modified) version of rst2html to convert regression tests, so doctest blocks will get colored. - Moved regression tests to a doctests/ subdir of the homepage. Modified Paths: -------------- trunk/epydoc/Makefile trunk/epydoc/doc/doctest/index.html trunk/epydoc/doc/index.html Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2006-08-24 18:45:44 UTC (rev 1322) +++ trunk/epydoc/Makefile 2006-08-24 18:47:28 UTC (rev 1323) @@ -41,6 +41,9 @@ EPYDOC = $(PYTHON) src/epydoc/cli.py export PYTHONPATH=src/ +# Options for rst->html converter +RST2HTML = $(PYTHON) src/tools/rst2html.py + ##////////////////////////////////////////////////////////////////////// ## Usage ##////////////////////////////////////////////////////////////////////// @@ -92,6 +95,7 @@ rsync -arzv -e ssh $(HTML_STDLIB)/ $(HOST):$(DIR)/stdlib local: .webpage.up2date + rm -rf /var/www/epydoc/* cp -r $(WEBDIR)/* /var/www/epydoc checkdoc: checkdocs @@ -106,7 +110,7 @@ cp -r $(DOCS) $(WEBDIR) cp -r $(HTML_API) $(WEBDIR)/api cp -r $(HTML_EXAMPLES) $(WEBDIR)/examples - cp -r $(HTML_DOCTEST) $(WEBDIR)/doctest + cp -r $(HTML_DOCTEST)/* $(WEBDIR)/doctest cp $(LATEX_API)/api.pdf $(WEBDIR)/epydoc.pdf touch .webpage.up2date @@ -132,14 +136,14 @@ --name "Epydoc $(VERSION)" $(PY_SRC) -v touch .api-pdf.up2date -doctest-html: .doctests.up2date +doctest-html: .doctest-html.up2date .doctest-html.up2date: $(DOCTESTS) rm -rf $(HTML_DOCTEST) mkdir -p $(HTML_DOCTEST) - @for doctest in $(DOCTESTS); do \ + for doctest in $(DOCTESTS); do \ out_file=$(HTML_DOCTEST)/`basename $$doctest .doctest`.html; \ - echo rst2html $$doctest $$out_file; \ - if rst2html $$doctest $$out_file; then true; \ + echo "$(RST2HTML) $$doctest $$out_file"; \ + if $(RST2HTML) $$doctest $$out_file; then true; \ else exit 1; fi\ done touch .doctest-html.up2date Modified: trunk/epydoc/doc/doctest/index.html =================================================================== --- trunk/epydoc/doc/doctest/index.html 2006-08-24 18:45:44 UTC (rev 1322) +++ trunk/epydoc/doc/doctest/index.html 2006-08-24 18:47:28 UTC (rev 1323) @@ -1,7 +1,7 @@ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <html> <head> <title>Epydoc: Regression Tests</title> -<link rel="stylesheet" href="epydoc.css" type="text/css"/> +<link rel="stylesheet" href="../epydoc.css" type="text/css"/> </head> <!-- $Id: future.html 1211 2006-04-10 19:38:37Z edloper $ --> @@ -19,18 +19,18 @@ <h2 class="box-title">Regression Tests</h2> <ul> - <li> <a href="doctest/apidoc.html">APIDoc</a> -- The classes used + <li> <a href="apidoc.html">APIDoc</a> -- The classes used to encode API documentation about Python programs.</li> - <li> <a href="doctest/docintrospecter.html">Introspection</a> -- + <li> <a href="docintrospecter.html">Introspection</a> -- Extracting API information about Python objects by directly introspecting their values.</li> - <li> <a href="doctest/docparser.html">Source Code Parsing</a> -- + <li> <a href="docparser.html">Source Code Parsing</a> -- Extracting API information about Python objects by parsing their source code.</li> - <li> <a href="doctest/encoding.html">Unicode & Encodings</a> -- + <li> <a href="encoding.html">Unicode & Encodings</a> -- Tests for the processing of Python files that use non-ascii encodings. </li> - <li> <a href="doctest/epytext.html">Epytext</a> -- The default + <li> <a href="epytext.html">Epytext</a> -- The default markup language used by epydoc.</li> </ul> </div> Modified: trunk/epydoc/doc/index.html =================================================================== --- trunk/epydoc/doc/index.html 2006-08-24 18:45:44 UTC (rev 1322) +++ trunk/epydoc/doc/index.html 2006-08-24 18:47:28 UTC (rev 1323) @@ -32,7 +32,7 @@ <div class="box"> <h2 class="box-title">News</h2> -<p><b>Epydoc 3.0 alpha 3 released [August 2006/</b></br /> The third +<p><b>Epydoc 3.0 alpha 3 released [August 2006]</b></br /> The third alpha release of epydoc 3.0 is now available on the <a href="http://sourceforge.net/project/showfiles.php?group_id=32455">SourceForge download page</a>. See the <a href="whatsnew.html">What's New</a> @@ -48,8 +48,38 @@ presentation</a> are available for download. </p> </div> +<!-- ================= Screenshots ================= --> +<div class="box"> +<h2 class="box-title">Screenshots</h2> +<center> +<table class="transparent" cellspacing="10"> + <tr> + <td class="transparent" valign="top"><a href="http://sourceforge.net/project/screenshots.php?group_id=32455&ssid=40524"><img src="http://sourceforge.net/dbimage.php?id=85862" alt="Generated HTML documentation for epydoc" border="0" /></a><br /> + <!-- Generated HTML documentation for epydoc --> </td> + <td class="transparent" valign="top"><a href="http://sourceforge.net/project/screenshots.php?group_id=32455&ssid=40525"><img src="http://sourceforge.net/dbimage.php?id=85864" alt="Example of a UML graph generated by epydoc" border="0" /></a><br /> + <!-- Example of a UML graph generated by epydoc --> </td> + <td class="transparent" valign="top"><a href="http://sourceforge.net/project/screenshots.php?group_id=32455&ssid=40526"><img src="http://sourceforge.net/dbimage.php?id=85866" alt="Example of syntax highlighted source, w/ links to API docs" border="0" /></a><br /> + <!-- Example of syntax highlighted source, w/ links to API docs --> </td> + <td class="transparent" valign="top"><a href="http://sourceforge.net/project/screenshots.php?group_id=32455&ssid=40527"><img src="http://sourceforge.net/dbimage.php?id=85868" alt="Identifier index page for generated Python 2.4 docs" border="0" /></a><br /> + <!-- Identifier index page for generated Python 2.4 docs --> </td> + </tr> +</table> +</center> +</div> + +<!-- NEXT COLUMN --> </td><td width="50%" class="transparent"> +<!-- ================= Latest Release ================= --> +<div class="box"> +<h2 class="box-title">Latest Release</h2> +<p> The latest stable release of epydoc (version 2.1) can be +downloaded from the <a +href="http://sourceforge.net/project/showfiles.php?group_id=32455">SourceForge +download page</a>. See <a href="installing.html">Installing +Epydoc</a> for more information. </p> +</div> + <!-- ================= Documentation ================= --> <div class="box"> <h2 class="box-title">Documentation</h2> @@ -78,24 +108,19 @@ <li> <a href="history.html">History</a> </li> <li> <a href="future.html">Future Directions</a> </li> <li> <a href="relatedprojects.html">Related Projects</a> </li> - <li> <a href="doctests.html">Regression Tests</a> </li> + <li> <a href="doctest/index.html">Regression Tests</a> </li> </ul></p> </div> -<!-- ================= Latest Release ================= --> -<div class="box"> -<h2 class="box-title">Latest Release</h2> -<p> The latest stable release of epydoc (version 2.1) can be -downloaded from the <a -href="http://sourceforge.net/project/showfiles.php?group_id=32455">SourceForge -download page</a>. See <a href="installing.html">Installing -Epydoc</a> for more information. </p> -</div> +</td></tr></table> -</td></tr></table> + + </div> + + <table width="100%" class="navbox" cellpadding="1" cellspacing="0"> <tr> <a class="nav" href="index.html"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2006-09-10 16:31:52
|
Revision: 1380 http://svn.sourceforge.net/epydoc/?rev=1380&view=rev Author: dvarrazzo Date: 2006-09-10 09:31:38 -0700 (Sun, 10 Sep 2006) Log Message: ----------- - defining_module is propagated to object which don't have other means to detect it, such as properties. So docformat can be correctly detected for such objects too. - Added a test suite to verify docbuilder behavior. Modified Paths: -------------- trunk/epydoc/doc/doctest/index.html trunk/epydoc/src/epydoc/docbuilder.py Added Paths: ----------- trunk/epydoc/src/epydoc/test/docbuilder.doctest Modified: trunk/epydoc/doc/doctest/index.html =================================================================== --- trunk/epydoc/doc/doctest/index.html 2006-09-10 16:23:49 UTC (rev 1379) +++ trunk/epydoc/doc/doctest/index.html 2006-09-10 16:31:38 UTC (rev 1380) @@ -27,6 +27,9 @@ <li> <a href="docparser.html">Source Code Parsing</a> -- Extracting API information about Python objects by parsing their source code.</li> + <li> <a href="docbuilder.html">Documentation building</a> -- + Merging different information sources into a single API + hypertext. <li> <a href="encoding.html">Unicode & Encodings</a> -- Tests for the processing of Python files that use non-ascii encodings. </li> Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2006-09-10 16:23:49 UTC (rev 1379) +++ trunk/epydoc/src/epydoc/docbuilder.py 2006-09-10 16:31:38 UTC (rev 1380) @@ -188,6 +188,12 @@ if (isinstance(val_doc, NamespaceDoc) and val_doc.variables not in (None, UNKNOWN)): for var_doc in val_doc.variables.values(): + # Now we have a chance to propagate the defining module + # to objects for which introspection is not possible, + # such as properties. + if (isinstance(var_doc.value, ValueDoc) + and var_doc.value.defining_module is UNKNOWN): + var_doc.value.defining_module = val_doc.defining_module parse_docstring(var_doc, docindex) log.end_progress() Added: trunk/epydoc/src/epydoc/test/docbuilder.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/docbuilder.doctest (rev 0) +++ trunk/epydoc/src/epydoc/test/docbuilder.doctest 2006-09-10 16:31:38 UTC (rev 1380) @@ -0,0 +1,117 @@ +Regression Testing for epydoc.docbuilder +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Test Function +============= + +This test function takes a string containing the contents of a module. +It writes the string contents to a file, imports the file as a module, +and uses build_doc to build documentation, and pretty prints the resulting +ModuleDoc object. The `attribs` argument specifies which attributes +of the `APIDoc`s should be displayed. The `build` argument gives the +name of a variable in the module whose documentation should be built, +instead of bilding docs for the whole module. + + >>> import tempfile, re, os, os.path, textwrap, sys + >>> from epydoc.docbuilder import build_doc + >>> def runbuilder(s, attribs='', build=None, exclude=''): + ... # Write it to a temp file. + ... tmp_dir = tempfile.mkdtemp() + ... out = open(os.path.join(tmp_dir, 'epydoc_test.py'), 'w') + ... out.write(textwrap.dedent(s)) + ... out.close() + ... # Build it. + ... val_doc = build_doc(os.path.join(tmp_dir, 'epydoc_test.py')) + ... if build: val_doc = val_doc.variables[build].value + ... # Display it. + ... s = val_doc.pp(include=attribs.split(),exclude=exclude.split()) + ... s = re.sub(r"(filename = ).*", r"\1...", s) + ... s = re.sub(r"(<module 'epydoc_test' from ).*", r'\1...', s) + ... s = re.sub(r"(<function \w+ at )0x\w+>", r"\1...>", s) + ... s = re.sub(r"(<\w+ object at )0x\w+>", r"\1...>", s) + ... print s + ... # Clean up. + ... os.unlink(os.path.join(tmp_dir, 'epydoc_test.py')) + ... try: os.unlink(os.path.join(tmp_dir, 'epydoc_test.pyc')) + ... except OSError: pass + ... os.rmdir(tmp_dir) + ... del sys.modules['epydoc_test'] + +Docformat selection +=================== + +The docstrings format can be selected using the ``__docformat__`` module +variable. + + >>> runbuilder(s=''' + ... __docformat__ = 'restructuredtext' + ... + ... class Foo: + ... """Testing defining_module + ... + ... :cvar `c`: class var in class docstring + ... :type `c`: str + ... """ + ... c = 'abc' + ... + ... def __init__(self): + ... #: A funny number + ... #: + ... #: :type: float + ... self.x = 108.0 + ... + ... y = property( + ... fget=lambda self: 42, + ... doc="""A property has no defining module + ... + ... :type: int + ... """) + ... + ... def f(self): + ... """A function has a defining module + ... + ... :rtype: int + ... """ + ... return 42 + ... ''', + ... build='Foo', + ... attribs="variables name value type_descr return_type descr") + ClassDoc for epydoc_test.Foo [0] + +- descr = u'Testing defining_module' + +- variables + +- __init__ => VariableDoc for epydoc_test.Foo.__init__ [1] + | +- descr = None + | +- name = '__init__' + | +- type_descr = None + | +- value + | +- RoutineDoc for epydoc_test.Foo.__init__ [2] + | +- descr = None + | +- return_type = None + +- c => VariableDoc for epydoc_test.Foo.c [3] + | +- descr = u'class var in class docstring' + | +- name = 'c' + | +- type_descr = u'str' + | +- value + | +- GenericValueDoc [4] + | +- descr = None + +- f => VariableDoc for epydoc_test.Foo.f [5] + | +- descr = None + | +- name = 'f' + | +- type_descr = None + | +- value + | +- RoutineDoc for epydoc_test.Foo.f [6] + | +- descr = u'A function has a defining module' + | +- return_type = u'int' + +- x => VariableDoc for epydoc_test.Foo.x [7] + | +- descr = u'A funny number' + | +- name = u'x' + | +- type_descr = u'float' + | +- value = <UNKNOWN> + +- y => VariableDoc for epydoc_test.Foo.y [8] + +- descr = None + +- name = 'y' + +- type_descr = None + +- value + +- PropertyDoc for epydoc_test.Foo.y [9] + +- descr = u'A property has no defining module' + +- type_descr = u'int' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-01-17 21:26:39
|
Revision: 1415 http://svn.sourceforge.net/epydoc/?rev=1415&view=rev Author: edloper Date: 2007-01-17 13:26:37 -0800 (Wed, 17 Jan 2007) Log Message: ----------- Changed PYTHON=python2.4 -> PYTHON=python (in response to SF bug #1563688) Modified Paths: -------------- trunk/epydoc/Makefile trunk/epydoc/src/Makefile Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2007-01-17 21:19:47 UTC (rev 1414) +++ trunk/epydoc/Makefile 2007-01-17 21:26:37 UTC (rev 1415) @@ -16,7 +16,7 @@ DOCTESTS = $(wildcard src/epydoc/test/*.doctest) # What version of python to use? -PYTHON = python2.4 +PYTHON = python # The location of the webpage. HOST = shell.sf.net Modified: trunk/epydoc/src/Makefile =================================================================== --- trunk/epydoc/src/Makefile 2007-01-17 21:19:47 UTC (rev 1414) +++ trunk/epydoc/src/Makefile 2007-01-17 21:26:37 UTC (rev 1415) @@ -14,7 +14,7 @@ DOC = ${LIB}/doc/ # What version of python to use? -PYTHON = python2.4 +PYTHON = python ##////////////////////////////////////////////////////////////////////// ## Makefile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-18 12:34:10
|
Revision: 1529 http://svn.sourceforge.net/epydoc/?rev=1529&view=rev Author: dvarrazzo Date: 2007-02-18 04:34:08 -0800 (Sun, 18 Feb 2007) Log Message: ----------- - If there is no other info for a metadata variable, drop it as variable - @newfield also add a metadata variable - dropped __revision__ as alias for __version__. A new field can now be defined. Modified Paths: -------------- trunk/epydoc/doc/fields.html trunk/epydoc/src/epydoc/docstringparser.py Modified: trunk/epydoc/doc/fields.html =================================================================== --- trunk/epydoc/doc/fields.html 2007-02-18 11:20:10 UTC (rev 1528) +++ trunk/epydoc/doc/fields.html 2007-02-18 12:34:08 UTC (rev 1529) @@ -530,19 +530,20 @@ <p> Some module variables are commonly used as module metadata. Epydoc can use the value provided by these variables as alternate form for tags. The -following table lists the recognized variables and the tag they replace. </p> +following table lists the recognized variables and the tag they replace. +Customized metadata variables can be added using the method described +in <a href="newfield">Adding New Fields</a>.</p> <center> <table border="1" cellspacing="0" cellpadding="3"> - <tr><th width="50%">Variable</th><th width="50%">Tag</th></tr> + <tr><th width="50%">Tag</th><th width="50%">Variable</th></tr> <tr><td align="left" valign="top"> <b><code>@deprecated</code></b></td> <td><code>__deprecated__</code></td></tr> <tr><td align="left" valign="top"> <b><code>@version</code></b></td> - <td><code>__version__</code><br/> - <code>__revision__</code></td></tr> + <td><code>__version__</code></td></tr> <tr><td align="left" valign="top"> <b><code>@date</code></b></td> @@ -584,7 +585,12 @@ <p>Where <code><i>tag</i></code> is the new tag that's being defined; <code><i>label</i></code> is a string that will be used to mark this field in the generated output; and <code><i>plural</i></code> is the -plural form of <code><i>label</i></code>, if different. The following +plural form of <code><i>label</i></code>, if different.</p> + +<p>It will also be possibile to use the module variable +<code>__<i>tag</i>__</code> to set the value for the newly defined tag.</p> + +<p>The following example illustrates how the <code>@newfield</code> can be used: </p> <table border="1" cellspacing="0" cellpadding="3" width="95%"> Modified: trunk/epydoc/src/epydoc/docstringparser.py =================================================================== --- trunk/epydoc/src/epydoc/docstringparser.py 2007-02-18 11:20:10 UTC (rev 1528) +++ trunk/epydoc/src/epydoc/docstringparser.py 2007-02-18 12:34:08 UTC (rev 1529) @@ -72,7 +72,7 @@ """ def __init__(self, tags, label, plural=None, short=0, multivalue=1, takes_arg=0, - varnames=[]): + varnames=None): if type(tags) in (list, tuple): self.tags = tuple(tags) elif type(tags) is str: @@ -84,7 +84,7 @@ self.multivalue = multivalue self.short = short self.takes_arg = takes_arg - self.varnames = varnames + self.varnames = varnames or [] def __cmp__(self, other): if not isinstance(other, DocstringField): return -1 @@ -109,7 +109,7 @@ # Status info DocstringField(['version'], 'Version', multivalue=0, - varnames=['__version__', '__revision__']), + varnames=['__version__']), DocstringField(['date'], 'Date', multivalue=0, varnames=['__date__']), DocstringField(['status'], 'Status', multivalue=0), @@ -274,8 +274,9 @@ for varname in field.varnames: # Check if api_doc has a variable w/ the given name. if varname not in api_doc.variables: continue - if api_doc.variables[varname].value is UNKNOWN: continue - val_doc = api_doc.variables[varname].value + var_doc = api_doc.variables[varname] + if var_doc.value is UNKNOWN: continue + val_doc = var_doc.value value = [] # Try extracting the value from the pyval. @@ -308,7 +309,11 @@ elt = unicode(elt) elt = epytext.ParsedEpytextDocstring( epytext.parse_as_para(elt)) + + # Add in the metadata and remove from the variables api_doc.metadata.append( (field, varname, elt) ) + if var_doc.docstring in (None, UNKNOWN): + del api_doc.variables[varname] def initialize_api_doc(api_doc): """A helper function for L{parse_docstring()} that initializes @@ -664,6 +669,7 @@ api_doc.extra_docstring_fields = [] try: docstring_field = _descr_to_docstring_field(arg, descr) + docstring_field.varnames.append("__%s__" % arg) api_doc.extra_docstring_fields.append(docstring_field) except ValueError, e: raise ValueError('Bad %s: %s' % (tag, e)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-21 17:34:58
|
Revision: 1547 http://svn.sourceforge.net/epydoc/?rev=1547&view=rev Author: dvarrazzo Date: 2007-02-21 09:34:54 -0800 (Wed, 21 Feb 2007) Log Message: ----------- - The manual can be created both as a single document and many pages. The single chapters may be linked from the homepage. Modified Paths: -------------- trunk/epydoc/Makefile trunk/epydoc/doc/manual-epytext.txt trunk/epydoc/doc/manual-othermarkup.txt trunk/epydoc/doc/manual-reference.txt trunk/epydoc/doc/manual.txt trunk/epydoc/src/tools/rst2html.py Added Paths: ----------- trunk/epydoc/src/tools/mkdispatch.py Property Changed: ---------------- trunk/epydoc/doc/ Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2007-02-20 23:51:34 UTC (rev 1546) +++ trunk/epydoc/Makefile 2007-02-21 17:34:54 UTC (rev 1547) @@ -14,7 +14,7 @@ EXAMPLES_SRC = $(wildcard doc/*.py) DOCS = $(wildcard doc/*) DOCTESTS = $(wildcard src/epydoc/test/*.doctest) -MANUAL_SRC = $(wildcard doc/manual*.txt) +MANUAL_SRC = $(wildcard doc/manual-*.txt) # What version of python to use? PYTHON = python @@ -32,6 +32,7 @@ HTML = html # Output subdirectories +HTML_MANUAL = $(HTML) HTML_API = $(HTML)/api HTML_EXAMPLES = $(HTML)/examples HTML_STDLIB = $(HTML)/stdlib @@ -44,12 +45,13 @@ # Options for rst->html converter RST2HTML = $(PYTHON) src/tools/rst2html.py +MKDISPATCH = $(PYTHON) src/tools/mkdispatch.py DOCTEST_HTML_FILES := \ $(DOCTESTS:src/epydoc/test/%.doctest=$(HTML_DOCTEST)/%.html) -manual-html: $(MANUAL_SRC) - $(RST2HTML) doc/manual.txt $(HTML)/epydoc.html +MANUAL_HTML_FILES := $(HTML_MANUAL)/epydoc.html \ + $(MANUAL_SRC:doc/manual-%.txt=$(HTML_MANUAL)/manual-%.html) ##////////////////////////////////////////////////////////////////////// ## Usage @@ -106,16 +108,29 @@ rm -rf /var/www/epydoc/* cp -r $(WEBDIR)/* /var/www/epydoc +manual-html: $(MANUAL_HTML_FILES) + +$(HTML_MANUAL)/epydoc.html: doc/manual.txt $(MANUAL_SRC) + $(RST2HTML) doc/manual.txt $@ + +$(HTML_MANUAL)/manual-%.html: doc/manual-%.txt + echo .. contents:: > doc/tmp.txt + echo .. include:: ../$< >> doc/tmp.txt + $(MKDISPATCH) $(MANUAL_SRC) >> doc/tmp.txt + $(RST2HTML) doc/tmp.txt $@ + checkdoc: checkdocs checkdocs: epydoc --check --tests=vars,types $(PY_SRC) .webpage.up2date: .api-html.up2date .examples.up2date .api-pdf.up2date \ $(DOCTEST_HTML_FILES) doc/epydoc-man.html \ - doc/epydocgui-man.html $(DOCS) + doc/epydocgui-man.html $(DOCS) $(MANUAL_HTML_FILES) rm -rf $(WEBDIR) mkdir -p $(WEBDIR) cp -r $(DOCS) $(WEBDIR) + cp -r $(HTML_MANUAL)/epydoc.html $(WEBDIR) + cp -r $(HTML_MANUAL)/manual*.html $(WEBDIR) cp -r $(HTML_API) $(WEBDIR)/api cp -r $(HTML_EXAMPLES) $(WEBDIR)/examples cp -r $(HTML_DOCTEST)/* $(WEBDIR)/doctest @@ -151,7 +166,7 @@ mkdir -p $(HTML_DOCTEST) $(HTML_DOCTEST)/%.html: src/epydoc/test/%.doctest mkdir -p $(HTML_DOCTEST) - $(RST2HTML) $< $@ + $(RST2HTML) --stylesheet=../custom.css $< $@ examples: .examples.up2date .examples.up2date: $(EXAMPLES_SRC) $(PY_SRCFILES) Property changes on: trunk/epydoc/doc ___________________________________________________________________ Name: svn:ignore - *-man.html api *.pyc examples + *-man.html api *.pyc tmp.txt examples Modified: trunk/epydoc/doc/manual-epytext.txt =================================================================== --- trunk/epydoc/doc/manual-epytext.txt 2007-02-20 23:51:34 UTC (rev 1546) +++ trunk/epydoc/doc/manual-epytext.txt 2007-02-21 17:34:54 UTC (rev 1547) @@ -3,9 +3,58 @@ .. $Id$ -Overview --------- +A Brief Introduction +-------------------- +Epytext is a simple lightweight markup language that lets you add formatting +and structue to docstrings. Epydoc uses that formatting and structure to +produce nicely formatted API documentation. The following example (which has +an unusually high ratio of documentaiton to code) illustrates some of the +basic features of epytext: + +.. python:: + + def x_intercept(m, b): + """ + Return the x intercept of the line M{y=m*x+b}. The X{x intercept} + of a line is the point at which it crosses the x axis (M{y=0}). + + This function can be used in conjuction with L{z_transform} to + find an arbitrary function's zeros. + + @type m: number + @param m: The slope of the line. + @type b: number + @param b: The y intercept of the line. The X{y intercept} of a + line is the point at which it crosses the y axis (M{x=0}). + @rtype: number + @return: the x intercept of the line M{y=m*x+b}. + """ + return -b/m + +You can compare this function definition with the `API documentation`__ +generated by epydoc. Note that: + +* Paragraphs are separated by blank lines. +* Inline markup has the form "*x*\ ``{``\ ...\ ``}``", where "*x*" is a + single capital letter. This example uses inline markup to mark mathematical + expressions ("``M{...}``"); terms that should be indexed ("``X{...}``"); + and links to the documentation of other objects ("``L{...}``"). +* Descriptions of parameters, return values, and types are marked with + "``@``\ *field*\ ``:``" or "``@``\ *field arg*\ ``:``", where "*field*" + identifies the kind of description, and "*arg*" specifies what object is + described. + +.. __: http://epydoc.sourceforge.net/ + examples/epytext_example-module.html#x_intercept + +Epytext is intentionally very lightweight. If you wish to use a more +expressive markup language, I recommend reStructuredText_. + + +Epytext Language Overview +------------------------- + Epytext is a lightweight markup language for Python docstrings. The epytext markup language is used by epydoc to parse docstrings and create structured API documentation. Epytext markup is broken up into the following categories: Modified: trunk/epydoc/doc/manual-othermarkup.txt =================================================================== --- trunk/epydoc/doc/manual-othermarkup.txt 2007-02-20 23:51:34 UTC (rev 1546) +++ trunk/epydoc/doc/manual-othermarkup.txt 2007-02-21 17:34:54 UTC (rev 1547) @@ -3,11 +3,13 @@ .. $Id$ -Epydoc's default markup language is epytext_, a lightweight markup language +Epydoc's default markup language is epytext__, a lightweight markup language that's easy to write and to understand. But if epytext is not powerful enough for you, or doesn't suit your needs, epydoc also supports three alternate markup languages: +.. __: `The Epytext Markup Language`_ + reStructuredText__ is an "easy-to-read, what-you-see-is-what-you-get plaintext markup syntax". It is more powerful than epytext (e.g., it includes markup for tables and Modified: trunk/epydoc/doc/manual-reference.txt =================================================================== --- trunk/epydoc/doc/manual-reference.txt 2007-02-20 23:51:34 UTC (rev 1546) +++ trunk/epydoc/doc/manual-reference.txt 2007-02-21 17:34:54 UTC (rev 1547) @@ -140,6 +140,8 @@ various options that you can set. Lines beginning with ``#`` or ``;`` are treated as comments. +.. _ConfigParser: http://docs.python.org/lib/module-ConfigParser.html + .. parsed-literal:: **[epydoc]** *# Epydoc section marker (required by ConfigParser)* Modified: trunk/epydoc/doc/manual.txt =================================================================== --- trunk/epydoc/doc/manual.txt 2007-02-20 23:51:34 UTC (rev 1546) +++ trunk/epydoc/doc/manual.txt 2007-02-21 17:34:54 UTC (rev 1547) @@ -25,7 +25,7 @@ .. _html: http://epydoc.sourceforge.net/api/ .. _pdf: http://epydoc.sourceforge.net/epydoc.pdf -.. _epytext: http://epydoc.sourceforge.net/epytextintro.html +.. _epytext: `The Epytext Markup Language`_ .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _JavaDoc: http://java.sun.com/j2se/javadoc/ Added: trunk/epydoc/src/tools/mkdispatch.py =================================================================== --- trunk/epydoc/src/tools/mkdispatch.py (rev 0) +++ trunk/epydoc/src/tools/mkdispatch.py 2007-02-21 17:34:54 UTC (rev 1547) @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# -*- coding: iso-8859-1 -*- +"""A tool to allow creation of both single page and multi-page manual. + +For each file name in argv, detect title names and print a directive +referring to it as anchor in an html file. +""" + +# $Id$ +__version__ = "$Revision$"[11:-2] +__author__ = "Daniele Varrazzo" +__copyright__ = "Copyright (C) 2007 by Daniele Varrazzo" + +import sys, os + +def parse_pairs(fn): + """Parse a file and return a list of directives to create links.""" + outfile = os.path.splitext(os.path.split(fn)[1])[0] + '.html' + rv = [] + prev = None + for curr in open(fn): + curr = curr.rstrip() + if prev is not None: + if curr and curr[0] in "'^-=~": + if curr == curr[0] * len(curr): + rv.append(".. _%s: %s#%s" % + (prev, outfile, get_anchor(prev))) + prev = curr + + return rv + +import string +charmap = {} +charmap.update(zip(string.ascii_lowercase, string.ascii_lowercase)) +charmap.update(zip(string.ascii_uppercase, string.ascii_lowercase)) +charmap[' '] = '-' +for k in '()': + charmap[k] = '' + +def get_anchor(s): + # IndexErrors are expected to test for what else include in the map + return "".join(map(charmap.__getitem__, s)) + +if __name__ == '__main__': + for fn in sys.argv[1:]: + for dir in parse_pairs(fn): + print dir + Property changes on: trunk/epydoc/src/tools/mkdispatch.py ___________________________________________________________________ Name: svn:executable + * Name: svn:keywords + Id Revision Name: svn:eol-style + native Modified: trunk/epydoc/src/tools/rst2html.py =================================================================== --- trunk/epydoc/src/tools/rst2html.py 2007-02-20 23:51:34 UTC (rev 1546) +++ trunk/epydoc/src/tools/rst2html.py 2007-02-21 17:34:54 UTC (rev 1547) @@ -32,9 +32,9 @@ class CustomizedHTMLWriter(HTMLWriter): settings_defaults = (HTMLWriter.settings_defaults or {}).copy() settings_defaults.update({ - 'stylesheet_path': os.path.normpath(os.path.join( - os.path.split(__file__)[0], '../../doc/custom.css')), - 'output_encoding': 'ascii', + 'stylesheet': 'custom.css', + 'stylesheet_path': None, + 'output_encoding': 'ascii', 'output_encoding_error_handler': 'xmlcharrefreplace', 'embed_stylesheet': False, }) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-24 16:23:51
|
Revision: 1549 http://svn.sourceforge.net/epydoc/?rev=1549&view=rev Author: dvarrazzo Date: 2007-02-24 08:23:49 -0800 (Sat, 24 Feb 2007) Log Message: ----------- - Fixed a couple of bugs in config file parsing - Fixed config example for fail-on option Modified Paths: -------------- trunk/epydoc/doc/manual-reference.txt trunk/epydoc/src/epydoc/cli.py Modified: trunk/epydoc/doc/manual-reference.txt =================================================================== --- trunk/epydoc/doc/manual-reference.txt 2007-02-22 00:25:40 UTC (rev 1548) +++ trunk/epydoc/doc/manual-reference.txt 2007-02-24 16:23:49 UTC (rev 1549) @@ -219,28 +219,28 @@ **### Output options** *# The documented project's name.* - **name: Example** + **#name: Example** *# The CSS stylesheet for HTML output. Can be the name of a builtin* *# stylesheet, or the name of a file.* **css: white** *# The documented project's URL.* - **url: http://some.project/** + **#url: http://some.project/** *# HTML code for the project link in the navigation bar. If left* *# unspecified, the project link will be generated based on the* *# project's name and URL.* - **link: <a href="somewhere">My Cool Project</a>** + **#link: <a href="somewhere">My Cool Project</a>** *# The "top" page for the documentation. Can be a URL, the name* *# of a module or class, or one of the special names "trees.html",* *# "indices.html", or "help.html"* - **top: os.path** + **#top: os.path** *# An alternative help file. The named file should contain the* *# body of an HTML file; navigation bars will be added to it.* - **help: my_helpfile.html** + **#help: my_helpfile.html** *# Whether or not to include a frames-based table of contents.* **frames: yes** @@ -283,27 +283,17 @@ *# (e.g., helvetica or times).* **graph-font: Helvetica** - *# Specify the font size used to generate Graphviz* + *# Specify the font size used to generate Graphviz graphs.* **graph-font-size: 10** **### Return value options** - *# If true, return a non-zero exit status, indicating failure,* - *# if any errors are encountered.* - **fail-on-error: false** + *# The condition upon which Epydoc should exit with a non-zero* + *# exit status. Possible values are error, warning, docstring_warning* + **#fail-on: error** - *# If true, return a non-zero exit status, indicating failure,* - *# if any errors or warnings are encountered (not including* - *# docstring warnings).* - **fail-on-warning: false** - - *# Return a non-zero exit status, indicating failure, if any* - *# errors or warnings are encountered (including docstring* - *# warnings).* - **fail-on-docstring-warning: false** - Warnings and Errors ------------------- Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2007-02-22 00:25:40 UTC (rev 1548) +++ trunk/epydoc/src/epydoc/cli.py 2007-02-24 16:23:49 UTC (rev 1549) @@ -587,18 +587,18 @@ elif optname in ('graph-font', 'graph_font'): options.graph_font = val elif optname in ('graph-font-size', 'graph_font_size'): - options.graph_font_size = _str_to_int(val) + options.graph_font_size = _str_to_int(val, optname) elif optname == 'pstat': options.pstat_files.extend(val.replace(',', ' ').split()) # Return value options elif optname in ('failon', 'fail-on', 'fail_on'): - if val.lower.strip() in ('error', 'errors'): + if val.lower().strip() in ('error', 'errors'): options.fail_on = log.ERROR - elif val.lower.strip() in ('warning', 'warnings'): + elif val.lower().strip() in ('warning', 'warnings'): options.fail_on = log.WARNING - elif val.lower.strip() in ('docstring_warning', - 'docstring_warnings'): + elif val.lower().strip() in ('docstring_warning', + 'docstring_warnings'): options.fail_on = log.DOCSTRING_WARNING else: raise ValueError("%r expected one of: error, warning, " This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <dva...@us...> - 2007-02-25 16:13:19
|
Revision: 1551 http://svn.sourceforge.net/epydoc/?rev=1551&view=rev Author: dvarrazzo Date: 2007-02-25 08:13:17 -0800 (Sun, 25 Feb 2007) Log Message: ----------- - Added :term: reST iterpreted text role to create indexed terms as X{...} epytext markup. Modified Paths: -------------- trunk/epydoc/doc/manual-othermarkup.txt trunk/epydoc/src/epydoc/markup/restructuredtext.py Modified: trunk/epydoc/doc/manual-othermarkup.txt =================================================================== --- trunk/epydoc/doc/manual-othermarkup.txt 2007-02-25 14:35:15 UTC (rev 1550) +++ trunk/epydoc/doc/manual-othermarkup.txt 2007-02-25 16:13:17 UTC (rev 1551) @@ -390,6 +390,41 @@ package with direct links to its API. +Indexed Terms in reStructuredText +''''''''''''''''''''''''''''''''' + +Epydoc uses `indexed terms`_ to create a table of terms definitions. Indexed +terms are created using the epytext markup ``X{...}``. + +If you want to create indexed terms in reStructuredText modules, +you can use the ``term`` `interpreted text role`_. For example: + +.. list-table:: + :header-rows: 1 + + * - Docstring Input + - Rendered Output + + * - .. python:: + + def example(): + """ + An :term:`index term` is a term that + should be included in the index. + """ + #[...] + + - An *index term* is a term that should be included in the index. + + ============ ============== + Index + =========================== + index term *example* + x intercept *x_intercept* + y intercept *x_intercept* + ============ ============== + + Javadoc ------- Modified: trunk/epydoc/src/epydoc/markup/restructuredtext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-02-25 14:35:15 UTC (rev 1550) +++ trunk/epydoc/src/epydoc/markup/restructuredtext.py 2007-02-25 16:13:17 UTC (rev 1551) @@ -78,7 +78,7 @@ from docutils.nodes import NodeVisitor, Text, SkipChildren from docutils.nodes import SkipNode, TreeCopyVisitor from docutils.frontend import OptionParser -from docutils.parsers.rst import directives +from docutils.parsers.rst import directives, roles import docutils.nodes import docutils.transforms.frontmatter import docutils.transforms @@ -208,6 +208,11 @@ def __repr__(self): return '<ParsedRstDocstring: ...>' + def index_terms(self): + visitor = _TermsExtractor(self._document) + self._document.walkabout(visitor) + return visitor.terms + class _EpydocReader(ApiLinkReader): """ A reader that captures all errors that are generated by parsing, @@ -318,6 +323,45 @@ def unknown_visit(self, node): 'Ignore all unknown nodes' +class _TermsExtractor(NodeVisitor): + """ + A docutils node visitor that extracts the terms from documentation. + + Terms are created using the C{:term:} interpreted text role. + """ + def __init__(self, document): + NodeVisitor.__init__(self, document) + + self.terms = None + """ + The terms currently found. + @type: C{list} + """ + + def visit_document(self, node): + self.terms = [] + self._in_term = False + + def visit_emphasis(self, node): + if 'term' in node.get('classes'): + self._in_term = True + + def depart_emphasis(self, node): + if 'term' in node.get('classes'): + self._in_term = False + + def visit_Text(self, node): + if self._in_term: + doc = self.document.copy() + doc[:] = [node.copy()] + self.terms.append(ParsedRstDocstring(doc)) + + def unknown_visit(self, node): + 'Ignore all unknown nodes' + + def unknown_departure(self, node): + 'Ignore all unknown nodes' + class _SplitFieldsTranslator(NodeVisitor): """ A docutils translator that removes all fields from a document, and @@ -653,6 +697,17 @@ directives.register_directive('python', python_code_directive) +def term_role(name, rawtext, text, lineno, inliner, + options={}, content=[]): + + text = docutils.utils.unescape(text) + node = docutils.nodes.emphasis(rawtext, text, **options) + node.attributes['classes'].append('term') + + return [node], [] + +roles.register_local_role('term', term_role) + ###################################################################### #{ Graph Generation Directives ###################################################################### This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-02-27 03:31:58
|
Revision: 1554 http://svn.sourceforge.net/epydoc/?rev=1554&view=rev Author: edloper Date: 2007-02-26 19:31:56 -0800 (Mon, 26 Feb 2007) Log Message: ----------- - Various formatting & css changes for the manual - Added navbar to the bottom of generated manual html pages Modified Paths: -------------- trunk/epydoc/Makefile trunk/epydoc/doc/custom.css trunk/epydoc/doc/manual-fields.txt trunk/epydoc/doc/manual-usage.txt trunk/epydoc/doc/manual.txt Added Paths: ----------- trunk/epydoc/doc/rst-template.txt trunk/epydoc/doc/rst-template2.txt Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2007-02-27 00:07:56 UTC (rev 1553) +++ trunk/epydoc/Makefile 2007-02-27 03:31:56 UTC (rev 1554) @@ -111,14 +111,13 @@ manual-html: $(MANUAL_HTML_FILES) $(HTML_MANUAL)/epydoc.html: doc/manual.txt $(MANUAL_SRC) - $(RST2HTML) doc/manual.txt $@ + $(RST2HTML) doc/manual.txt $@ --template=doc/rst-template.txt $(HTML_MANUAL)/manual-%.html: doc/manual-%.txt - echo .. contents:: > doc/tmp.txt - echo .. include:: ../$< >> doc/tmp.txt + echo ".. include:: ../$<" > doc/tmp.txt $(MKDISPATCH) $(MANUAL_SRC) >> doc/tmp.txt - $(RST2HTML) doc/tmp.txt $@ - + $(RST2HTML) doc/tmp.txt $@ --template=doc/rst-template.txt + checkdoc: checkdocs checkdocs: epydoc --check --tests=vars,types $(PY_SRC) @@ -166,7 +165,8 @@ mkdir -p $(HTML_DOCTEST) $(HTML_DOCTEST)/%.html: src/epydoc/test/%.doctest mkdir -p $(HTML_DOCTEST) - $(RST2HTML) --stylesheet=../custom.css $< $@ + $(RST2HTML) --stylesheet=../custom.css $< $@ \ + --template=doc/rst-template2.txt examples: .examples.up2date .examples.up2date: $(EXAMPLES_SRC) $(PY_SRCFILES) Modified: trunk/epydoc/doc/custom.css =================================================================== --- trunk/epydoc/doc/custom.css 2007-02-27 00:07:56 UTC (rev 1553) +++ trunk/epydoc/doc/custom.css 2007-02-27 03:31:56 UTC (rev 1554) @@ -7,13 +7,34 @@ @import url("docutils.css"); +/*===================================================================*/ +/* Navigation box */ + +table.navbox { + border-right: 1px solid black; + border-left: 1px solid black; + border-bottom: 1px solid black; +} +td.nav { + border: 2px outset #70b0ff; + background: #70b0ff; color: black; + font-weight: bold; +} +td.navselect { + background: #4888d8; color: white; +} + +a.nav:link { text-decoration: none; } +a.nav:visited { text-decoration: none; } + /*======================================================================*/ /* Source code colorization */ pre.py-doctest { padding: .5em; margin: 1em; background: #e8f0f8; color: #000000; border: 1px solid #708890; } -table pre.py-doctest { background: #dce4ec; - color: #000000; } +table.docutils pre.py-doctest { background: #dce4ec; + color: #000000; + border: 1px solid #708890; } .py-prompt { color: #005050; font-weight: bold;} .py-string { color: #006030; } .py-comment { color: #003060; } @@ -44,13 +65,85 @@ h1.title { font-size: 180%; font-weight: bold; text-align: center; padding: .1em; margin: 0; border-bottom: 2px solid black;} +h2.subtitle { font-size: 100%; text-align: center; + font-style: italic; font-weight: normal; margin-top: 0; } + pre.literal-block { padding: .5em; margin: 1em; background: #e8f0f8; color: #000000; border: 1px solid #708890; } -table.docutils { background: #e8f0f8; border: 1px solid black; } +table.docutils { + border: 1px solid black; background: #e8f0f8; + margin-top: 6px; border-collapse: collapse; +} +table.docutils th, table.docutils td { + border: 1px solid black; + padding: 0 .5em 0 .5em; } table.docutils th { background: #70b0ff; } +div.epydoc-usage { border: 1px solid #708890; + background: #e8f0f8; margin: 1em; padding: 0.5em} +table.option-list { background: none !important; } +table.option-list td { border: none !important; } + +div.note { + border: 1px solid black; background: #e8f0f8; + margin-top: 6px; + border-collapse: collapse; + padding: 0 10px 10px 10px; +} +div.note p.admonition-title { + background: #a0f0c0; margin: 0 -10px; padding: 6px 6px 3px 6px; + border-bottom: 1px solid black; + } + +#the-epytext-markup-language table.docutils { width: 95%; } + +table.docutils pre { border: 0px solid black; } + +div.note { } + + + /* For the "Sections" example in the manual */ p.h1 { font-size: 150%; font-weight: bold; } p.h2 { font-size: 125%; font-weight: bold; } + +table.docinfo { margin: 0 0 0.5em 0; font-size: 90%; } + +div.abstract { margin: 0; padding: 0.5em 1em; + border: 1px solid black; + background: #e8f0f8; color: black; } +div.abstract p { margin: 0; } +div.abstract p.topic-title { display: none; } + +#contents { + background: #e8f0f8; color: black; + border: 1px solid #000000; + margin: 1em 0 1em 0; + padding: 0 10px 0 10px; +} + +#contents p.topic-title { + background: #70b0ff; + text-align: center; + font-weight: bold; + font-size: 125%; + margin: 0 -10px 0 -10px; + padding: 0 10px 0 10px; + border-bottom: 1px solid black; +} + +/* + +<table class="docinfo" frame="void" rules="none"> +<col class="docinfo-name" /> +<col class="docinfo-content" /> +<tbody valign="top"> +<tr><th class="docinfo-name">Author:</th> +<td><a class="first last reference" href="mailto:edloper@gradient.cis.upenn.edu">Edward Loper</a></td></tr> +<tr><th class="docinfo-name">Version:</th> +<td>3.0b1</td></tr> +</tbody> +</table> +<div class="abstract topic">*/ \ No newline at end of file Modified: trunk/epydoc/doc/manual-fields.txt =================================================================== --- trunk/epydoc/doc/manual-fields.txt 2007-02-27 00:07:56 UTC (rev 1553) +++ trunk/epydoc/doc/manual-fields.txt 2007-02-27 03:31:56 UTC (rev 1554) @@ -90,7 +90,7 @@ of function and methods. These tags are usually put in the the docstring of the function to be documented. -.. note:: constructor parameters +.. note:: **constructor parameters** In C extension modules, extension classes cannot have a docstring attached to the ``__init__`` function; consequently it is not possible to document @@ -210,7 +210,7 @@ """ #[...] -.. note:: group markers +.. note:: **group markers** It is also possible to group set of related items enclosing them into special comment starting with the *group markers* '``#{``' and '``#}``' Modified: trunk/epydoc/doc/manual-usage.txt =================================================================== --- trunk/epydoc/doc/manual-usage.txt 2007-02-27 00:07:56 UTC (rev 1553) +++ trunk/epydoc/doc/manual-usage.txt 2007-02-27 03:31:56 UTC (rev 1554) @@ -39,66 +39,68 @@ as ``epydoc/epytext.py``), or package directory names (such as ``epydoc/``). Packages are expanded to include all sub-modules and sub-packages. ---html - Generate HTML output. (default) ---pdf - Generate Adobe Acrobat (PDF) output, using LaTeX. --o DIR, --output DIR, --target DIR - The output directory. ---parse-only, --introspect-only - By default, epydoc will gather information about each Python object using - two methods: parsing the object's source code; and importing the object and - directly introspecting it. Epydoc combines the information obtained from - these two methods to provide more complete and accurate documentation. - However, if you wish, you can tell epydoc to use only one or the other of - these methods. For example, if you are running epydoc on untrusted code, - you should use the ``--parse-only`` option. --v, -q - Increase (``-v``) or decrease (``-q``) the verbosity of the output. These - options may be repeated to further increase or decrease verbosity. - Docstring markup warnings are supressed unless ``-v`` is used at least once. ---name NAME - The documented project's name. ---url URL - The documented project's URL. ---docformat NAME - The markup language that should be used by default to process modules' - docstrings. This is only used for modules that do not define the special - ``__docformat__`` variable; it is recommended that you explicitly specify - ``__docformat__`` in all your modules. ---graph GRAPHTYPE - Include graphs of type *GRAPHTYPE* in the generated output. Graphs are - generated using the Graphviz ``dot`` executable. If this executable is not - on the path, then use ``--dotpath`` to specify its location. This option - may be repeated to include multiple graph types in the output. To include - all graphs, use ``--graph all``. The available graph types are: +.. container:: epydoc-usage - * **classtree**: displays each class's base classes and subclasses; - * **callgraph**: displays the callers and callees of each function or - method. These graphs are based on profiling information, which must be - specified using the ``--pstate`` option. - * **umlclass**: displays each class's base classes and subclasses, using - UML style. Methods and attributes are listed in the classes where they - are defined. If type information is available about attributes (via the - ``@type`` field), then those types are displayed as separate classes, and - the attributes are displayed as associations. ---inheritance STYLE - The format that should be used to display inherited methods, variables, and - properties. Currently, three styles are supported. To see an example of each style, - click on it: - - * grouped_: Inherited objects are gathered into groups, based on which - class they are inherited from. - * listed_: Inherited objects are listed in a short list at the end of the - summary table. - * included_: Inherited objects are mixed in with non-inherited objects. - ---config FILE - Read the given configuration file, which can contain both options and - Python object names. This option may be used multiple times, if you wish - to use multiple configuration files. See `Configuration Files`_ for more - information. - + --html + Generate HTML output. (default) + --pdf + Generate Adobe Acrobat (PDF) output, using LaTeX. + -o DIR, --output DIR, --target DIR + The output directory. + --parse-only, --introspect-only + By default, epydoc will gather information about each Python object using + two methods: parsing the object's source code; and importing the object and + directly introspecting it. Epydoc combines the information obtained from + these two methods to provide more complete and accurate documentation. + However, if you wish, you can tell epydoc to use only one or the other of + these methods. For example, if you are running epydoc on untrusted code, + you should use the ``--parse-only`` option. + -v, -q + Increase (``-v``) or decrease (``-q``) the verbosity of the output. These + options may be repeated to further increase or decrease verbosity. + Docstring markup warnings are supressed unless ``-v`` is used at least once. + --name NAME + The documented project's name. + --url URL + The documented project's URL. + --docformat NAME + The markup language that should be used by default to process modules' + docstrings. This is only used for modules that do not define the special + ``__docformat__`` variable; it is recommended that you explicitly specify + ``__docformat__`` in all your modules. + --graph GRAPHTYPE + Include graphs of type *GRAPHTYPE* in the generated output. Graphs are + generated using the Graphviz ``dot`` executable. If this executable is not + on the path, then use ``--dotpath`` to specify its location. This option + may be repeated to include multiple graph types in the output. To include + all graphs, use ``--graph all``. The available graph types are: + + * **classtree**: displays each class's base classes and subclasses; + * **callgraph**: displays the callers and callees of each function or + method. These graphs are based on profiling information, which must be + specified using the ``--pstate`` option. + * **umlclass**: displays each class's base classes and subclasses, using + UML style. Methods and attributes are listed in the classes where they + are defined. If type information is available about attributes (via the + ``@type`` field), then those types are displayed as separate classes, and + the attributes are displayed as associations. + --inheritance STYLE + The format that should be used to display inherited methods, variables, and + properties. Currently, three styles are supported. To see an example of each style, + click on it: + + * grouped_: Inherited objects are gathered into groups, based on which + class they are inherited from. + * listed_: Inherited objects are listed in a short list at the end of the + summary table. + * included_: Inherited objects are mixed in with non-inherited objects. + + --config FILE + Read the given configuration file, which can contain both options and + Python object names. This option may be used multiple times, if you wish + to use multiple configuration files. See `Configuration Files`_ for more + information. + .. _grouped: http://epydoc.sourceforge.net/examples/grouped/ inh_example.Programmer-class.html .. _listed: http://epydoc.sourceforge.net/examples/listed/ Modified: trunk/epydoc/doc/manual.txt =================================================================== --- trunk/epydoc/doc/manual.txt 2007-02-27 00:07:56 UTC (rev 1553) +++ trunk/epydoc/doc/manual.txt 2007-02-27 03:31:56 UTC (rev 1554) @@ -32,6 +32,7 @@ .. contents:: .. section-numbering:: +.. def:: singlepage .. Include the document chapters Added: trunk/epydoc/doc/rst-template.txt =================================================================== --- trunk/epydoc/doc/rst-template.txt (rev 0) +++ trunk/epydoc/doc/rst-template.txt 2007-02-27 03:31:56 UTC (rev 1554) @@ -0,0 +1,36 @@ +%(head_prefix)s +%(head)s +%(stylesheet)s +%(body_prefix)s +%(body_pre_docinfo)s +%(docinfo)s +%(body)s +</div> +<table width="100%%" class="navbox" cellpadding="1" cellspacing="0"> + <tr> + <a class="nav" href="index.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="index.html"> + Home</a></td></a> + <a class="nav" href="installing.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="installing.html"> + Installing Epydoc</a></td></a> + <a class="nav" href="using.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="using.html"> + Using Epydoc</a></td></a> + <a class="nav" href="epytext.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="epytext.html"> + Epytext</a></td></a> + <td align="center" width="20%%" class="nav"> + + <A href="http://sourceforge.net/projects/epydoc"> + <IMG src="sflogo.png" + width="88" height="26" border="0" alt="SourceForge" + align="top"/></A></td> + </tr> +</table> +</body> +</html> Added: trunk/epydoc/doc/rst-template2.txt =================================================================== --- trunk/epydoc/doc/rst-template2.txt (rev 0) +++ trunk/epydoc/doc/rst-template2.txt 2007-02-27 03:31:56 UTC (rev 1554) @@ -0,0 +1,36 @@ +%(head_prefix)s +%(head)s +%(stylesheet)s +%(body_prefix)s +%(body_pre_docinfo)s +%(docinfo)s +%(body)s +</div> +<table width="100%%" class="navbox" cellpadding="1" cellspacing="0"> + <tr> + <a class="nav" href="../index.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="../index.html"> + Home</a></td></a> + <a class="nav" href="../installing.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="../installing.html"> + Installing Epydoc</a></td></a> + <a class="nav" href="../using.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="../using.html"> + Using Epydoc</a></td></a> + <a class="nav" href="../epytext.html"> + <td align="center" width="20%%" class="nav"> + <a class="nav" href="../epytext.html"> + Epytext</a></td></a> + <td align="center" width="20%%" class="nav"> + + <A href="http://sourceforge.net/projects/epydoc"> + <IMG src="../sflogo.png" + width="88" height="26" border="0" alt="SourceForge" + align="top"/></A></td> + </tr> +</table> +</body> +</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-02-27 05:28:39
|
Revision: 1558 http://svn.sourceforge.net/epydoc/?rev=1558&view=rev Author: edloper Date: 2007-02-26 21:28:35 -0800 (Mon, 26 Feb 2007) Log Message: ----------- - Bumped version alpha3 -> beta1 Modified Paths: -------------- trunk/epydoc/doc/installing.html trunk/epydoc/src/epydoc/__init__.py Modified: trunk/epydoc/doc/installing.html =================================================================== --- trunk/epydoc/doc/installing.html 2007-02-27 05:22:21 UTC (rev 1557) +++ trunk/epydoc/doc/installing.html 2007-02-27 05:28:35 UTC (rev 1558) @@ -83,13 +83,13 @@ <div class="screen"><pre> <code class="prompt">[/tmp]$</code> <code class="user">su</code> Password: -<code class="prompt">[/tmp]#</code> <code class="user">rpm -i epydoc-3.0alpha3.noarch.rpm</code> +<code class="prompt">[/tmp]#</code> <code class="user">rpm -i epydoc-3.0beta1.noarch.rpm</code> </pre></div></li> <li> Once epydoc is installed, you can delete the RPM file. <div class="screen"><pre> -<code class="prompt">[/tmp]#</code> <code class="user">rm epydoc-3.0alpha3.rpm</code> +<code class="prompt">[/tmp]#</code> <code class="user">rm epydoc-3.0beta1.rpm</code> </pre></div> </li> </ol> @@ -97,7 +97,7 @@ <h2> Installing from the Windows Installer </h2> <ol> - <li> Download and run <code>epydoc-3.0alpha3.win32.exe</code>. </li> + <li> Download and run <code>epydoc-3.0beta1.win32.exe</code>. </li> <li> Follow the on-screen instructions. Epydoc will be installed in the <code>epydoc</code> subdirectory of your Python installation directory (typically <code>C:\Python23\</code>). </li> @@ -109,7 +109,7 @@ scripts to more convenient locations (such as your desktop or start menu). </li> <li> Once epydoc is installed, you can delete - <code>epydoc-3.0alpha3.win32.exe</code>. </li> + <code>epydoc-3.0beta1.win32.exe</code>. </li> </ol> <a name="src"></a> @@ -120,19 +120,19 @@ to a directory of your choice, and uncompress it. <div class="screen"><pre> -<code class="prompt">[/tmp]$</code> <code class="user">wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0alpha3.tar.gz</code> -<code class="prompt">[/tmp]$</code> <code class="user">gunzip epydoc-3.0alpha3.tar.gz</code> -<code class="prompt">[/tmp]$</code> <code class="user">tar -xvf epydoc-3.0alpha3.tar</code> +<code class="prompt">[/tmp]$</code> <code class="user">wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0beta1.tar.gz</code> +<code class="prompt">[/tmp]$</code> <code class="user">gunzip epydoc-3.0beta1.tar.gz</code> +<code class="prompt">[/tmp]$</code> <code class="user">tar -xvf epydoc-3.0beta1.tar</code> </pre></div></li> - <li> Use "<code>make install</code>" in the <code>eydoc-3.0alpha3/</code> + <li> Use "<code>make install</code>" in the <code>eydoc-3.0beta1/</code> directory to install epydoc. <div class="screen"><pre> -<code class="prompt">[/tmp]$</code> <code class="user">cd epydoc-3.0alpha3/</code> -<code class="prompt">[/tmp/epydoc-3.0alpha3]$</code> <code class="user">su</code> +<code class="prompt">[/tmp]$</code> <code class="user">cd epydoc-3.0beta1/</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]$</code> <code class="user">su</code> Password: -<code class="prompt">[/tmp/epydoc-3.0alpha3]#</code> <code class="user">make install</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]#</code> <code class="user">make install</code> running install running build <i>[...]</i> @@ -150,16 +150,16 @@ running "<code>make installdocs</code>". <div class="screen"><pre> -<code class="prompt">[/tmp/epydoc-3.0alpha3]#</code> <code class="user">make installdocs</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]#</code> <code class="user">make installdocs</code> </pre></div></li> <li> Once epydoc is installed, you can delete the installation directory and the source distribution file. <div class="screen"><pre> -<code class="prompt">[/tmp/epydoc-3.0alpha3]#</code> <code class="user">cd ..</code> -<code class="prompt">[/tmp]#</code> <code class="user">rm -r epydoc-3.0alpha3</code> -<code class="prompt">[/tmp]#</code> <code class="user">rm epydoc-3.0alpha3.tar</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]#</code> <code class="user">cd ..</code> +<code class="prompt">[/tmp]#</code> <code class="user">rm -r epydoc-3.0beta1</code> +<code class="prompt">[/tmp]#</code> <code class="user">rm epydoc-3.0beta1.tar</code> </pre></div> </li> </ol> @@ -171,25 +171,25 @@ to a directory of your choice, and uncompress it. <div class="screen"><pre> -<code class="prompt">[/tmp]$</code> <code class="user">wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0alpha3.tar.gz</code> -<code class="prompt">[/tmp]$</code> <code class="user">gunzip epydoc-3.0alpha3.tar.gz</code> -<code class="prompt">[/tmp]$</code> <code class="user">tar -xvf epydoc-3.0alpha3.tar</code> +<code class="prompt">[/tmp]$</code> <code class="user">wget -q http://prdownloads.sourceforge.net/epydoc/epydoc-3.0beta1.tar.gz</code> +<code class="prompt">[/tmp]$</code> <code class="user">gunzip epydoc-3.0beta1.tar.gz</code> +<code class="prompt">[/tmp]$</code> <code class="user">tar -xvf epydoc-3.0beta1.tar</code> </pre></div></li> <li> Use the <code>setup.py</code> script in the - <code>eydoc-3.0alpha3/</code> directory to install epydoc. + <code>eydoc-3.0beta1/</code> directory to install epydoc. <div class="screen"><pre> -<code class="prompt">[/tmp]$</code> <code class="user">cd epydoc-3.0alpha3/</code> -<code class="prompt">[/tmp/epydoc-3.0alpha3]$</code> <code class="user">su</code> +<code class="prompt">[/tmp]$</code> <code class="user">cd epydoc-3.0beta1/</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]$</code> <code class="user">su</code> Password: -<code class="prompt">[/tmp/epydoc-3.0alpha3]#</code> <code class="user">python setup.py install</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]#</code> <code class="user">python setup.py install</code> running install running build <i>[...]</i> copying build/scripts/epydoc -> /usr/bin changing mode of /usr/bin/epydoc to 100775 -<code class="prompt">[/tmp/epydoc-3.0alpha3]#</code> <code class="user">cd ..</code> +<code class="prompt">[/tmp/epydoc-3.0beta1]#</code> <code class="user">cd ..</code> <code class="prompt">[/tmp]#</code> </pre></div></li> @@ -199,16 +199,16 @@ as <code>/usr/share/man/</code>. <div class="screen"><pre> -<code class="prompt">[/tmp]#</code> <code class="user">cp -r epydoc-3.0alpha3/doc/ /usr/share/doc/epydoc/</code> -<code class="prompt">[/tmp]#</code> <code class="user">cp epydoc-3.0alpha3/man/* /usr/share/man/</code> +<code class="prompt">[/tmp]#</code> <code class="user">cp -r epydoc-3.0beta1/doc/ /usr/share/doc/epydoc/</code> +<code class="prompt">[/tmp]#</code> <code class="user">cp epydoc-3.0beta1/man/* /usr/share/man/</code> </pre></div> </li> <li> Once epydoc is installed, you can delete the installation directory and the source distribution file. <div class="screen"><pre> -<code class="prompt">[/tmp]#</code> <code class="user">rm -r epydoc-3.0alpha3</code> -<code class="prompt">[/tmp]#</code> <code class="user">rm epydoc-3.0alpha3.tar</code> +<code class="prompt">[/tmp]#</code> <code class="user">rm -r epydoc-3.0beta1</code> +<code class="prompt">[/tmp]#</code> <code class="user">rm epydoc-3.0beta1.tar</code> </pre></div> </li> </ol> Modified: trunk/epydoc/src/epydoc/__init__.py =================================================================== --- trunk/epydoc/src/epydoc/__init__.py 2007-02-27 05:22:21 UTC (rev 1557) +++ trunk/epydoc/src/epydoc/__init__.py 2007-02-27 05:28:35 UTC (rev 1558) @@ -167,7 +167,7 @@ :author: `Edward Loper <ed...@gr...>`__ :requires: Python 2.3+ -:version: 3.0 alpha 2 +:version: 3.0 beta 1 :see: `The epydoc webpage <http://epydoc.sourceforge.net>`__ :see: `The epytext markup language manual <http://epydoc.sourceforge.net/epytext.html>`__ @@ -200,7 +200,7 @@ """ __docformat__ = 'restructuredtext en' -__version__ = '3.0alpha3' +__version__ = '3.0beta1' """The version of epydoc""" __author__ = 'Edward Loper <ed...@gr...>' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2007-07-25 04:59:23
|
Revision: 1597 http://svn.sourceforge.net/epydoc/?rev=1597&view=rev Author: edloper Date: 2007-07-24 21:59:18 -0700 (Tue, 24 Jul 2007) Log Message: ----------- added options -n, -c, -u (svn bug 1760001, debain bug #433804); fixed bug in code to print an error message Modified Paths: -------------- trunk/epydoc/man/epydoc.1 trunk/epydoc/src/epydoc/cli.py Modified: trunk/epydoc/man/epydoc.1 =================================================================== --- trunk/epydoc/man/epydoc.1 2007-07-11 00:47:31 UTC (rev 1596) +++ trunk/epydoc/man/epydoc.1 2007-07-25 04:59:18 UTC (rev 1597) @@ -254,7 +254,7 @@ used. .\" --name .TP -.BI "\-\-name " name +.BI "\-n " name ", \-\-name " name The name of the project whose documentation is being generated. .\" --url .TP Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2007-07-11 00:47:31 UTC (rev 1596) +++ trunk/epydoc/src/epydoc/cli.py 2007-07-25 04:59:18 UTC (rev 1597) @@ -289,16 +289,16 @@ output_group = OptionGroup(optparser, 'Output Options') optparser.add_option_group(output_group) - output_group.add_option("--name", + output_group.add_option("--name", "-n", dest="prj_name", metavar="NAME", help="The documented project's name (for the navigation bar).") - output_group.add_option("--css", + output_group.add_option("--css", "-c", dest="css", metavar="STYLESHEET", help="The CSS stylesheet. STYLESHEET can be either a " "builtin stylesheet or the name of a CSS file.") - output_group.add_option("--url", + output_group.add_option("--url", "-u", dest="prj_url", metavar="URL", help="The documented project's URL (for the navigation bar).") @@ -440,7 +440,7 @@ for name in names: if name.endswith('.pickle'): if len(names) != 1: - optparse.error("When a pickle file is specified, no other " + optparser.error("When a pickle file is specified, no other " "input files may be specified.") options.load_pickle = True This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-01-31 01:09:47
|
Revision: 1698 http://epydoc.svn.sourceforge.net/epydoc/?rev=1698&view=rev Author: edloper Date: 2008-01-30 17:09:38 -0800 (Wed, 30 Jan 2008) Log Message: ----------- - Added --suppress-timestamp option (sf feature request 1695848) Modified Paths: -------------- trunk/epydoc/man/epydoc.1 trunk/epydoc/src/epydoc/cli.py trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/man/epydoc.1 =================================================================== --- trunk/epydoc/man/epydoc.1 2008-01-31 00:33:47 UTC (rev 1697) +++ trunk/epydoc/man/epydoc.1 2008-01-31 01:09:38 UTC (rev 1698) @@ -293,6 +293,10 @@ their modules. This creates a separate LaTeX file for each class, so it can also be useful if you want to include the documentation for one or two classes as sections of your own LaTeX document. +.\" --suppress-timestamp +.TP +.B \-\-suppress\-timestamp +Do not include a timestamp in the generated output. .RE .PP .\"-------------------------------------------------- Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2008-01-31 00:33:47 UTC (rev 1697) +++ trunk/epydoc/src/epydoc/cli.py 2008-01-31 01:09:38 UTC (rev 1698) @@ -137,7 +137,8 @@ include_source_code=True, pstat_files=[], simple_term=False, fail_on=None, exclude=[], exclude_parse=[], exclude_introspect=[], external_api=[], external_api_file=[], external_api_root=[], - redundant_details=False, src_code_tab_width=8) + redundant_details=False, src_code_tab_width=8, + include_timestamp=True) def parse_arguments(): # Construct the option parser. @@ -342,6 +343,11 @@ action='store', type='int', dest='src_code_tab_width', help=("When generating HTML output, sets the number of spaces " "each tab in source code listings is replaced with.")) + + output_group.add_option('--suppress-timestamp', + action='store_false', dest='include_timestamp', + help=("When generating HTML output, suppress the timestamp at " + "the bottom of each page.")) # The group of external API options. # Skip if the module couldn't be imported (usually missing docutils) @@ -580,6 +586,8 @@ options.list_classes_separately = _str_to_bool(val, optname) elif optname in ('src-code-tab-width', 'src_code_tab_width'): options.src_code_tab_width = _str_to_int(val, optname) + elif optname == 'timestamp': + options.include_timestamp = _str_to_bool(val, optname) # External API elif optname in ('external-api', 'external_api'): Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2008-01-31 00:33:47 UTC (rev 1697) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2008-01-31 01:09:38 UTC (rev 1698) @@ -291,6 +291,9 @@ @type include_log: C{boolean} @keyword include_log: If true, the the footer will include an href to the page 'epydoc-log.html'. + @type include_timestamp: C{boolean} + @keyword include_timestamp: If true, then include a timestamp in + the footer. @type src_code_tab_width: C{int} @keyword src_code_tab_width: Number of spaces to replace each tab with in source code listings. @@ -358,6 +361,9 @@ self._include_log = kwargs.get('include_log', False) """Are we generating an HTML log page?""" + self._include_timestamp = kwargs.get('include_timestamp', True) + """Include a timestamp on the generated docs?""" + self._src_code_tab_width = kwargs.get('src_code_tab_width', 8) """Number of spaces to replace each tab with in source code listings.""" @@ -1771,9 +1777,13 @@ <td align="left" class="footer"> >>> if self._include_log: <a href="epydoc-log.html">Generated by Epydoc - $epydoc.__version__$ on $time.asctime()$</a> + $epydoc.__version__$ + >>> if self._include_timestamp: + on $time.asctime()$</a> >>> else: - Generated by Epydoc $epydoc.__version__$ on $time.asctime()$ + Generated by Epydoc $epydoc.__version__$ + >>> if self._include_timestamp: + on $time.asctime()$ >>> #endif </td> <td align="right" class="footer"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 03:41:24
|
Revision: 1769 http://epydoc.svn.sourceforge.net/epydoc/?rev=1769&view=rev Author: edloper Date: 2008-02-23 19:41:21 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Added the latex commands \EpydocUserSection, \EpydocUserSubsection, and \EpydocUserSubsubsection, used to add section headings inside of docstrings. - Added TEMPLATE to latex stylesheets Modified Paths: -------------- trunk/epydoc/doc/epydoc-latex-demo.tex trunk/epydoc/src/epydoc/docwriter/latex_sty.py trunk/epydoc/src/epydoc/markup/epytext.py trunk/epydoc/src/epydoc/markup/restructuredtext.py Modified: trunk/epydoc/doc/epydoc-latex-demo.tex =================================================================== --- trunk/epydoc/doc/epydoc-latex-demo.tex 2008-02-23 20:52:35 UTC (rev 1768) +++ trunk/epydoc/doc/epydoc-latex-demo.tex 2008-02-24 03:41:21 UTC (rev 1769) @@ -13,7 +13,11 @@ \usepackage[index]{epydoc} \usepackage[utf8]{inputenc} \definecolor{UrlColor}{rgb}{0,0.08,0.45} -\usepackage[pdftex, pagebackref, pdftitle={API Documentation}, pdfcreator={epydoc 3.0.1}, bookmarks=true, bookmarksopen=false, pdfpagemode=UseOutlines, colorlinks=true, linkcolor=black, anchorcolor=black, citecolor=black, filecolor=black, menucolor=black, pagecolor=black, urlcolor=UrlColor]{hyperref} +\usepackage[pdftex, pagebackref, pdftitle={API Documentation}, % + pdfcreator={epydoc 3.0.1}, bookmarks=true, bookmarksopen=false, % + pdfpagemode=UseOutlines, colorlinks=true, linkcolor=black, % + anchorcolor=black, citecolor=black, filecolor=black, menucolor=black, % + pagecolor=black, urlcolor=UrlColor]{hyperref} \begin{document} \title{Epydoc LaTeX Writer Output Demo} @@ -86,6 +90,15 @@ This is a note. \end{reSTadmonition} +\subsubsection{Sections inside Docstrings} + +% The commands \EpydocUserSection, \EpydocUserSubsection, and +% \EpydocUserSubsubsection are used to add section headings inside +% of docstrings +\EpydocUserSection{Intra-docstring heading 1} +\EpydocUserSubsection{Intra-docstring heading 2} +\EpydocUserSubsubsection{Intra-docstring heading 3} + % ====================================================================== % Each module is listed in its own section. (These sections are created Modified: trunk/epydoc/src/epydoc/docwriter/latex_sty.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-02-23 20:52:35 UTC (rev 1768) +++ trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-02-24 03:41:21 UTC (rev 1769) @@ -109,6 +109,18 @@ \newlength{\EpydocBCL} % base class length, for base trees. % ====================================================================== +% Sections inside docstring + +% The following commands are used to mark section headers within +% docstrings. +\newcommand\EpydocUserSection[1]{% + \par\vspace{3ex}{\large\bf #1 }\par\vspace{1.4ex}} +\newcommand\EpydocUserSubsection[1]{% + \par\vspace{2.8ex}{\bf #1 }\par\vspace{1.2ex}} +\newcommand\EpydocUserSubsubsection[1]{% + \par\vspace{2.6ex}{\bf\it #1 }\par\vspace{1.0ex}} + +% ====================================================================== % Hyperlinks & Crossreferences % The \EpydocHypertarget command is used to mark targets that hyperlinks @@ -801,8 +813,7 @@ SHADED = r""" % epydoc-shaded.sty % -% Authors: Jonathan Guyer <gu...@ni...> -% Edward Loper <ed...@se...> +% Author: Edward Loper <ed...@se...> % URL: <http://epydoc.sf.net> % % This LaTeX stylesheet for epydoc's output uses shaded boxes to @@ -1052,6 +1063,27 @@ {\raggedright\normalfont\normalsize\bfseries}} """ +###################################################################### +###################################################################### + +TEMPLATE = r""" +% epydoc-template.sty +% +% This is a starting point for creating new epydoc style files. +% Add on \renewcommand and \renewenvironment commands to change +% how different pieces of the documentation are displayed. +% +\NeedsTeXFormat{LaTeX2e} +\ProvidesClass{epydoc}[2007/04/06 v3.0beta1 Epydoc Python Documentation] +\DeclareOption{index}{\PassOptionsToPackage{index}{epydoc-base}} +\DeclareOption{hyperlink}{\PassOptionsToPackage{hyperlink}{epydoc-base}} +\ProcessOptions\relax + +\RequirePackage{epydoc-base} + +% Add \renewcommand and \renewenvironment commands here. +""" + ############################################################ ## Stylesheet table ############################################################ @@ -1061,4 +1093,5 @@ 'boxes': BOXES, 'shaded': SHADED, 'default': BOXES, + 'template': TEMPLATE, } Modified: trunk/epydoc/src/epydoc/markup/epytext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/epytext.py 2008-02-23 20:52:35 UTC (rev 1768) +++ trunk/epydoc/src/epydoc/markup/epytext.py 2008-02-24 03:41:21 UTC (rev 1769) @@ -1986,7 +1986,9 @@ elif tree.tag == 'li': return indent*' ' + '\\item ' + childstr.lstrip() elif tree.tag == 'heading': - return ' '*(indent-2) + '(section) %s\n\n' % childstr + sec = ('\\EpydocUser' + + ('%ssection' % ('sub'*(min(seclevel,3)-1))).capitalize()) + return (' '*(indent-2) + '%s{%s}\n\n' % (sec, childstr.strip())) elif tree.tag == 'doctestblock': return doctest_to_latex(tree.children[0].strip()) elif tree.tag == 'literalblock': Modified: trunk/epydoc/src/epydoc/markup/restructuredtext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/restructuredtext.py 2008-02-23 20:52:35 UTC (rev 1768) +++ trunk/epydoc/src/epydoc/markup/restructuredtext.py 2008-02-24 03:41:21 UTC (rev 1769) @@ -544,6 +544,16 @@ _TARGET_RE = re.compile(r'^(.*?)\s*<(?:URI:|URL:)?([^<>]+)>$') +class _EpydocDocumentClass: + SECTIONS = ['EpydocUserSection', + 'EpydocUserSubsection', + 'EpydocUserSubsubsection'] + def section(self, level): + if level <= len(self.SECTIONS): + return self.SECTIONS[level-1] + else: + return self.SECTIONS[-1] + class _EpydocLaTeXTranslator(LaTeXTranslator): settings = None def __init__(self, document, docstring_linker=None, directory=None, @@ -552,6 +562,11 @@ if self.settings is None: settings = OptionParser([LaTeXWriter()]).get_default_values() settings.output_encoding = 'utf-8' + + # This forces eg \EpydocUserSection rather than + # \EpydocUserSEction*: + settings.use_latex_toc = True + self.__class__.settings = settings document.settings = self.settings @@ -561,11 +576,8 @@ self._docindex = docindex self._context = context - # Start at section level 3. (Unfortunately, we now have to - # set a private variable to make this work; perhaps the standard - # latex translator should grow an official way to spell this?) - self.section_level = 3 - self._section_number = [0]*self.section_level + # Use custom section names. + self.d_class = _EpydocDocumentClass() # Handle interpreted text (crossreferences) def visit_title_reference(self, node): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 03:43:35
|
Revision: 1772 http://epydoc.svn.sourceforge.net/epydoc/?rev=1772&view=rev Author: edloper Date: 2008-02-23 19:43:33 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Added section to the manual's reference chapter, talking about how to customize latex/pdf output. Modified Paths: -------------- trunk/epydoc/Makefile trunk/epydoc/doc/manual-reference.txt Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2008-02-24 03:42:42 UTC (rev 1771) +++ trunk/epydoc/Makefile 2008-02-24 03:43:33 UTC (rev 1772) @@ -17,7 +17,7 @@ MANUAL_SRC = $(wildcard doc/manual-*.txt) # What version of python to use? -PYTHON = python +PYTHON = python2.5 # The location of the webpage. HOST = shell.sf.net @@ -43,9 +43,9 @@ EPYDOC = $(PYTHON) src/epydoc/cli.py export PYTHONPATH=src/ -# Options for rst->html converter RST2HTML = $(PYTHON) src/tools/rst2html.py MKDISPATCH = $(PYTHON) src/tools/mkdispatch.py +STY2HTML = $(PYTHON) src/tools/sty2html.py DOCTEST_HTML_FILES := \ $(DOCTESTS:src/epydoc/test/%.doctest=$(HTML_DOCTEST)/%.html) @@ -110,10 +110,11 @@ manual-html: $(MANUAL_HTML_FILES) -$(HTML_MANUAL)/epydoc.html: doc/manual.txt $(MANUAL_SRC) +$(HTML_MANUAL)/epydoc.html: doc/manual.txt $(MANUAL_SRC) \ + doc/epydoc-style-list.txt $(RST2HTML) doc/manual.txt $@ --template=doc/rst-template.txt -$(HTML_MANUAL)/manual-%.html: doc/manual-%.txt +$(HTML_MANUAL)/manual-%.html: doc/manual-%.txt doc/epydoc-style-list.txt echo ".. include:: ../$<" > doc/tmp.txt $(MKDISPATCH) $(MANUAL_SRC) >> doc/tmp.txt $(RST2HTML) doc/tmp.txt $@ --template=doc/rst-template.txt @@ -234,6 +235,11 @@ --docformat plaintext -v --graph all $(PY_SRC) rm -rf profile.tmp hotshot.out +# Convert standard style files to html +doc/epydoc-style-list.txt: src/epydoc/docwriter/latex_sty.py \ + src/tools/sty2html.py + $(STY2HTML) $(WEBDIR) + ##////////////////////////////////////////////////////////////////////// ## Standard Library docs ##////////////////////////////////////////////////////////////////////// Modified: trunk/epydoc/doc/manual-reference.txt =================================================================== --- trunk/epydoc/doc/manual-reference.txt 2008-02-24 03:42:42 UTC (rev 1771) +++ trunk/epydoc/doc/manual-reference.txt 2008-02-24 03:43:33 UTC (rev 1772) @@ -294,6 +294,22 @@ **#fail-on: error** +Customizing LaTeX and PDF Output +-------------------------------- + +Epydoc's LaTeX output, and the outputs that are derived from it (dvi, +ps, and pdf), can be customized by creating a custom LaTeX style file. +To help you create custom stylesheets, a complete description of the +specialized LaTeX commands that epydoc uses to generate its output is +available here: + +- `Epydoc LaTeX Style Reference <epydoc-latex-demo.html>`__ + +Additionaly, you may find it useful to look at the builtin style files +that epydoc provides: + +.. include:: epydoc-style-list.txt + Warnings and Errors ------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |