31 |
|
|
32 |
import docutils.core |
import docutils.core |
33 |
|
|
|
# Because docutils' own relative path has problems with |
|
|
# paths beginning with '../', we use our own :-) |
|
34 |
import util.path |
import util.path |
35 |
|
|
36 |
|
# Because Docutils' own relative_path had problems with |
37 |
|
# paths beginning with '../', we had to build our own. |
38 |
|
# Probably we can overwrite our own by Docutils' on some day :-) |
39 |
docutils.utils.relative_path = util.path.relative_path |
docutils.utils.relative_path = util.path.relative_path |
40 |
|
|
41 |
class DocutilsException(Exception): |
class DocutilsException(Exception): |
48 |
def docutils_system_message(self, level, message, *children, **kwargs): |
def docutils_system_message(self, level, message, *children, **kwargs): |
49 |
""" |
""" |
50 |
See docutils.utils.Reporter.system_message() |
See docutils.utils.Reporter.system_message() |
51 |
This modified copy redirects docuils system messages |
This modified copy redirects Docutils system messages |
52 |
to navidoc debug. |
to navidoc debug. |
53 |
""" |
""" |
54 |
attributes = kwargs.copy() |
attributes = kwargs.copy() |
90 |
Element with name and linking features. |
Element with name and linking features. |
91 |
""" |
""" |
92 |
def do_contents(self, list): |
def do_contents(self, list): |
93 |
|
""" |
94 |
|
do_contents(list) |
95 |
|
|
96 |
|
Default implementation for element to parse and |
97 |
|
handle its contents. |
98 |
|
""" |
99 |
self.link = None |
self.link = None |
100 |
for element in list: |
for element in list: |
101 |
self.handle_contained(element) |
self.handle_contained(element) |
102 |
|
|
103 |
def handle_contained(self, element): |
def handle_contained(self, element): |
104 |
|
""" |
105 |
|
handle_contained(element) |
106 |
|
|
107 |
|
Default implementation for element to parse and |
108 |
|
handle its subelement. |
109 |
|
""" |
110 |
config.element_list.add_contained_element(self, element) |
config.element_list.add_contained_element(self, element) |