def datadesc_directive(name, arguments, options, content, lineno,
                           content_offset, block_text, state, state_machine):
    rv = admonitions.make_admonition(datadesc, name, [], options, content,
                                     lineno, content_offset, block_text,
                                     state, state_machine)
    rv[0].insert(0, desc_name(arguments[0], arguments[0]))
    return rv
def classdesc_directive(name, arguments, options, content, lineno,
                           content_offset, block_text, state, state_machine):
    rv = admonitions.make_admonition(classdesc, name, [], options, content,
                                     lineno, content_offset, block_text,
                                     state, state_machine)
    rv[0].insert(0, parse_signature(arguments[0]))
    return rv
Exemple #3
0
    def run(self):
        ret = make_admonition(bestpractice, self.name, [_('Best Practice')],
                              self.options, self.content, self.lineno,
                              self.content_offset, self.block_text, self.state,
                              self.state_machine)
        if self.arguments:
            argnodes, msgs = self.state.inline_text(self.arguments[0],
                                                    self.lineno)
            para = nodes.paragraph()
            para += argnodes
            para += msgs
            ret[0].insert(1, para)

        return ret
Exemple #4
0
    def run(self):
        env = self.state.document.settings.env

        targetid = "example-%d" % env.new_serialno('example')
        targetnode = nodes.target('', '', ids=[targetid])


        # 'name', 'arguments', 'options', 'content', 'lineno', 'content_offset', 'block_text', 'state', and
        # 'state_machine'
        ad = make_admonition(example, self.name, [], self.options, self.content, self.lineno,
                             self.content_offset, self.block_text, self.state, self.state_machine)

#        ad = make_admonition(UpdateNode,       self.name, [], self.options, self.content, self.lineno,
#                              self.content_offset, self.block_text, self.state, self.state_machine)

        return [ad]
Exemple #5
0
def seealso_directive(name, arguments, options, content, lineno,
                      content_offset, block_text, state, state_machine):
    rv = admonitions.make_admonition(addnodes.seealso, name, ['See also:'],
                                     options, content, lineno, content_offset,
                                     block_text, state, state_machine)
    return rv