Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 __author__ = 'damonkohler@google.com (Damon Kohler)'
00016
00017 from docutils import nodes
00018
00019
00020 def make_roswiki_link(name, rawtext, text, lineno, inliner, options={}, content=[]):
00021 refuri = 'http://wiki.ros.org/' + text
00022 node = nodes.reference(rawtext, text, refuri=refuri, **options)
00023 return [node], []
00024
00025
00026 def make_rosmsg_link(name, rawtext, text, lineno, inliner, options={}, content=[]):
00027 package, message = text.split('/', 1)
00028 refuri = 'http://ros.org/doc/api/%s/html/msg/%s.html' % (package, message)
00029 node = nodes.reference(rawtext, text, refuri=refuri, **options)
00030 return [node], []
00031
00032
00033 def make_rossrv_link(name, rawtext, text, lineno, inliner, options={}, content=[]):
00034 package, message = text.split('/', 1)
00035 refuri = 'http://ros.org/doc/api/%s/html/srv/%s.html' % (package, message)
00036 node = nodes.reference(rawtext, text, refuri=refuri, **options)
00037 return [node], []
00038
00039
00040 def setup(app):
00041 app.add_role('roswiki', make_roswiki_link)
00042 app.add_role('rosmsg', make_rosmsg_link)
00043 app.add_role('rossrv', make_rossrv_link)
00044