Changeset 2751 for vendor

Show
Ignore:
Timestamp:
10/22/2008 01:27:48 PM (3 months ago)
Author:
guyer
Message:

Load /Users/guyer/Documents/Python/epydoc-r1810 into
vendor/epydoc/current.

Location:
vendor/epydoc/current/src/epydoc
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • vendor/epydoc/current/src/epydoc/cli.py

    r2476 r2751  
    55# URL: <http://epydoc.sf.net> 
    66# 
    7 # $Id: cli.py 1801 2008-02-27 00:20:24Z edloper $ 
     7# $Id: cli.py 1807 2008-03-04 02:32:58Z edloper $ 
    88 
    99""" 
     
    10571057    log.info('%r pdfdriver selected' % options.pdfdriver) 
    10581058     
    1059     from epydoc.docwriter.latex import LatexWriter 
     1059    from epydoc.docwriter.latex import LatexWriter, show_latex_warnings 
    10601060    latex_writer = LatexWriter(docindex, **options.__dict__) 
    1061     latex_writer.write(latex_target) 
     1061    try: 
     1062        latex_writer.write(latex_target) 
     1063    except IOError, e: 
     1064        log.error(e) 
     1065        log.end_progress() 
     1066        log.start_progress() 
     1067        log.end_progress() 
     1068        return 
    10621069    log.end_progress() 
    10631070 
     
    11201127                # changed what page some things are on. 
    11211128                running = latex_command 
    1122                 if _RERUN_LATEX_RE.match(out): 
     1129                if _RERUN_LATEX_RE.search(out): 
    11231130                    log.progress(step/steps, '%s (Third pass)' % LaTeX) 
    11241131                    out, err = run_subprocess('%s api.tex' % latex_command) 
     
    11261133                # A fourth path should (almost?) never be necessary. 
    11271134                running = latex_command 
    1128                 if _RERUN_LATEX_RE.match(out): 
     1135                if _RERUN_LATEX_RE.search(out): 
    11291136                    log.progress(step/steps, '%s (Fourth pass)' % LaTeX) 
    1130                     run_subprocess('%s api.tex' % latex_command) 
     1137                    out, err = run_subprocess('%s api.tex' % latex_command) 
    11311138                step += 1 
     1139 
     1140                # Show the output, if verbosity is high: 
     1141                if options.verbosity > 2 or epydoc.DEBUG: 
     1142                    show_latex_warnings(out) 
    11321143 
    11331144            # If requested, convert to postscript. 
  • vendor/epydoc/current/src/epydoc/docintrospecter.py

    r2476 r2751  
    55# URL: <http://epydoc.sf.net> 
    66# 
    7 # $Id: docintrospecter.py 1722 2008-02-15 01:11:18Z edloper $ 
     7# $Id: docintrospecter.py 1810 2008-03-31 03:22:51Z edloper $ 
    88 
    99""" 
     
    268268        # value if it's defined in this module. 
    269269        container = get_containing_module(child) 
    270         if ((container is not None and 
    271              container == name_without_primes) or 
    272             (public_names is not None and 
    273              child_name in public_names)): 
     270        if (((container is not None and 
     271              container == name_without_primes) or 
     272             (public_names is not None and 
     273              child_name in public_names)) 
     274            and not inspect.ismodule(child)): 
    274275            # Local variable. 
    275276            child_val_doc = introspect_docs(child, context=module_doc, 
     
    280281                                        container=module_doc, 
    281282                                        docs_extracted_by='introspecter') 
    282         elif container is None or module_doc.canonical_name is UNKNOWN: 
     283        elif ((container is None or module_doc.canonical_name is UNKNOWN) 
     284              and not inspect.ismodule(child)): 
    283285 
    284286            # Don't introspect stuff "from __future__" 
  • vendor/epydoc/current/src/epydoc/docwriter/latex.py

    r2476 r2751  
    44# 
    55# Created [01/30/01 05:18 PM] 
    6 # $Id: latex.py 1799 2008-02-27 00:01:42Z edloper $ 
     6# $Id: latex.py 1809 2008-03-05 18:40:49Z edloper $ 
    77# 
    88 
     
    4646        # Process keyword arguments 
    4747        self._show_private = kwargs.get('show_private', 0) 
    48         self._prj_name = kwargs.get('prj_name', None) or 'API Documentation' 
     48        self._prj_name = kwargs.get('prj_name', None) 
    4949        self._show_crossrefs = kwargs.get('crossref', 1) 
    5050        self._index = kwargs.get('index', 1) 
     
    125125                filename = '%s-module.tex' % val_doc.canonical_name 
    126126                self._write(self.write_module, directory, filename, val_doc) 
    127             elif (isinstance(val_doc, ClassDoc) and  
    128                   self._list_classes_separately): 
     127            elif isinstance(val_doc, ClassDoc): 
    129128                filename = '%s-class.tex' % val_doc.canonical_name 
    130129                self._write(self.write_class, directory, filename, val_doc) 
     
    205204        @rtype: C{int} 
    206205        """ 
    207         n = 1 
    208         for doc in self.valdocs: 
    209             if isinstance(doc, ModuleDoc): n += 1 
    210             if isinstance(doc, ClassDoc) and self._list_classes_separately: 
    211                 n += 1 
    212         return n 
     206        return 1 + len([doc for doc in self.valdocs 
     207                        if isinstance(doc, (ClassDoc, ModuleDoc))]) 
    213208         
    214209    def _mkdir(self, directory): 
     
    230225        self.write_preamble(out) 
    231226        out('\n\\begin{document}\n\n') 
    232         self.write_start_of(out, 'Header') 
     227        out(self.start_of('Header')) 
    233228 
    234229        # Write the title. 
    235         self.write_start_of(out, 'Title') 
    236         out('\\title{%s}\n' % plaintext_to_latex(self._prj_name, 1)) 
     230        out(self.start_of('Title')) 
     231        out('\\title{%s}\n' % plaintext_to_latex( 
     232            self._prj_name or 'API Documentation', 1)) 
    237233        out('\\author{API Documentation}\n') 
    238234        out('\\maketitle\n') 
    239235 
    240236        # Add a table of contents. 
    241         self.write_start_of(out, 'Table of Contents') 
     237        out(self.start_of('Table of Contents')) 
    242238        out('\\addtolength{\\parskip}{-1ex}\n') 
    243239        out('\\tableofcontents\n') 
     
    245241 
    246242        # Include documentation files. 
    247         self.write_start_of(out, 'Includes') 
     243        out(self.start_of('Includes')) 
    248244        for val_doc in self.valdocs: 
    249245            if isinstance(val_doc, ModuleDoc): 
     
    259255        # Add the index, if requested. 
    260256        if self._index: 
    261             self.write_start_of(out, 'Index') 
     257            out(self.start_of('Index')) 
    262258            out('\\printindex\n\n') 
    263259 
    264260        # Add the footer. 
    265         self.write_start_of(out, 'Footer') 
     261        out(self.start_of('Footer')) 
    266262        out('\\end{document}\n\n') 
    267263 
     
    308304    def write_module(self, out, doc): 
    309305        self.write_header(out, doc) 
    310         self.write_start_of(out, 'Module Description') 
     306        out(self.start_of('Section Heading', doc)) 
    311307 
    312308        # Add this module to the index. 
    313         out('    ' + self.indexterm(doc, 'start')) 
     309        out(self.indexterm(doc, 'start')) 
    314310 
    315311        # Add a section marker. 
     
    320316        # Add the module's description. 
    321317        if doc.descr not in (None, UNKNOWN): 
    322             out(' '*4 + '\\begin{EpydocModuleDescription}%\n') 
     318            out(self.start_of('Description', doc)) 
     319            out('\\begin{EpydocModuleDescription}%\n') 
    323320            out(self.docstring_to_latex(doc.descr, doc, 4)) 
    324             out(' '*4 + '\\end{EpydocModuleDescription}\n') 
     321            out('\\end{EpydocModuleDescription}\n') 
    325322 
    326323        # Add version, author, warnings, requirements, notes, etc. 
    327         self.write_standard_fields(out, doc) 
     324        out(self.metadata(doc)) 
    328325 
    329326        # If it's a package, list the sub-modules. 
     
    343340            classes = doc.select_variables(imported=False, value_type='class', 
    344341                                           public=self._public_filter) 
    345             for var_doc in classes: 
    346                 self.write_class(out, var_doc.value) 
     342            if classes: 
     343                out(self.start_of('Classes', doc)) 
     344                for var_doc in classes: 
     345                    # don't use \include -- can't be nested. 
     346                    out('\\input{%s-class}\n' % var_doc.value.canonical_name) 
    347347 
    348348        # Mark the end of the module (for the index) 
    349         out('    ' + self.indexterm(doc, 'end')) 
     349        out(self.start_of('Footer', doc)) 
     350        out(self.indexterm(doc, 'end')) 
    350351 
    351352    def render_graph(self, graph): 
     
    354355        return graph.to_latex(self._directory) or '' 
    355356 
    356     def write_class(self, out, doc, short_name=None): 
    357         if short_name is None: short_name = doc.canonical_name[-1] 
    358          
     357    def write_class(self, out, doc): 
     358        self.write_header(out, doc) 
     359        out(self.start_of('Section Heading', doc)) 
     360 
     361        # Add this class to the index. 
     362        out(self.indexterm(doc, 'start')) 
     363 
     364        # Decide on our short (contextualized) name. 
    359365        if self._list_classes_separately: 
    360             self.write_header(out, doc) 
    361         self.write_start_of(out, 'Class Description') 
    362  
    363         # Add this class to the index. 
    364         out('    ' + self.indexterm(doc, 'start')) 
    365  
    366         # Add a section marker. 
     366            short_name = doc.canonical_name 
     367        if doc.defining_module not in (None, UNKNOWN): 
     368            short_name = doc.canonical_name.contextualize( 
     369                doc.defining_module.canonical_name) 
     370        else: 
     371            short_name = doc.canonical_name[-1] 
     372 
     373        # Decidie on our initial section level. 
    367374        if self._list_classes_separately: 
    368375            seclevel = 0 
    369             out(self.section('%s %s' % (self.doc_kind(doc), 
    370                                         _dotted(doc.canonical_name)),  
    371                              seclevel, ref=doc)) 
    372376        else: 
    373377            seclevel = 1 
    374             out(self.section('%s %s' % (self.doc_kind(doc), 
    375                                         _dotted(short_name)),  
    376                              seclevel, ref=doc)) 
    377  
     378 
     379        # Add a section marker. 
     380        out(self.section('%s %s' % (self.doc_kind(doc), _dotted(short_name)), 
     381                         seclevel, ref=doc)) 
     382 
     383        # Display our base classes & subclasses 
     384        out(self.start_of('Class Tree', doc)) 
    378385        if ((doc.bases not in (UNKNOWN, None) and len(doc.bases) > 0) or 
    379386            (doc.subclasses not in (UNKNOWN,None) and len(doc.subclasses)>0)): 
     
    399406                sc_items = [_hyperlink(sc, '%s' % sc.canonical_name) 
    400407                            for sc in doc.subclasses] 
     408                out('{\\raggedright%\n') 
    401409                out(self._descrlist(sc_items, 'Known Subclasses', short=1)) 
     410                out('}%\n') 
    402411 
    403412        # The class's description. 
    404413        if doc.descr not in (None, UNKNOWN): 
    405             out(' '*4 + '\\begin{EpydocClassDescription}\n') 
    406             out(self.docstring_to_latex(doc.descr, doc)) 
    407             out(' '*4 + '\\end{EpydocClassDescription}\n') 
     414            out(self.start_of('Description', doc)) 
     415            out('\\begin{EpydocClassDescription}%\n') 
     416            out(self.docstring_to_latex(doc.descr, doc, 4)) 
     417            out('\\end{EpydocClassDescription}\n') 
    408418 
    409419        # Version, author, warnings, requirements, notes, etc. 
    410         self.write_standard_fields(out, doc) 
     420        out(self.metadata(doc)) 
    411421 
    412422        # Contents. 
     
    423433 
    424434        # Mark the end of the class (for the index) 
    425         out('    ' + self.indexterm(doc, 'end')) 
     435        out(self.start_of('Footer', doc)) 
     436        out(self.indexterm(doc, 'end')) 
    426437 
    427438        # Write any nested classes.  These will have their own 
    428439        # section (at the same level as this section) 
    429         for nested_class in doc.select_variables(imported=False, 
    430                                                  value_type='class', 
    431                                                  public=self._public_filter): 
    432             if (nested_class.value.canonical_name != UNKNOWN and 
    433                 (nested_class.value.canonical_name[:-1] == 
    434                  doc.canonical_name)): 
    435                 self.write_class(out, nested_class.value, 
    436                                  DottedName(short_name, 
    437                                             nested_class.canonical_name[-1])) 
     440        if not self._list_classes_separately: 
     441            nested_classes = doc.select_variables( 
     442                    imported=False, value_type='class', 
     443                    public=self._public_filter) 
     444            if nested_classes: 
     445                out(self.start_of('Nested Classes', doc)) 
     446                for nested_class in nested_classes: 
     447                    if (nested_class.value.canonical_name != UNKNOWN and 
     448                        (nested_class.value.canonical_name[:-1] == 
     449                         doc.canonical_name)): 
     450                        # don't use \include -- can't be nested. 
     451                        out('\\input{%s-class}\n' % 
     452                            nested_class.value.canonical_name) 
    438453 
    439454    #//////////////////////////////////////////////////////////// 
     
    457472    def write_module_list(self, out, doc): 
    458473        if len(doc.submodules) == 0: return 
    459         self.write_start_of(out, 'Submodules') 
     474        out(self.start_of('Submodules', doc)) 
    460475         
    461476        out(self.section('Submodules', 1)) 
     
    480495        @rtype: C{string} 
    481496        """ 
    482         out(' '*depth + '\\item[%s]' % _hyperlink(doc, doc.canonical_name[-1])) 
     497        out(' '*depth + '\\item[%s]\n' % 
     498            _hyperlink(doc, doc.canonical_name[-1])) 
    483499 
    484500        if doc.summary not in (None, UNKNOWN): 
    485             out(' %s\n' % self.docstring_to_latex(doc.summary, doc)) 
     501            out(self.docstring_to_latex(doc.summary, doc, depth+2)) 
    486502        out(self.crossref(doc) + '\n\n') 
    487503        if doc.submodules != UNKNOWN and doc.submodules: 
     
    499515            width = self._find_tree_width(doc)+2 
    500516            linespec = [] 
    501             s = ('&'*(width-4)+'\\multicolumn{2}{l}{\\textbf{%s}}\n' % 
     517            s = ('  %% Class tree line for this class (%s)\n  ' % 
     518                 doc.canonical_name + '&'*(width-4) + 
     519                 '\\multicolumn{2}{l}{\\textbf{%s}}\n' % 
    502520                   _dotted('%s'%self._base_name(doc))) 
    503521            s += '\\end{tabular}\n\n' 
     
    535553 
    536554    def _base_tree_line(self, doc, width, linespec): 
     555        # linespec is a list of booleans. 
    537556        base_name = _dotted(self._base_name(doc)) 
    538557         
    539         # linespec is a list of booleans. 
    540         s = '%% Line for %s, linespec=%s\n' % (base_name, linespec) 
    541  
     558        s = '  %% Class tree line for base "%s"\n' % self._base_name(doc) 
    542559        labelwidth = width-2*len(linespec)-2 
    543560 
    544561        # The base class name. 
    545         s += ('\\multicolumn{%s}{r}{' % labelwidth) 
    546         s += '\\settowidth{\\EpydocBCL}{%s}' % base_name 
    547         s += ('\\multirow{2}{\\EpydocBCL}{%s}}\n' % 
    548               _hyperlink(doc, self._base_name(doc))) 
     562        s += '  \\multicolumn{%s}{r}{\n' % labelwidth 
     563        s += '      \\settowidth{\\EpydocBCL}{%s}\n' % base_name 
     564        s += '      \\multirow{2}{\\EpydocBCL}{\n' 
     565        s += '        %s}}\n' % _hyperlink(doc, self._base_name(doc)) 
    549566 
    550567        # The vertical bars for other base classes (top half) 
    551568        for vbar in linespec: 
    552             if vbar: s += '&&\\multicolumn{1}{|c}{}\n' 
    553             else: s += '&&\n' 
     569            if vbar: s += '    &&\\multicolumn{1}{|c}{}\n' 
     570            else: s += '    &&\n' 
    554571 
    555572        # The horizontal line. 
    556         s += '  \\\\\\cline{%s-%s}\n' % (labelwidth+1, labelwidth+1) 
     573        s += '    \\\\\\cline{%s-%s}\n' % (labelwidth+1, labelwidth+1) 
    557574 
    558575        # The vertical bar for this base class. 
    559         s += '  ' + '&'*labelwidth 
     576        s += '    ' + '&'*labelwidth 
    560577        s += '\\multicolumn{1}{c|}{}\n' 
    561578 
    562579        # The vertical bars for other base classes (bottom half) 
    563580        for vbar in linespec: 
    564             if vbar: s += '&\\multicolumn{1}{|c}{}&\n' 
    565             else: s += '&&\n' 
    566         s += '  \\\\\n' 
     581            if vbar: s += '    &\\multicolumn{1}{|c}{}&\n' 
     582            else: s += '    &&\n' 
     583         
     584        s += '    \\\\\n' 
    567585 
    568586        return s 
     
    584602 
    585603        # Write a header. 
    586         self.write_start_of(out, 'Classes') 
     604        out(self.start_of('Classes', doc)) 
    587605        out(self.section('Classes', 1)) 
    588606        out('\\begin{EpydocClassList}\n') 
     
    606624                                             var_doc.name)) 
    607625        if doc.summary not in (None, UNKNOWN): 
    608             out(': %s\n' % self.docstring_to_latex(doc.summary, doc)) 
    609         out(self.crossref(doc) + '\n\n') 
     626            out(': %\n' + self.docstring_to_latex(doc.summary, doc)) 
     627        out(self.crossref(doc)) 
    610628         
    611629    #//////////////////////////////////////////////////////////// 
     
    628646 
    629647        # Write a header. 
    630         self.write_start_of(out, heading) 
    631         out('  '+self.section(heading, seclevel)) 
     648        out(self.start_of(heading, doc)) 
     649        out(self.section(heading, seclevel)) 
    632650 
    633651        out('\\begin{%s}\n' % list_type) 
     
    719737    #{ Function Details 
    720738    #//////////////////////////////////////////////////////////// 
     739 
     740    def replace_par(self, out): 
     741        def new_out(s): 
     742            s = re.sub('(?m)\n([ \t]*\n)+', '\\par\n', s) 
     743            s = re.sub(r'\\par\b', r'\\EpydocPar', s) 
     744            s = re.sub(r'(?m)^([ \t]*)([^ \t].*)\\EpydocPar\n', 
     745                       r'\1\2\n\1\\EpydocPar\n', s) 
     746            out(s) 
     747        return new_out 
    721748     
    722749    def write_function(self, out, var_doc): 
     
    728755        # directly to the function. 
    729756        if not is_inherited: 
    730             out('    %s%%\n' % self.indexterm(func_doc)) 
    731  
    732         # This latex command takes 8 arguments. 
    733         out('\\EpydocFunction{%\n') 
    734  
     757            out('  %s' % self.indexterm(func_doc)) 
     758 
     759        out('  \\EpydocFunction{%% <<< %s >>>\n' % var_doc.name) 
     760 
     761        # We're passing arguments using xkeyval, which is unhappy if 
     762        # the arguments contain \par.  So replace every occurence of 
     763        # \par with \EpydocPar (which is defined to just return \par). 
     764        out = self.replace_par(out) 
     765         
    735766        # Argument 1: the function signature 
    736         out(self.function_signature(var_doc)) 
    737         out('}{%\n') 
     767        out('    signature={%%\n%s    }' % 
     768            self.function_signature(var_doc)) 
    738769 
    739770        # Argument 2: the function description 
    740771        if func_doc.descr not in (None, UNKNOWN): 
    741             out(self.docstring_to_latex(func_doc.descr, func_doc, 4)) 
    742         out('}{%\n') 
     772            out(',\n    description={%\n') 
     773            out(self.docstring_to_latex(func_doc.descr, func_doc, 6)) 
     774            out('    }') 
    743775 
    744776        # Argument 3: the function parameter descriptions 
    745777        if func_doc.arg_descrs or func_doc.arg_types: 
     778            out(',\n    parameters={%\n') 
    746779            self.write_function_parameters(out, var_doc) 
    747         out('}{%\n') 
     780            out('    }') 
    748781 
    749782        # Argument 4: The return description 
    750783        if func_doc.return_descr not in (None, UNKNOWN): 
    751                 out(self.docstring_to_latex(func_doc.return_descr, 
    752                                             func_doc, 6)) 
    753         out('}{%\n') 
     784            out(',\n    returndescr={%\n') 
     785            out(self.docstring_to_latex(func_doc.return_descr, func_doc, 6)) 
     786            out('    }') 
    754787         
    755788        # Argument 5: The return type 
    756789        if func_doc.return_type not in (None, UNKNOWN): 
    757                 out(self.docstring_to_latex(func_doc.return_type, 
    758                                             func_doc, 6).strip()) 
    759         out('}{%\n') 
     790            out(',\n    returntype={%\n') 
     791            out(self.docstring_to_latex(func_doc.return_type, func_doc, 6)) 
     792            out('    }') 
    760793 
    761794        # Argument 6: The raises section 
    762795        if func_doc.exception_descrs not in (None, UNKNOWN, [], ()): 
     796            out(',\n    raises={%\n') 
    763797            out(' '*6+'\\begin{EpydocFunctionRaises}\n') 
    764798            for name, descr in func_doc.exception_descrs: 
     
    766800                    plaintext_to_latex('%s' % name)) 
    767801                out(self.docstring_to_latex(descr, func_doc, 10)) 
    768             out(' '*6+'\\end{EpydocFunctionRaises}\n\n') 
    769         out('}{%\n') 
     802            out(' '*6+'\\end{EpydocFunctionRaises}\n') 
     803            out('    }') 
    770804 
    771805        # Argument 7: The overrides section 
    772806        if var_doc.overrides not in (None, UNKNOWN): 
     807            out(',\n    overrides={%\n') 
    773808            out('\\EpydocFunctionOverrides') 
    774809            if (func_doc.docstring in (None, UNKNOWN) and 
    775810                var_doc.overrides.value.docstring not in (None, UNKNOWN)): 
    776811                out('[1]') 
    777             out('{%s}\n\n'  
     812            out('{%s}\n'  
    778813                % _hyperlink(var_doc.overrides,  
    779814                             '%s' % var_doc.overrides.canonical_name)) 
    780         out('}{%\n') 
     815            out('    }') 
    781816 
    782817        # Argument 8: The metadata section 
    783         self.write_standard_fields(out, func_doc) 
    784         out('}\n') 
    785              
     818        metadata = self.metadata(func_doc, 6) 
     819        if metadata: 
     820            out(',\n    metadata={%%\n%s    }' % metadata) 
     821 
     822        out('}%\n') 
    786823 
    787824    def write_function_parameters(self, out, var_doc): 
     
    804841        for (arg_names, arg_descr) in arg_descrs: 
    805842            arg_name = plaintext_to_latex(', '.join(arg_names)) 
    806             out('%s\\item[%s]\n\n' % (' '*10, arg_name)) 
     843            out('%s\\item[%s]\n' % (' '*8, arg_name)) 
    807844            if arg_descr: 
    808845                out(self.docstring_to_latex(arg_descr, func_doc, 10)) 
     
    817854                    else: 
    818855                        lhs = 'type of %s' % arg_name 
    819                     rhs = self.docstring_to_latex(arg_typ, func_doc).strip() 
    820                     out('%s{\\it (%s=%s)}\n\n' % (' '*12, lhs, rhs)) 
    821         out(' '*6+'\\end{EpydocFunctionParameters}\n\n') 
    822          
    823     def function_signature(self, var_doc): 
     856                    rhs = self.docstring_to_latex(arg_typ, func_doc, 14) 
     857                    out('%s\\textit{ (%s=%%\n%s%s)}\n' % (' '*12, lhs, 
     858                                                      rhs, ' '*12)) 
     859        out(' '*6+'\\end{EpydocFunctionParameters}\n') 
     860         
     861    def function_signature(self, var_doc, indent=6): 
    824862        func_doc = var_doc.value 
    825863        func_name = var_doc.name 
    826864 
    827         s = ('\\begin{EpydocFunctionSignature}{%s}%%\n' % 
    828              _hypertarget(var_doc, func_name)) 
     865        s = ('%s\\begin{EpydocFunctionSignature}%%\n%s  {%s}%%\n' % 
     866             (indent*' ', indent*' ', _hypertarget(var_doc, func_name))) 
    829867       
    830868        # This should never happen, but just in case: 
     
    843881            if func_doc.kwarg: 
    844882                args.append('\\KWArg{%s}' % plaintext_to_latex(func_doc.kwarg))