| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
""" |
| 6 |
Directives for references and targets. |
| 7 |
""" |
| 8 |
|
| 9 |
__docformat__ = 'reStructuredText' |
| 10 |
|
| 11 |
from docutils import nodes |
| 12 |
from docutils.transforms import references |
| 13 |
from docutils.parsers.rst import Directive |
| 14 |
from docutils.parsers.rst import directives |
| 15 |
|
| 16 |
|
| 17 |
class TargetNotes(Directive): |
| 18 |
|
| 19 |
"""Target footnote generation.""" |
| 20 |
|
| 21 |
option_spec = {'class': directives.class_option} |
| 22 |
|
| 23 |
def run(self): |
| 24 |
pending = nodes.pending(references.TargetNotes) |
| 25 |
self.add_name(pending) |
| 26 |
pending.details.update(self.options) |
| 27 |
self.state_machine.document.note_pending(pending) |
| 28 |
return [pending] |