How to use the sphinx.addnodes.desc_name function in Sphinx

To help you get started, we’ve selected a few Sphinx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zyegfryed / django-statici18n / docs / _ext / djangodocs.py View on Github external
def parse_django_admin_node(env, sig, signode):
    command = sig.split(' ')[0]
    env.ref_context['std:program'] = command
    title = "django-admin %s" % sig
    signode += addnodes.desc_name(title, title)
    return command
github securestate / king-phisher / king_phisher / sphinxext / rpc.py View on Github external
def handle_signature(self, sig, signode):
		m = re.match(r'([a-zA-Z0-9_/\(\):]+)\(([a-zA-Z0-9,\'"_= ]*)\)', sig)
		if not m:
			signode += addnodes.desc_name(sig, sig)
			return sig
		uri_path, args = m.groups()
		signode += addnodes.desc_name(uri_path, uri_path)
		plist = DescRPCArgumentList()
		args = args.split(',')
		for pos, arg in enumerate(args):
			arg = arg.strip()
			if pos < len(args) - 1:
				arg += ','
			x = DescRPCArgument()
			x += addnodes.desc_parameter(arg, arg)
			plist += x
		signode += plist
		return uri_path
github rchain / architecture-docs / conf.py View on Github external
def parse_event(env, sig, signode):
    m = event_sig_re.match(sig)
    if not m:
        signode += addnodes.desc_name(sig, sig)
        return sig
    name, args = m.groups()
    signode += addnodes.desc_name(name, name)
    plist = addnodes.desc_parameterlist()
    for arg in args.split(','):
        arg = arg.strip()
        plist += addnodes.desc_parameter(arg, arg)
        signode += plist
    return name
github wkhere / stackless / Doc / tools / sphinxext / pyspecific.py View on Github external
def parse_opcode_signature(env, sig, signode):
    """Transform an opcode signature into RST nodes."""
    m = opcode_sig_re.match(sig)
    if m is None:
        raise ValueError
    opname, arglist = m.groups()
    signode += addnodes.desc_name(opname, opname)
    paramlist = addnodes.desc_parameterlist()
    signode += paramlist
    paramlist += addnodes.desc_parameter(arglist, arglist)
    return opname.strip()
github kipr / opencv / doc / ocv.py View on Github external
def attach_name(self, node, name):
        owner, name = name.split_owner()
        varname = unicode(name)
        if owner is not None:
            owner = unicode(owner) + '::'
            node += addnodes.desc_addname(owner, owner)
        node += addnodes.desc_name(varname, varname)
github sphinx-doc / sphinx / sphinx / domains / rst.py View on Github external
def handle_signature(self, sig, signode):
        # type: (str, addnodes.desc_signature) -> str
        name, args = parse_directive(sig)
        desc_name = '.. %s::' % name
        signode += addnodes.desc_name(desc_name, desc_name)
        if len(args) > 0:
            signode += addnodes.desc_addname(args, args)
        return name
github diadoc / diadocsdk-1c-docs / docs / source / _extensions / CComDomain.py View on Github external
def handle_signature(self, sig, signode):
        m = py_sig_re.match(sig)
        if m is None:
            raise ValueError
        name_prefix, name, arglist, retann = m.groups()

        classname, fullname = (name_prefix.rstrip('.'), name_prefix + name) if name_prefix else ('', name)

        signode['class'] = classname
        signode['fullname'] = fullname

        if name_prefix:
            signode += addnodes.desc_addname(name_prefix, name_prefix)

        signode += addnodes.desc_name(name, name)
        if not arglist:
            if self.needs_arglist():
                signode += addnodes.desc_parameterlist()
            return fullname, name_prefix

        _pseudo_parse_arglist(signode, arglist)
        return fullname, name_prefix
github sphinx-doc / sphinx / sphinx / domains / rst.py View on Github external
def handle_signature(self, sig, signode):
        # type: (str, addnodes.desc_signature) -> str
        signode += addnodes.desc_name(':%s:' % sig, ':%s:' % sig)
        return sig
github odoo / odoo / doc / _extensions / autojsdoc / ext / directives.py View on Github external
def make_signature(self):
        """
        :rtype: List[nodes.Node]
        """
        return [addnodes.desc_name(self.item.name, self.item.name)]