epydoc-commits Mailing List for Python API documentation generation tool (Page 2)
Brought to you by:
edloper
You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
(77) |
May
|
Jun
(6) |
Jul
(8) |
Aug
(91) |
Sep
(67) |
Oct
(4) |
Nov
|
Dec
(1) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(17) |
Feb
(135) |
Mar
(25) |
Apr
|
May
(1) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(62) |
Oct
(1) |
Nov
(3) |
Dec
|
2008 |
Jan
(40) |
Feb
(102) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ed...@us...> - 2008-02-24 19:43:47
|
Revision: 1787 http://epydoc.svn.sourceforge.net/epydoc/?rev=1787&view=rev Author: edloper Date: 2008-02-24 11:43:45 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - Fixed bug caused my change in return value of parse_arguments Modified Paths: -------------- trunk/epydoc/src/epydoc/cli.py Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2008-02-24 19:43:23 UTC (rev 1786) +++ trunk/epydoc/src/epydoc/cli.py 2008-02-24 19:43:45 UTC (rev 1787) @@ -1200,7 +1200,7 @@ return try: prof = hotshot.Profile('hotshot.out') - prof = prof.runctx('main(*parse_arguments())', globals(), {}) + prof = prof.runctx('main(parse_arguments())', globals(), {}) except SystemExit: pass prof.close() @@ -1230,7 +1230,7 @@ Profile.dispatch['c_exception'] = trace_dispatch_return try: prof = Profile() - prof = prof.runctx('main(*parse_arguments())', globals(), {}) + prof = prof.runctx('main(parse_arguments())', globals(), {}) except SystemExit: pass prof.dump_stats('profile.out') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 19:43:25
|
Revision: 1786 http://epydoc.svn.sourceforge.net/epydoc/?rev=1786&view=rev Author: edloper Date: 2008-02-24 11:43:23 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - Various makefile fixes, to reflect changes to latex generation Modified Paths: -------------- trunk/epydoc/Makefile Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2008-02-24 19:42:55 UTC (rev 1785) +++ trunk/epydoc/Makefile 2008-02-24 19:43:23 UTC (rev 1786) @@ -12,7 +12,8 @@ PY_SRC = src/epydoc/ PY_SRCFILES = $(shell find $(PY_SRC) -name '*.py') EXAMPLES_SRC = $(wildcard doc/*.py) -DOCS = $(wildcard doc/*) +DOCDIR = doc +DOCS = $(wildcard $(DOCDIR)/*) DOCTESTS = $(wildcard src/epydoc/test/*.doctest) MANUAL_SRC = $(wildcard doc/manual-*.txt) @@ -37,8 +38,8 @@ HTML_EXAMPLES = $(HTML)/examples HTML_STDLIB = $(HTML)/stdlib HTML_DOCTEST = $(HTML)/doctest -LATEX_API = $(LATEX)/api -LATEX_STDLIB = $(LATEX)/stdlib +LATEX_API = $(LATEX)/api.pdf +LATEX_STDLIB = $(LATEX)/stdlib.pdf EPYDOC = $(PYTHON) src/epydoc/cli.py export PYTHONPATH=src/ @@ -134,7 +135,7 @@ cp -r $(HTML_API) $(WEBDIR)/api cp -r $(HTML_EXAMPLES) $(WEBDIR)/examples cp -r $(HTML_DOCTEST)/* $(WEBDIR)/doctest - cp $(LATEX_API)/api.pdf $(WEBDIR)/epydoc.pdf + cp $(LATEX_API) $(WEBDIR)/epydoc.pdf touch .webpage.up2date # Use plaintext docformat by default. But this is overridden by the @@ -154,10 +155,10 @@ api-pdf: .api-pdf.up2date .api-pdf.up2date: $(PY_SRCFILES) - rm -rf $(LATEX_API) - mkdir -p $(LATEX_API) + mkdir -p $(LATEX) + rm -f $(LATEX_API) $(EPYDOC) --pdf -o $(LATEX_API) --docformat plaintext \ - --no-module-list --graph classtree --sty shaded \ + --no-submodule-list --graph classtree --sty shaded \ --name "Epydoc $(VERSION)" $(PY_SRC) -v --debug touch .api-pdf.up2date @@ -236,10 +237,10 @@ --docformat plaintext -v --graph all $(PY_SRC) rm -rf profile.tmp hotshot.out -# Convert standard style files to html +# Convert builtin latex style files to html doc/epydoc-style-list.txt: src/epydoc/docwriter/latex_sty.py \ src/tools/sty2html.py - $(STY2HTML) $(WEBDIR) + $(STY2HTML) $(DOCDIR) ##////////////////////////////////////////////////////////////////////// ## Standard Library docs @@ -270,8 +271,8 @@ # (this will typically cause latex to run out of resources) stdlib-pdf: .stdlib-pdf.up2date .stdlib-pdf.up2date: $(PY_SRCFILES) - rm -rf $(LATEX_STDLIB) - mkdir -p $(LATEX_STDLIB) + mkdir -p $(LATEX) + rm -f $(LATEX_STDLIB) $(EPYDOC) --pdf -o $(LATEX_STDLIB) --debug \ --no-private --name $(SLNAME) --docformat plaintext \ --debug --builtins $(SLFILES) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 19:42:57
|
Revision: 1785 http://epydoc.svn.sourceforge.net/epydoc/?rev=1785&view=rev Author: edloper Date: 2008-02-24 11:42:55 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - Fixed minor markup bug Modified Paths: -------------- trunk/epydoc/src/epydoc/test/epytext.doctest Modified: trunk/epydoc/src/epydoc/test/epytext.doctest =================================================================== --- trunk/epydoc/src/epydoc/test/epytext.doctest 2008-02-24 19:42:34 UTC (rev 1784) +++ trunk/epydoc/src/epydoc/test/epytext.doctest 2008-02-24 19:42:55 UTC (rev 1785) @@ -337,6 +337,7 @@ .</para> Should we strip the 'inline' from the paras in cases like this:? + >>> print testparse(""" ... - List item with G{classtree foo} graph. ... - And with I{nested G{callgraph: zippy} markup} too. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 19:42:39
|
Revision: 1784 http://epydoc.svn.sourceforge.net/epydoc/?rev=1784&view=rev Author: edloper Date: 2008-02-24 11:42:34 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - Fixed bug that caused extra newlines (or missing newlines) in colorized doctest blocks Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/doctest.py Modified: trunk/epydoc/src/epydoc/markup/doctest.py =================================================================== --- trunk/epydoc/src/epydoc/markup/doctest.py 2008-02-24 18:27:00 UTC (rev 1783) +++ trunk/epydoc/src/epydoc/markup/doctest.py 2008-02-24 19:42:34 UTC (rev 1784) @@ -303,9 +303,9 @@ class LaTeXDoctestColorizer(DoctestColorizer): """A subclass of DoctestColorizer that generates LaTeX output.""" - PREFIX = '\\begin{alltt}\n' + PREFIX = ('\\begin{alltt}') SUFFIX = '\\end{alltt}\n' - NEWLINE = '\\\\\n' + NEWLINE = '\\\\' def markup(self, s, tag): if tag == 'other': return plaintext_to_latex(s) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 18:27:02
|
Revision: 1783 http://epydoc.svn.sourceforge.net/epydoc/?rev=1783&view=rev Author: edloper Date: 2008-02-24 10:27:00 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - Replaced blank lines with explicit \par commands Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/latex_sty.py Modified: trunk/epydoc/src/epydoc/docwriter/latex_sty.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-02-24 18:08:21 UTC (rev 1782) +++ trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-02-24 18:27:00 UTC (rev 1783) @@ -219,12 +219,8 @@ % the default definition, but several of the Epydoc*List environments % use \renewcommand to provide definitions that are appropriate for the % style of that environment. -\newcommand{\EpydocGroup}[1]{ +\newcommand{\EpydocGroup}[1]{\par{\large #1}\par} - {\large #1} - - } - % ====================================================================== % Inheritance @@ -235,7 +231,7 @@ % use \renewcommand to provide definitions that are appropriate for the % style of that environment. \newcommand{\EpydocInheritanceList}[2]{% - \textbf{Inherited from {#1}:} #2} + \textbf{Inherited from {#1}:} #2\par} % ====================================================================== % Submodule List @@ -313,31 +309,23 @@ \gdef\@EpydocFunctionRaises{##6}% \gdef\@EpydocFunctionOverrides{##7}% \gdef\@EpydocFunctionMetadata{##8}% - {\Large\raggedright\@EpydocFunctionSignature} - + {\Large\raggedright\@EpydocFunctionSignature}\par \begin{quote}% \setlength{\parskip}{\EpydocParskip}% \ifx\@EpydocFunctionDescription\empty\else - - \@EpydocFunctionDescription\fi% + \par\@EpydocFunctionDescription\fi% \ifx\@EpydocFunctionParameters\empty\else - - \@EpydocFunctionParameters\fi% + \par\@EpydocFunctionParameters\fi% \ifx\@EpydocFunctionReturnDescr\empty - - \@EpydocFunctionReturnDescr\fi% + \par\@EpydocFunctionReturnDescr\fi% \ifx\@EpydocFunctionReturnType\empty - - \@EpydocFunctionReturnType\fi% + \par\@EpydocFunctionReturnType\fi% \ifx\@EpydocFunctionRaises\empty\else - - \@EpydocFunctionRaises\fi% + \par\@EpydocFunctionRaises\fi% \ifx\@EpydocFunctionOverrides\empty\else - - \@EpydocFunctionOverrides\fi% + \par\@EpydocFunctionOverrides\fi% \ifx\@EpydocFunctionMetadata\empty\else - - \@EpydocFunctionMetadata\fi% + \par\@EpydocFunctionMetadata\fi% \end{quote} }} @@ -406,10 +394,8 @@ % method, to display the name of the overridden method. \newcommand{\EpydocFunctionOverrides}[2][0]{% \textbf{Overrides:} #2 % - \ifthenelse{#1=1}{\textit{(inherited documentation)}{}} + \ifthenelse{#1=1}{\textit{(inherited documentation)}{}}\par} - } - % ====================================================================== % Variable Lists % @@ -435,19 +421,15 @@ \gdef\@EpydocVariableDescription{##2}% \gdef\@EpydocVariableType{##3}% \gdef\@EpydocVariableValue{##4}% - {\Large\raggedright\@EpydocVariableName} - + {\Large\raggedright\@EpydocVariableName}\par \begin{quote} \setlength{\parskip}{\EpydocParskip}% \ifx\@EpydocVariableDescription\empty\else - - \@EpydocVariableDescription\fi% + \par\@EpydocVariableDescription\fi% \ifx\@EpydocVariableType\empty\else - - \textbf{Type:} \@EpydocVariableType\fi% + \par\textbf{Type:} \@EpydocVariableType\fi% \ifx\@EpydocVariableValue\empty - - \textbf{Value:} \texttt{\@EpydocVariableValue}\fi% + \par\textbf{Value:} \texttt{\@EpydocVariableValue}\fi% \end{quote} }} {} @@ -488,25 +470,19 @@ \gdef\@EpydocPropertyGet{##4}% \gdef\@EpydocPropertySet{##5}% \gdef\@EpydocPropertyDel{##6}% - {\Large\raggedright\@EpydocPropertyName} - + {\Large\raggedright\@EpydocPropertyName}\par \begin{quote} \setlength{\parskip}{\EpydocParskip}% \ifx\@EpydocPropertyDescription\empty\else - - \@EpydocPropertyDescription\fi% + \par\@EpydocPropertyDescription\fi% \ifx\@EpydocPropertyType\empty\else - - \textbf{Type:} \@EpydocPropertyType\fi% + \par\textbf{Type:} \@EpydocPropertyType\fi% \ifx\@EpydocPropertyGet\empty - - \textbf{Get:} \texttt{\@EpydocPropertyGet}\fi% + \par\textbf{Get:} \texttt{\@EpydocPropertyGet}\fi% \ifx\@EpydocPropertySet\empty - - \textbf{Set:} \texttt{\@EpydocPropertySet}\fi% + \par\textbf{Set:} \texttt{\@EpydocPropertySet}\fi% \ifx\@EpydocPropertyDel\empty - - \textbf{Delete:} \texttt{\@EpydocPropertyDel}\fi% + \par\textbf{Delete:} \texttt{\@EpydocPropertyDel}\fi% \end{quote} }} {} @@ -646,8 +622,7 @@ \gdef\@EpydocFunctionMetadata{##8}% \begin{boxedminipage}{\dimexpr \textwidth-2\fboxsep \relax} {\Large \@EpydocFunctionSignature} - \setlength{\parskip}{\EpydocParskip}% - + \setlength{\parskip}{\EpydocParskip}\par \ifx\@EpydocFunctionDescription\empty\else% {\@EpydocSeparator}% \@EpydocFunctionDescription % @@ -747,15 +722,11 @@ \@EpydocVariableDescription % \ifx\@EpydocVariableValue\empty\relax% \ifx\@EpydocVariableType\empty\else% - \ifx\@EpydocVariableDescription\empty\else - - \fi% + \ifx\@EpydocVariableDescription\empty\else\par\fi% \textit{(type=\texttt{\@EpydocVariableType})}% \fi% \else\relax% - \ifx\@EpydocVariableDescription\empty\else - - \fi% + \ifx\@EpydocVariableDescription\empty\else\par\fi% \textbf{Value:} \texttt{\@EpydocVariableValue}% \ifx\@EpydocVariableType\empty\else% \textit{(type=\texttt{\@EpydocVariableType})}% @@ -894,9 +865,7 @@ \end{cminipage}% \if@EpydocFunctionDetails \begin{cminipage}{\dimexpr 0.95\linewidth-2\fboxsep \relax}% - \setlength{\parskip}{\EpydocParskip}% - \setlength{\parskip}{\EpydocParskip}% - + \setlength{\parskip}{\EpydocParskip} \ifx\@EpydocFunctionDescription\empty\else% \@EpydocFunctionDescription % \fi% @@ -930,26 +899,19 @@ \fi% \end{cminipage}% \fi% - \end{minipage} - - }} + \end{minipage}\par}} {} \newenvironment{@EpydocGeneralList}{% - \renewcommand{\EpydocGroup}[1]{ - + \renewcommand{\EpydocGroup}[1]{\par \begin{cminipage}[gray80]{\dimexpr \linewidth-2\fboxsep \relax} {\Large\bf\center ##1\\} - \end{cminipage} - - }% - \renewcommand{\EpydocInheritanceList}[2]{% + \end{cminipage}\par} + \renewcommand{\EpydocInheritanceList}[2]{\par \begin{cminipage}[gray95]{\dimexpr \textwidth-2\fboxsep \relax} Inherited from {##1}: ##2% - \end{cminipage}% + \end{cminipage}\par}}{} - }}{} - \newlength{\EpydocValueWidth} \renewenvironment{EpydocVariableList}{% @@ -970,27 +932,24 @@ \ifx\@EpydocVariableValue\empty\else \@EpydocVariableDetailstrue\fi% \if@EpydocVariableDetails \begin{cminipage}{\dimexpr 0.95\linewidth-2\fboxsep \relax} + \setlength{\parskip}{\EpydocParskip} \ifx\@EpydocVariableDescription\empty\else - - \@EpydocVariableDescription + \par\@EpydocVariableDescription \fi% \ifx\@EpydocVariableType\empty\else - - \textbf{Type:} \texttt{\@EpydocVariableType} + \par\textbf{Type:} \texttt{\@EpydocVariableType} \fi% \ifx\@EpydocVariableValue\empty\else - - \settowidth{\EpydocValueWidth}{Value:w}% + \par\settowidth{\EpydocValueWidth}{Value:w}% Value: - \begin{cminipage}[gray85]{\dimexpr \textwidth-2\fboxsep-\EpydocValueWidth \relax} + \begin{cminipage}[gray85]{\dimexpr \textwidth-2\fboxsep- + \EpydocValueWidth \relax} \texttt{\@EpydocVariableValue} \end{cminipage}% \fi% \end{cminipage}% \fi% - \end{minipage}% - - } + \end{minipage}\par} \begin{@EpydocGeneralList}} {\end{@EpydocGeneralList}} @@ -1016,42 +975,33 @@ \ifx\@EpydocPropertyDel\empty\else \@EpydocPropertyDetailstrue\fi% \if@EpydocPropertyDetails \begin{cminipage}{\dimexpr 0.95\linewidth-2\fboxsep \relax} + \setlength{\parskip}{\EpydocParskip} \ifx\@EpydocPropertyDescription\empty\else% - - \@EpydocPropertyDescription + \par\@EpydocPropertyDescription \fi% \ifx\@EpydocPropertyType\empty\else - - \textbf{Type:} \@EpydocPropertyType + \par\textbf{Type:} \@EpydocPropertyType \fi% \ifx\@EpydocPropertyGet\empty\else - - \textbf{Get:} \@EpydocPropertyGet% + \par\textbf{Get:} \@EpydocPropertyGet% \fi% \ifx\@EpydocPropertySet\empty\else - - \textbf{Set:} \@EpydocPropertySet% + \par\textbf{Set:} \@EpydocPropertySet% \fi% \ifx\@EpydocPropertyDel\empty\else - - \textbf{Delete:} \@EpydocPropertyDel% + \par\textbf{Delete:} \@EpydocPropertyDel% \fi% \end{cminipage}% \fi% - \end{minipage}% - - } + \end{minipage}\par} \begin{@EpydocGeneralList}} {\end{@EpydocGeneralList}} -\renewcommand{\EpydocGroup}[1]{ - +\renewcommand{\EpydocGroup}[1]{\par \begin{cminipage}[gray80]{\dimexpr \linewidth-2\fboxsep \relax} {\Large\bf\center #1\\} - \end{cminipage} + \end{cminipage}\par} - } - % This is just like the default definitions, except that we use % \raggedright, and dedent by \EpydocSectionHeaderDedent \newlength{\EpydocSectionHeaderDedent} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 18:08:22
|
Revision: 1782 http://epydoc.svn.sourceforge.net/epydoc/?rev=1782&view=rev Author: edloper Date: 2008-02-24 10:08:21 -0800 (Sun, 24 Feb 2008) Log Message: ----------- - Removed some obsolete comments - Moved \RequirePackage for longtable to the 'boxed' stylesheet - Fixed horizontal spacing for var & property tables - var & property tables now use a double-thick outline (matching the outline used by function boxes) - increased size of heading text in var & property tables Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/latex_sty.py Modified: trunk/epydoc/src/epydoc/docwriter/latex_sty.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-02-24 16:56:35 UTC (rev 1781) +++ trunk/epydoc/src/epydoc/docwriter/latex_sty.py 2008-02-24 18:08:21 UTC (rev 1782) @@ -47,7 +47,7 @@ % Basic Package Requirements \RequirePackage{alltt, boxedminipage} -\RequirePackage{multirow, longtable, amssymb} +\RequirePackage{multirow, amssymb} \RequirePackage[headings]{fullpage} \RequirePackage[usenames]{color} \RequirePackage{ifthen} @@ -429,10 +429,6 @@ % % If any of these arguments is not available, then the empty % string will be used. -% -% See EpydocGeneralList, above, for info about the commands -% \EpydocInternalHeader and \EpydocInheritanceItemList, which -% may be used inside the EpydocVariableList environment. \newenvironment{EpydocVariableList}{% \newcommand{\EpydocVariable}[4]{% \gdef\@EpydocVariableName{##1}% @@ -484,13 +480,6 @@ % % If any of these arguments is not available, then the empty % string will be used. -% -% See EpydocGeneralList, above, for info about the commands -% \EpydocInternalHeader and \EpydocInheritanceItemList, which -% may be used inside the EpydocVariableList environment. -% -% Implementation node: \@EpydocSeparator evaluates to nothing on -% the first use, and to a paragraph break on subsequent uses. \newenvironment{EpydocPropertyList}{% \newcommand{\EpydocProperty}[6]{% \gdef\@EpydocPropertyName{##1}% @@ -623,10 +612,16 @@ \ProcessOptions\relax \RequirePackage{epydoc-base} +\RequirePackage{longtable} % Double the standard size boxedminipage outlines. \setlength{\fboxrule}{2\fboxrule} +% Set the width of the variable name cells in the variable & property +% tables. +\newlength{\EpydocVariableWidth} +\setlength{\EpydocVariableWidth}{.3\textwidth} + % ====================================================================== % Function Lists @@ -707,22 +702,34 @@ % \EpydocInheritanceList commands to add a row to the table. \newenvironment{@EpydocGeneralList}{% \renewcommand{\EpydocGroup}[1]{% - \multicolumn{2}{|l|}{\textbf{##1}} \\ - \hline}% + \multicolumn{2}{@{\vrule width \fboxrule \hspace \tabcolsep}l + @{\hspace \tabcolsep \vrule width \fboxrule}} + {\textbf{\textit{##1}}} \\ + \hline}% \renewcommand{\EpydocInheritanceList}[2]{% - \multicolumn{2}{|p{\dimexpr \textwidth -4\tabcolsep-3\arrayrulewidth}|}{% - \raggedright\textbf{Inherited from {##1}:\\ - ##2}} \\ - \hline} - \begin{longtable}{|p{.30\textwidth}|p{.62\textwidth}|} + \multicolumn{2}{@{\vrule width \fboxrule \hspace \tabcolsep} + p{\dimexpr \textwidth -4\tabcolsep-7pt} + @{\hspace \tabcolsep \vrule width \fboxrule}} + {\raggedright\textbf{Inherited from {##1}:\\##2}} \\ + \hline}% + \setlength{\doublerulesep}{0pt} + \begin{longtable}[l]{@{\vrule width \fboxrule \hspace \tabcolsep} + p{\EpydocVariableWidth}| + p{\dimexpr \textwidth% + -4\tabcolsep-7pt + -\EpydocVariableWidth \relax} + @{\hspace \tabcolsep \vrule width \fboxrule}} % Set up the headers & footer (this makes the table span % multiple pages in a happy way). - \hline - \centering \textbf{Name} & \centering \textbf{Description} + \hline \hline \rule{0pt}{\baselineskip} + \centering \Large \textbf{Name} & + \centering \Large \textbf{Description} \tabularnewline - \hline - \endhead\hline\multicolumn{2}{r}{% - \small\textit{continued on next page}}\\\endfoot\hline + \hline \hline + \endhead% + \hline\hline\multicolumn{2}{r}{% + \small\textit{continued on next page}}\\\endfoot% + \hline\hline \endlastfoot} {\end{longtable}} @@ -755,8 +762,9 @@ \fi% \fi% \tabularnewline - \hline} - \begin{@EpydocGeneralList}} + \hline}% + \begin{@EpydocGeneralList}% + } {\end{@EpydocGeneralList}} % By default, EpydocClassVariableList & EpydocInstanceVariableList are @@ -765,6 +773,8 @@ % ====================================================================== % Property Lists +% Implementation node: \@EpydocSeparator evaluates to nothing on +% the first use, and to a paragraph break on subsequent uses. \renewenvironment{EpydocPropertyList}{% \def\@EpydocSeparator{% \aftergroup\def\aftergroup\@EpydocSeparator\aftergroup{% This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 16:56:37
|
Revision: 1781 http://epydoc.svn.sourceforge.net/epydoc/?rev=1781&view=rev Author: edloper Date: 2008-02-24 08:56:35 -0800 (Sun, 24 Feb 2008) Log Message: ----------- svn:ignore Property Changed: ---------------- trunk/epydoc/doc/ Property changes on: trunk/epydoc/doc ___________________________________________________________________ Name: svn:ignore - *-man.html api *.pyc tmp.txt examples + *-man.html api *.pyc tmp.txt examples epydoc-style-list.txt This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 06:49:21
|
Revision: 1780 http://epydoc.svn.sourceforge.net/epydoc/?rev=1780&view=rev Author: edloper Date: 2008-02-23 22:49:16 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Syntax highlighting for sty files Added Paths: ----------- trunk/epydoc/src/tools/sty2html.py Added: trunk/epydoc/src/tools/sty2html.py =================================================================== --- trunk/epydoc/src/tools/sty2html.py (rev 0) +++ trunk/epydoc/src/tools/sty2html.py 2008-02-24 06:49:16 UTC (rev 1780) @@ -0,0 +1,115 @@ +#!/usr/bin/env python +# +# Convert epydoc's LaTeX sty files to HTML + +from epydoc.docwriter.latex_sty import STYLESHEETS +import re, sys, os.path + +TEMPLATE = """\ +<?xml version="1.0" encoding="ascii" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ascii" /> +<title>%(title)s</title> +<link rel="stylesheet" href="epydoc.css" type="text/css" /> +</head> +<body> +<div class="body"> +<h1 class="title">%(title)s</h1> +<pre>%(body)s</pre> +</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> +""" + +COLOR = {'def': '#705000', + 'defname': '#000080', + 'comment': '#005080', + 'command': '#705000', + 'escape': '#ffffff', + } +COLORIZE_RE = re.compile('|'.join(['(%s)' % s for s in [ + r'(?P<def>(re)?new(command|environment)){(?P<defname>[^}]+)}', + r'(?P<command>\\\w+)', + r'(?P<escape>\\.)', + r'(?P<comment>%.*)', + ]])) + +def subfunc(m): + if m.group('def') is not None: + return ('<code class="%s">%s</code>{<code class="%s">%s</code>}' % + ('keyword', m.group('def'), 'function', m.group('defname'))) + if m.group('command') is not None: + return '<code class="%s">%s</code>' % ('keyword', m.group('command')) + if m.group('escape') is not None: + return '<code class="%s">%s</code>' % ('escape', m.group('escape')) + if m.group('comment') is not None: + return '<code class="%s">%s</code>' % ('comment', m.group('comment')) + assert False, 'expected to match some group' + +def colorize(s, title): + s = s.replace('&', '&') + s = s.replace('<', '<') + s = s.replace('>', '>') + body = COLORIZE_RE.sub(subfunc, s) + return TEMPLATE % dict(title=title, body=body) + +def main(): + if len(sys.argv) != 2: + print 'Usage: %s <output-dir>' % sys.argv[0] + sys.exit(-1) + + # hackish to hardcode this; oh well. + sty_list = open('doc/epydoc-style-list.txt', 'w') + sty_list.write('.. This file is automatically generated by %s\n\n' % + sys.argv[0]) + + output_dir = sys.argv[1] + for (name, sheet) in sorted(STYLESHEETS.items()): + if name == 'default': pass + filename = 'epydoc-sty-%s.html' % name + title = 'LaTeX Style File: epydoc-%s.sty' % name + out = open(os.path.join(output_dir, filename), 'wb') + out.write(colorize(sheet, title)) + out.close() + sty_list.write('- `%s <%s>`__\n' % (title, filename)) + + sty_list.close() + + # hackish to hardcode this; oh well. + demo = open('doc/epydoc-latex-demo.tex').read() + out = open(os.path.join(output_dir, 'epydoc-latex-demo.html'), 'wb') + out.write(colorize(demo, 'Epydoc LaTeX Style Reference')) + out.close() + + +if __name__ == '__main__': + main() Property changes on: trunk/epydoc/src/tools/sty2html.py ___________________________________________________________________ Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 06:46:12
|
Revision: 1779 http://epydoc.svn.sourceforge.net/epydoc/?rev=1779&view=rev Author: edloper Date: 2008-02-23 22:46:10 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Added options to the latex command in the makefile Modified Paths: -------------- trunk/epydoc/Makefile Modified: trunk/epydoc/Makefile =================================================================== --- trunk/epydoc/Makefile 2008-02-24 06:41:25 UTC (rev 1778) +++ trunk/epydoc/Makefile 2008-02-24 06:46:10 UTC (rev 1779) @@ -157,6 +157,7 @@ rm -rf $(LATEX_API) mkdir -p $(LATEX_API) $(EPYDOC) --pdf -o $(LATEX_API) --docformat plaintext \ + --no-module-list --graph classtree --sty shaded \ --name "Epydoc $(VERSION)" $(PY_SRC) -v --debug touch .api-pdf.up2date This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 06:41:27
|
Revision: 1778 http://epydoc.svn.sourceforge.net/epydoc/?rev=1778&view=rev Author: edloper Date: 2008-02-23 22:41:25 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Guard against ClassDoc.bases being UNKNOWN Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2008-02-24 06:40:56 UTC (rev 1777) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2008-02-24 06:41:25 UTC (rev 1778) @@ -1272,6 +1272,7 @@ context, options, cls2node, truncated): # Add inheritance edges. for (cls, node) in cls2node.items(): + if cls.bases is UNKNOWN: continue for base in cls.bases: if base in cls2node: graph.edges.append(mkedge(cls2node[base], 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 06:41:01
|
Revision: 1777 http://epydoc.svn.sourceforge.net/epydoc/?rev=1777&view=rev Author: edloper Date: 2008-02-23 22:40:56 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Simplified code for drawing the class hierarchy; and 'object' is now omitted from the class hierarchy. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-24 06:40:17 UTC (rev 1776) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-24 06:40:56 UTC (rev 1777) @@ -1000,21 +1000,22 @@ # Build a set containing all classes that we should list. # This includes everything in class_list, plus any of those # class' bases, but not undocumented subclasses. - class_set = self.class_set.copy() + class_set = set() for doc in self.class_list: - if doc.bases != UNKNOWN: - for base in doc.bases: - if base not in class_set: - if isinstance(base, ClassDoc): - class_set.update(base.mro()) - else: - # [XX] need to deal with this -- how? - pass - #class_set.add(base) - + class_set.update([base for base in doc.mro() + if isinstance(base, ClassDoc) and + base.canonical_name != DottedName('object')]) + + out('<ul class="nomargin-top">\n') for doc in sorted(class_set, key=lambda c:c.canonical_name[-1]): - if doc.bases != UNKNOWN and len(doc.bases)==0: + # If doc is a subclass of anything that's documented, then + # we don't need to list it separately; it will be listed + # under that base. + for base in doc.mro()[1:]: + if base in class_set: break + else: + # It's not a subclass of anything documented: self.write_class_tree_item(out, doc, class_set) out('</ul>\n') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 06:40:25
|
Revision: 1776 http://epydoc.svn.sourceforge.net/epydoc/?rev=1776&view=rev Author: edloper Date: 2008-02-23 22:40:17 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Removed obsolete guard against adding a class to the subclass list twice (from introspect & parsing) -- the current implementation just chooses the introspect's version of the subclass list over the parse version. Modified Paths: -------------- trunk/epydoc/src/epydoc/docparser.py Modified: trunk/epydoc/src/epydoc/docparser.py =================================================================== --- trunk/epydoc/src/epydoc/docparser.py 2008-02-24 06:09:50 UTC (rev 1775) +++ trunk/epydoc/src/epydoc/docparser.py 2008-02-24 06:40:17 UTC (rev 1776) @@ -1582,17 +1582,7 @@ if class_doc.bases is not UNKNOWN: for basedoc in class_doc.bases: if isinstance(basedoc, ClassDoc): - # This test avoids that a subclass gets listed twice when - # both introspection and parsing. - # [XXX] This check only works because currently parsing is - # always performed just after introspection of the same - # class. A more complete fix shuld be independent from - # calling order; probably the subclasses list should be - # replaced by a ClassDoc set or a {name: ClassDoc} mapping. - if (basedoc.subclasses - and basedoc.subclasses[-1].canonical_name - != class_doc.canonical_name): - basedoc.subclasses.append(class_doc) + basedoc.subclasses.append(class_doc) # If the preceeding comment includes a docstring, then add it. add_docstring_from_comments(class_doc, comments) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 06:09:56
|
Revision: 1775 http://epydoc.svn.sourceforge.net/epydoc/?rev=1775&view=rev Author: edloper Date: 2008-02-23 22:09:50 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Added --inherit-from-object. Default is now to not inherit methods & properties from object. Modified Paths: -------------- trunk/epydoc/src/epydoc/cli.py trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2008-02-24 05:45:19 UTC (rev 1774) +++ trunk/epydoc/src/epydoc/cli.py 2008-02-24 06:09:50 UTC (rev 1775) @@ -152,7 +152,7 @@ external_api=[], external_api_file=[], external_api_root=[], redundant_details=False, src_code_tab_width=8, verbosity=0, include_timestamp=True, target={}, default_target=None, - pdfdriver='auto', show_submodule_list=True) + pdfdriver='auto', show_submodule_list=True, inherit_from_object=False) # append_const is not defined in py2.3 or py2.4, so use a callback # instead, with the following function: @@ -326,9 +326,19 @@ generation_group.add_option('--no-submodule-list', action='store_false', dest='show_submodule_list', - help="Do not nclude a list of submodules on package " + help="Do not include a list of submodules on package " "documentation pages.") + generation_group.add_option('--inherit-from-object', + action='store_true', dest='inherit_from_object', + help="Include methods & properties that are inherited from " + "\"object\".") + + generation_group.add_option('--no-inherit-from-object', + action='store_false', dest='inherit_from_object', + help="Do not include methods & properties that are inherited " + "from \"object\". (default)") + output_group = OptionGroup(optparser, 'Output Options') optparser.add_option_group(output_group) @@ -647,6 +657,8 @@ options.redundant_details = _str_to_bool(val, optname) elif optname in ('submodule-list', 'submodule_list'): options.show_submodule_list = _str_to_bool(val, optname) + elif optname in ('inherit-from-object', 'inherit_from_object'): + options.inherit_from_object = _str_to_bool(val, optname) # Output options elif optname == 'name': @@ -869,11 +881,13 @@ exclude_parse = '|'.join(options.exclude_parse+options.exclude) exclude_introspect = '|'.join(options.exclude_introspect+ options.exclude) + inherit_from_object = options.inherit_from_object docindex = build_doc_index(options.names, options.introspect, options.parse, add_submodules=(options.actions!=['text']), exclude_introspect=exclude_introspect, - exclude_parse=exclude_parse) + exclude_parse=exclude_parse, + inherit_from_object=inherit_from_object) if docindex is None: for logger in loggers: Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2008-02-24 05:45:19 UTC (rev 1774) +++ trunk/epydoc/src/epydoc/docbuilder.py 2008-02-24 06:09:50 UTC (rev 1775) @@ -147,7 +147,8 @@ def build_doc(item, introspect=True, parse=True, add_submodules=True, - exclude_introspect=None, exclude_parse=None): + exclude_introspect=None, exclude_parse=None, + inherit_from_object=False): """ Build API documentation for a given item, and return it as an L{APIDoc} object. @@ -170,11 +171,13 @@ """ docindex = build_doc_index([item], introspect, parse, add_submodules, exclude_introspect=exclude_introspect, - exclude_parse=exclude_parse) + exclude_parse=exclude_parse, + inherit_from_object=inherit_from_object) return docindex.root[0] def build_doc_index(items, introspect=True, parse=True, add_submodules=True, - exclude_introspect=None, exclude_parse=None): + exclude_introspect=None, exclude_parse=None, + inherit_from_object=False): """ Build API documentation for the given list of items, and return it in the form of a L{DocIndex}. @@ -298,7 +301,7 @@ if isinstance(val_doc, ClassDoc): percent = float(i)/len(valdocs) log.progress(percent, val_doc.canonical_name) - inherit_docs(val_doc) + inherit_docs(val_doc, inherit_from_object) log.end_progress() # Initialize the groups & sortedvars attributes. @@ -1321,9 +1324,10 @@ class_doc.variables[name].overrides = var_doc -def inherit_docs(class_doc): +def inherit_docs(class_doc, inherit_from_object): for base_class in list(class_doc.mro(warn_about_bad_bases=True)): if base_class == class_doc: continue + if base_class.pyval is object and not inherit_from_object: continue # Inherit any groups. Place them *after* this class's groups, # so that any groups that are important to this class come This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 05:45:21
|
Revision: 1774 http://epydoc.svn.sourceforge.net/epydoc/?rev=1774&view=rev Author: edloper Date: 2008-02-23 21:45:19 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Fixed bug that caused doctest blocks to sometimes omit newlines in latex rendered output. Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/doctest.py Modified: trunk/epydoc/src/epydoc/markup/doctest.py =================================================================== --- trunk/epydoc/src/epydoc/markup/doctest.py 2008-02-24 05:44:32 UTC (rev 1773) +++ trunk/epydoc/src/epydoc/markup/doctest.py 2008-02-24 05:45:19 UTC (rev 1774) @@ -86,6 +86,9 @@ #: Typically, this string ends a preformatted area. SUFFIX = None + #: The string used to divide lines + NEWLINE = '\n' + #: A list of the names of all Python keywords. ('as' is included #: even though it is technically not a keyword.) _KEYWORDS = ("and del for is raise" @@ -191,21 +194,21 @@ # Parse the doctest example: pysrc, want = m.group('source', 'want') # Pre-example text: - output.append(s[charno:m.start()]) + output.append(self.NEWLINE.join(s[charno:m.start()].split('\n'))) # Example source code: output.append(self.DOCTEST_RE.sub(self.subfunc, pysrc)) # Example output: if want: if self.EXCEPT_RE.match(want): - output += '\n'.join([self.markup(line, 'except') - for line in want.split('\n')]) + output += self.NEWLINE.join([self.markup(line, 'except') + for line in want.split('\n')]) else: - output += '\n'.join([self.markup(line, 'output') - for line in want.split('\n')]) + output += self.NEWLINE.join([self.markup(line, 'output') + for line in want.split('\n')]) # Update charno charno = m.end() # Add any remaining post-example text. - output.append(s[charno:]) + output.append(self.NEWLINE.join(s[charno:].split('\n'))) return self.PREFIX + ''.join(output) + self.SUFFIX @@ -213,8 +216,8 @@ other, text = match.group(1, 2) #print 'M %20r %20r' % (other, text) # <- for debugging if other: - other = '\n'.join([self.markup(line, 'other') - for line in other.split('\n')]) + other = self.NEWLINE.join([self.markup(line, 'other') + for line in other.split('\n')]) if match.group('PROMPT1'): return other + self.markup(text, 'prompt') @@ -243,7 +246,7 @@ pieces.append(self.markup(line, 'string')) else: pieces.append('') - return other + '\n'.join(pieces) + return other + self.NEWLINE.join(pieces) elif match.group('DEFINE'): m = re.match('(?P<def>\w+)(?P<space>\s+)(?P<name>\w+)', text) return other + (self.markup(m.group('def'), 'keyword') + @@ -302,6 +305,7 @@ """A subclass of DoctestColorizer that generates LaTeX output.""" PREFIX = '\\begin{alltt}\n' SUFFIX = '\\end{alltt}\n' + NEWLINE = '\\\\\n' def markup(self, s, tag): if tag == 'other': return plaintext_to_latex(s) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-24 05:44:35
|
Revision: 1773 http://epydoc.svn.sourceforge.net/epydoc/?rev=1773&view=rev Author: edloper Date: 2008-02-23 21:44:32 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Fixed bug that caused latex writer to use the wrong colorization method for doctests containing codeblocks (not marked w/ prompts) Modified Paths: -------------- trunk/epydoc/src/epydoc/markup/restructuredtext.py Modified: trunk/epydoc/src/epydoc/markup/restructuredtext.py =================================================================== --- trunk/epydoc/src/epydoc/markup/restructuredtext.py 2008-02-24 03:43:33 UTC (rev 1772) +++ trunk/epydoc/src/epydoc/markup/restructuredtext.py 2008-02-24 05:44:32 UTC (rev 1773) @@ -91,7 +91,8 @@ from epydoc.docwriter.xlink import ApiLinkReader from epydoc.util import wordwrap, plaintext_to_html, plaintext_to_latex from epydoc.markup.doctest import doctest_to_html, doctest_to_latex, \ - HTMLDoctestColorizer + HTMLDoctestColorizer, \ + LaTeXDoctestColorizer #: A dictionary whose keys are the "consolidated fields" that are #: recognized by epydoc; and whose values are the corresponding epydoc @@ -605,7 +606,11 @@ raise SkipNode() def visit_doctest_block(self, node): - self.body.append(doctest_to_latex(node[0].astext())) + pysrc = node[0].astext() + if node.get('codeblock'): + self.body.append(LaTeXDoctestColorizer().colorize_codeblock(pysrc)) + else: + self.body.append(doctest_to_latex(pysrc)) raise SkipNode() def visit_admonition(self, node, name=''): 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. |
From: <ed...@us...> - 2008-02-24 03:42:44
|
Revision: 1771 http://epydoc.svn.sourceforge.net/epydoc/?rev=1771&view=rev Author: edloper Date: 2008-02-23 19:42:42 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Better error reporting Modified Paths: -------------- trunk/epydoc/src/tools/mkdispatch.py Modified: trunk/epydoc/src/tools/mkdispatch.py =================================================================== --- trunk/epydoc/src/tools/mkdispatch.py 2008-02-24 03:42:20 UTC (rev 1770) +++ trunk/epydoc/src/tools/mkdispatch.py 2008-02-24 03:42:42 UTC (rev 1771) @@ -39,7 +39,12 @@ def get_anchor(s): # IndexErrors are expected to test for what else include in the map - return "".join(map(charmap.__getitem__, s)) + try: + return "".join(map(charmap.__getitem__, s)) + except KeyError, e: + sys.stderr.write('Unexpected char while getting anchor for %r: %s\n' + % (s, e)) + sys.exit(-1) if __name__ == '__main__': for fn in sys.argv[1:]: 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:42:22
|
Revision: 1770 http://epydoc.svn.sourceforge.net/epydoc/?rev=1770&view=rev Author: edloper Date: 2008-02-23 19:42:20 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Added --no-submodule-list option Modified Paths: -------------- trunk/epydoc/src/epydoc/cli.py trunk/epydoc/src/epydoc/docwriter/html.py trunk/epydoc/src/epydoc/docwriter/latex.py Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2008-02-24 03:41:21 UTC (rev 1769) +++ trunk/epydoc/src/epydoc/cli.py 2008-02-24 03:42:20 UTC (rev 1770) @@ -152,7 +152,7 @@ external_api=[], external_api_file=[], external_api_root=[], redundant_details=False, src_code_tab_width=8, verbosity=0, include_timestamp=True, target={}, default_target=None, - pdfdriver='auto') + pdfdriver='auto', show_submodule_list=True) # append_const is not defined in py2.3 or py2.4, so use a callback # instead, with the following function: @@ -314,12 +314,21 @@ action='store_true', dest='include_log', help=("Include a page with the process log (epydoc-log.html)")) - generation_group.add_option( - '--redundant-details', + generation_group.add_option('--redundant-details', action='store_true', dest='redundant_details', help=("Include values in the details lists even if all info " "about them is already provided by the summary table.")) + generation_group.add_option('--show-submodule-list', + action='store_true', dest='show_submodule_list', + help="Include a list of submodules on package documentation " + "pages. (default)") + + generation_group.add_option('--no-submodule-list', + action='store_false', dest='show_submodule_list', + help="Do not nclude a list of submodules on package " + "documentation pages.") + output_group = OptionGroup(optparser, 'Output Options') optparser.add_option_group(output_group) @@ -636,6 +645,8 @@ options.include_log = _str_to_bool(val, optname) elif optname in ('redundant-details', 'redundant_details'): options.redundant_details = _str_to_bool(val, optname) + elif optname in ('submodule-list', 'submodule_list'): + options.show_submodule_list = _str_to_bool(val, optname) # Output options elif optname == 'name': Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-24 03:41:21 UTC (rev 1769) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-24 03:42:20 UTC (rev 1770) @@ -376,6 +376,10 @@ """If true, then include objects in the details list even if all info about them is already provided by the summary table.""" + self._show_submodule_list = kwargs.get('show_submodule_list', True) + """If true, the include a list of submodules on the package + documentation page.""" + # For use with select_variables(): if self._show_private: self._public_filter = None @@ -769,7 +773,7 @@ self.write_standard_fields(out, doc) # If it's a package, then list the modules it contains. - if doc.is_package is True: + if doc.is_package is True and self._show_submodule_list: self.write_module_list(out, doc) # Write summary tables describing the variables that the Modified: trunk/epydoc/src/epydoc/docwriter/latex.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/latex.py 2008-02-24 03:41:21 UTC (rev 1769) +++ trunk/epydoc/src/epydoc/docwriter/latex.py 2008-02-24 03:42:20 UTC (rev 1770) @@ -59,6 +59,7 @@ self._top_section = 2 self._index_functions = 1 self._hyperref = 1 + self._show_submodule_list = kwargs.get('show_submodule_list', True) self._graph_types = kwargs.get('graphs', ()) or () """Graphs that we should include in our output.""" @@ -341,8 +342,8 @@ self.write_standard_fields(out, doc) # If it's a package, list the sub-modules. - if (self._list_submodules and doc.submodules != - UNKNOWN and doc.submodules): + if (self._list_submodules and self._show_submodule_list and + doc.submodules != UNKNOWN and doc.submodules): self.write_module_list(out, doc) # Contents. 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-23 20:52:37
|
Revision: 1768 http://epydoc.svn.sourceforge.net/epydoc/?rev=1768&view=rev Author: edloper Date: 2008-02-23 12:52:35 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - When pre-importing modules, catch any ImportError exceptions, and ignore them for now -- we'll report them during documentation generation. Modified Paths: -------------- trunk/epydoc/src/epydoc/docbuilder.py Modified: trunk/epydoc/src/epydoc/docbuilder.py =================================================================== --- trunk/epydoc/src/epydoc/docbuilder.py 2008-02-23 20:48:06 UTC (rev 1767) +++ trunk/epydoc/src/epydoc/docbuilder.py 2008-02-23 20:52:35 UTC (rev 1768) @@ -339,9 +339,11 @@ _import_docs_from_package(val, options) elif is_pyname(item): if options.must_introspect(item): - val = get_value_from_name(item) - if options.add_submodules and inspect.ismodule(val): - _import_docs_from_package(val, options) + try: + val = get_value_from_name(item) + if options.add_submodules and inspect.ismodule(val): + _import_docs_from_package(val, options) + except ImportError, e: pass def _import_docs_from_package(pkg, options): subpackage_filenames = set() @@ -376,7 +378,8 @@ if options.must_introspect(modulename): log.progress(0, 'Importing %s' % modulename) #log.debug('importing %r (%s)' % (filename, modulename)) - return get_value_from_filename(filename) + try: return get_value_from_filename(filename) + except ImportError, e: return None #///////////////////////////////////////////////////////////////// # Documentation Generation This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-23 20:48:13
|
Revision: 1767 http://epydoc.svn.sourceforge.net/epydoc/?rev=1767&view=rev Author: edloper Date: 2008-02-23 12:48:06 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Added options --max-html-graph-size and --max-latex-graph-size Modified Paths: -------------- trunk/epydoc/src/epydoc/cli.py Modified: trunk/epydoc/src/epydoc/cli.py =================================================================== --- trunk/epydoc/src/epydoc/cli.py 2008-02-23 20:31:31 UTC (rev 1766) +++ trunk/epydoc/src/epydoc/cli.py 2008-02-23 20:48:06 UTC (rev 1767) @@ -76,6 +76,7 @@ import ConfigParser from epydoc.docwriter.html_css import STYLESHEETS as CSS_STYLESHEETS from epydoc.docwriter.latex_sty import STYLESHEETS as STY_STYLESHEETS +from epydoc.docwriter.dotgraph import DotGraph # This module is only available if Docutils are in the system try: @@ -429,6 +430,18 @@ action='append', dest='pstat_files', metavar='FILE', help="A pstat output file, to be used in generating call graphs.") + graph_group.add_option('--max-html-graph-size', + action='store', dest='max_html_graph_size', metavar='SIZE', + help="Set the maximum graph size for HTML graphs. This should " + "be a string of the form \"w,h\", specifying the maximum width " + "and height in inches. Default=%r" % DotGraph.DEFAULT_HTML_SIZE) + + graph_group.add_option('--max-latex-graph-size', + action='store', dest='max_latex_graph_size', metavar='SIZE', + help="Set the maximum graph size for LATEX graphs. This should " + "be a string of the form \"w,h\", specifying the maximum width " + "and height in inches. Default=%r" % DotGraph.DEFAULT_LATEX_SIZE) + # this option is for developers, not users. graph_group.add_option("--profile-epydoc", action="store_true", dest="profile", @@ -436,7 +449,6 @@ ("Run the hotshot profiler on epydoc itself. Output " "will be written to profile.out.")) - return_group = OptionGroup(optparser, 'Return Value Options') optparser.add_option_group(return_group) @@ -545,6 +557,18 @@ optparser.error("Use of the pdflatex driver is incompatible " "with generating dvi or ps output.") + # Set max graph sizes + if options.max_html_graph_size: + if not re.match(r'^\d+\s*,\s*\d+$', options.max_html_graph_size): + optparser.error("Bad max-html-graph-size value: %r" % + options.max_html_graph_size) + DotGraph.DEFAULT_HTML_SIZE = options.max_html_graph_size + if options.max_latex_graph_size: + if not re.match(r'^\d+\s*,\s*\d+$', options.max_latex_graph_size): + optparser.error("Bad max-latex-graph-size value: %r" % + options.max_latex_graph_size) + DotGraph.DEFAULT_LATEX_SIZE = options.max_latex_graph_size + # Calculate verbosity. verbosity = getattr(options, 'verbosity', 0) options.verbosity = verbosity + options.verbose - options.quiet @@ -663,6 +687,10 @@ options.graph_font_size = _str_to_int(val, optname) elif optname == 'pstat': options.pstat_files.extend(_str_to_list(val)) + elif optname in ('max-html-graph-size', 'max_html_graph_size'): + options.max_html_graph_size = val + elif optname in ('max-latex-graph-size', 'max_latex_graph_size'): + options.max_latex_graph_size = val # Return value options elif optname in ('failon', 'fail-on', 'fail_on'): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-23 20:31:32
|
Revision: 1766 http://epydoc.svn.sourceforge.net/epydoc/?rev=1766&view=rev Author: edloper Date: 2008-02-23 12:31:31 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Use different minimum graph sizes for latex & html output. These sizes default to the values DotGraph.DEFAULT_LATEX_SIZE and DotGraph.DEFAULT_HTML_SIZE, respectively. (This will make it easier to add a command-line option to change those defaults.) Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2008-02-23 20:11:27 UTC (rev 1765) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2008-02-23 20:31:31 UTC (rev 1766) @@ -83,9 +83,16 @@ DEFAULT_NODE_DEFAULTS={'fontsize':10, 'fontname': 'Helvetica'} DEFAULT_EDGE_DEFAULTS={'fontsize':10, 'fontname': 'Helvetica'} + DEFAULT_LATEX_SIZE="6.25,8" + """The default minimum size in inches (width,height) for graphs + when rendering with `to_latex()`""" + + DEFAULT_HTML_SIZE="10,20" + """The default minimum size in inches (width,height) for graphs + when rendering with `to_html()`""" + def __init__(self, title, body='', node_defaults=None, - edge_defaults=None, caption=None, - max_width=6, max_height=8): + edge_defaults=None, caption=None): """ Create a new `DotGraph`. """ @@ -111,12 +118,6 @@ :type: ``str``""" - self.max_width = max_width - """The maximum width of the graph (in inches)""" - - self.max_height = max_height - """The maximum height of the graph (in inches)""" - self.node_defaults = node_defaults or self.DEFAULT_NODE_DEFAULTS """Default attribute values for nodes.""" @@ -142,23 +143,30 @@ self.uid = '%s_%s' % (self.uid, n) self._uids.add(self.uid) - def to_latex(self, image_file, center=True): + def to_latex(self, image_file, center=True, size=None): """ Return the LaTeX code that should be used to display this graph. Two image files will be written: image_file+'.eps' and image_file+'.pdf'. + + :param size: The maximum size for the generated image, in + inches. In particular, if ``size`` is ``\"w,h\"``, then + this will add a line ``size=\"w,h\"`` to the dot graph. + Defaults to `DEFAULT_LATEX_SIZE`. + :type size: ``str`` """ + size = size or self.DEFAULT_LATEX_SIZE # Use dot2tex if requested (and if it's available). # Otherwise, render it to an image file & use \includgraphics. if USE_DOT2TEX and dot2tex is not None: - try: return self._to_dot2tex(center) + try: return self._to_dot2tex(center, size) except KeyboardInterrupt: raise except: raise log.warning('dot2tex failed; using dot instead') # Render the graph in postscript. - ps = self._run_dot('-Tps') + ps = self._run_dot('-Tps', size=size) # Write the postscript output. psfile = open(image_file+'.eps', 'wb') psfile.write('%!PS-Adobe-2.0 EPSF-1.2\n') @@ -178,7 +186,7 @@ if center: s = '\\begin{center}\n%s\\end{center}\n' % s return s - def _to_dot2tex(self, center=True): + def _to_dot2tex(self, center=True, size=None): # requires: pgf, latex-xcolor. from dot2tex import dot2tex if 0: # DEBUG @@ -191,25 +199,32 @@ log.addHandler(console) options = dict(crop=True, autosize=True, figonly=True, debug=True) conv = dot2tex.Dot2PGFConv(options) - s = conv.convert(self.to_dotfile()) + s = conv.convert(self.to_dotfile(size=size)) conv.dopreproc = False s = conv.convert(s) if center: s = '\\begin{center}\n%s\\end{center}\n' % s return s - def to_html(self, image_file, image_url, center=True): + def to_html(self, image_file, image_url, center=True, size=None): """ Return the HTML code that should be uesd to display this graph (including a client-side image map). :param image_url: The URL of the image file for this graph; this should be generated separately with the `write()` method. + :param size: The maximum size for the generated image, in + inches. In particular, if ``size`` is ``\"w,h\"``, then + this will add a line ``size=\"w,h\"`` to the dot graph. + Defaults to `DEFAULT_HTML_SIZE`. + :type size: ``str`` """ + size = size or self.DEFAULT_HTML_SIZE # If dotversion >1.8.10, then we can generate the image and # the cmapx with a single call to dot. Otherwise, we need to # run dot twice. if get_dot_version() > [1,8,10]: - cmapx = self._run_dot('-Tgif', '-o%s' % image_file, '-Tcmapx') + cmapx = self._run_dot('-Tgif', '-o%s' % image_file, + '-Tcmapx', size=size) if cmapx is None: return '' # failed to render else: if not self.write(image_file): @@ -291,32 +306,44 @@ if url: attribs['href'] = url else: del attribs['href'] - def write(self, filename, language='gif'): + def write(self, filename, language='gif', size=None): """ Render the graph using the output format `language`, and write the result to `filename`. :return: True if rendering was successful. + :param size: The maximum size for the generated image, in + inches. In particular, if ``size`` is ``\"w,h\"``, then + this will add a line ``size=\"w,h\"`` to the dot graph. + If not specified, no size line will be added. + :type size: ``str`` """ result = self._run_dot('-T%s' % language, - '-o%s' % filename) + '-o%s' % filename, + size=size) # Decode into unicode, if necessary. if language == 'cmapx' and result is not None: result = result.decode('utf-8') return (result is not None) - def render(self, language='gif'): + def render(self, language='gif', size=None): """ Use the ``dot`` command to render this graph, using the output format `language`. Return the result as a string, or ``None`` if the rendering failed. + + :param size: The maximum size for the generated image, in + inches. In particular, if ``size`` is ``\"w,h\"``, then + this will add a line ``size=\"w,h\"`` to the dot graph. + If not specified, no size line will be added. + :type size: ``str`` """ - return self._run_dot('-T%s' % language) + return self._run_dot('-T%s' % language, size=size) - def _run_dot(self, *options): + def _run_dot(self, *options, **kwparam): try: result, err = run_subprocess((DOT_COMMAND,)+options, - self.to_dotfile()) + self.to_dotfile(**kwparam)) if err: log.warning("Graphviz dot warning(s):\n%s" % err) except OSError, e: log.warning("Unable to render Graphviz dot graph (%s):\n%s" % @@ -325,24 +352,31 @@ if epydoc.DEBUG: filename = tempfile.mktemp('.dot') out = open(filename, 'wb') - out.write(self.to_dotfile()) + out.write(self.to_dotfile(**kwparam)) out.close() log.debug('Failed dot graph written to %s' % filename) return None return result - def to_dotfile(self): + def to_dotfile(self, size=None): """ Return the string contents of the dot file that should be used to render this graph. + + :param size: The maximum size for the generated image, in + inches. In particular, if ``size`` is ``\"w,h\"``, then + this will add a line ``size=\"w,h\"`` to the dot graph. + If not specified, no size line will be added. + :type size: ``str`` """ lines = ['digraph %s {' % self.uid, - 'size="%d,%d"\n' % (self.max_width, self.max_height), 'node [%s]' % ','.join(['%s="%s"' % (k,v) for (k,v) in self.node_defaults.items()]), 'edge [%s]' % ','.join(['%s="%s"' % (k,v) for (k,v) in self.edge_defaults.items()])] + if size: + lines.append('size="%s"' % size) if self.body: lines.append(self.body) lines.append('/* Nodes */') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-23 20:11:30
|
Revision: 1765 http://epydoc.svn.sourceforge.net/epydoc/?rev=1765&view=rev Author: edloper Date: 2008-02-23 12:11:27 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - DocstringLinker.url_for() is now an optional method Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/dotgraph.py Modified: trunk/epydoc/src/epydoc/docwriter/dotgraph.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2008-02-23 20:11:01 UTC (rev 1764) +++ trunk/epydoc/src/epydoc/docwriter/dotgraph.py 2008-02-23 20:11:27 UTC (rev 1765) @@ -274,7 +274,8 @@ # Link xrefs in body def subfunc(m): - url = docstring_linker.url_for(m.group(1)) + try: url = docstring_linker.url_for(m.group(1)) + except NotImplementedError: url = '' if url: return 'href="%s"%s' % (url, m.group(2)) else: return '' self.body = re.sub("href\s*=\s*['\"]?<([\w\.]+)>['\"]?\s*(,?)", @@ -285,7 +286,8 @@ if 'href' in attribs: m = re.match(r'^<([\w\.]+)>$', attribs['href']) if m: - url = docstring_linker.url_for(m.group(1)) + try: url = docstring_linker.url_for(m.group(1)) + except NotImplementedError: url = '' if url: attribs['href'] = url else: del attribs['href'] @@ -579,9 +581,10 @@ tooltip = " ".join(tooltip.split()) else: tooltip = class_doc.canonical_name - DotGraphNode.__init__(self, tooltip=tooltip, - width=0, height=0, shape='plaintext', - href=linker.url_for(class_doc) or NOOP_URL) + try: url = linker.url_for(class_doc) or NOOP_URL + except NotImplementedError: url = NOOP_URL + DotGraphNode.__init__(self, tooltip=tooltip, width=0, height=0, + shape='plaintext', href=url) #///////////////////////////////////////////////////////////////// #{ Attribute Linking @@ -726,7 +729,8 @@ # [xx] should I set constraint=false here? attribs.setdefault('headport', 'body') attribs.setdefault('tailport', 'body') - url = self.linker.url_for(var) or NOOP_URL + try: url = self.linker.url_for(var) or NOOP_URL + except NotImplementedError: url = NOOP_URL self.edges.append(DotGraphEdge(self, type_node, label=var.name, arrowtail='odiamond', arrowhead='none', href=url, tooltip=var.canonical_name, labeldistance=1.5, @@ -769,7 +773,8 @@ self._type_descr(var_doc.value)) if type_descr: label += ': %s' % type_descr # Get the URL - url = self.linker.url_for(var_doc) or NOOP_URL + try: url = self.linker.url_for(var_doc) or NOOP_URL + except NotImplementedError: url = NOOP_URL # Construct & return the pseudo-html code return self._ATTRIBUTE_CELL % (url, self._tooltip(var_doc), label) @@ -792,7 +797,8 @@ if len(label) > self._max_signature_width: label = label[:self._max_signature_width-4]+'...)' # Get the URL - url = self.linker.url_for(var_doc) or NOOP_URL + try: url = self.linker.url_for(var_doc) or NOOP_URL + except NotImplementedError: url = NOOP_URL # Construct & return the pseudo-html code return self._OPERATION_CELL % (url, self._tooltip(var_doc), label) @@ -939,8 +945,9 @@ self.collapsed = collapsed self.options = options self.excluded_submodules = excluded_submodules - DotGraphNode.__init__(self, shape='plaintext', - href=linker.url_for(module_doc) or NOOP_URL, + try: url = linker.url_for(module_doc) or NOOP_URL + except NotImplementedError: url = NOOP_URL + DotGraphNode.__init__(self, shape='plaintext', href=url, tooltip=module_doc.canonical_name) #: Expects: (color, color, url, tooltip, body) @@ -976,7 +983,8 @@ """ MAX_ROW_WIDTH = 80 # unit is roughly characters. pkg_name = package.canonical_name - pkg_url = self.linker.url_for(package) or NOOP_URL + try: pkg_url = self.linker.url_for(package) or NOOP_URL + except NotImplementedError: pkg_url = NOOP_URL if (not package.is_package or len(package.submodules) == 0 or self.collapsed): @@ -1181,11 +1189,12 @@ if base in exclude: break # Don't do the same class twice. if base in cls2node: continue + # Decide if the base is documented. + try: documented = (linker.url_for(base) is not None) + except: documented = True # Make the node. if base in classes: typ = 'selected' - elif (hasattr(linker, 'docindex') and - linker.docindex.find(identifier, self.container) is None): - typ = 'undocumented' + elif not documented: typ = 'undocumented' else: typ = 'superclass' cls2node[base] = mknode(base, typ, linker, context, options) graph.nodes.append(cls2node[base]) @@ -1499,8 +1508,9 @@ # Set the URL. (Do this even if it points to the page we're # currently on; otherwise, the tooltip is ignored.) - url = linker.url_for(val_doc) - node['href'] = url or NOOP_URL + try: url = linker.url_for(val_doc) or NOOP_URL + except NotImplementedError: url = NOOP_URL + node['href'] = url if (url is None and hasattr(linker, 'docindex') and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-23 20:11:04
|
Revision: 1764 http://epydoc.svn.sourceforge.net/epydoc/?rev=1764&view=rev Author: edloper Date: 2008-02-23 12:11:01 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - Removed stale (unreachable) code Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/html.py Modified: trunk/epydoc/src/epydoc/docwriter/html.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-23 20:10:34 UTC (rev 1763) +++ trunk/epydoc/src/epydoc/docwriter/html.py 2008-02-23 20:11:01 UTC (rev 1764) @@ -3497,7 +3497,6 @@ elif isinstance(identifier, APIDoc): return self.htmlwriter.url(identifier) - doc = identifier else: raise TypeError('Expected string or APIDoc') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ed...@us...> - 2008-02-23 20:10:36
|
Revision: 1763 http://epydoc.svn.sourceforge.net/epydoc/?rev=1763&view=rev Author: edloper Date: 2008-02-23 12:10:34 -0800 (Sat, 23 Feb 2008) Log Message: ----------- - DocstringLinker.url_for() is now an optional method Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/latex.py Modified: trunk/epydoc/src/epydoc/docwriter/latex.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/latex.py 2008-02-23 20:10:25 UTC (rev 1762) +++ trunk/epydoc/src/epydoc/docwriter/latex.py 2008-02-23 20:10:34 UTC (rev 1763) @@ -987,8 +987,6 @@ def translate_identifier_xref(self, identifier, label=None): if label is None: label = markup.plaintext_to_latex(identifier) return '\\texttt{%s}' % label - def url_for(self, identifier): - return None _docstring_linker = _LatexDocstringLinker() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |