Show More
@@ -51,7 +51,7 b' def make_link_node(rawtext, app, type, slug, options):' | |||||
51 | **options) |
|
51 | **options) | |
52 | return node |
|
52 | return node | |
53 |
|
53 | |||
54 |
def ghissue_role(name, rawtext, text, lineno, inliner, options= |
|
54 | def ghissue_role(name, rawtext, text, lineno, inliner, options=None, content=None): | |
55 | """Link to a GitHub issue. |
|
55 | """Link to a GitHub issue. | |
56 |
|
56 | |||
57 | Returns 2 part tuple containing list of nodes to insert into the |
|
57 | Returns 2 part tuple containing list of nodes to insert into the | |
@@ -66,6 +66,8 b' def ghissue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):' | |||||
66 | :param options: Directive options for customization. |
|
66 | :param options: Directive options for customization. | |
67 | :param content: The directive content for customization. |
|
67 | :param content: The directive content for customization. | |
68 | """ |
|
68 | """ | |
|
69 | if options is None: | |||
|
70 | options = {} | |||
69 |
|
71 | |||
70 | try: |
|
72 | try: | |
71 | issue_num = int(text) |
|
73 | issue_num = int(text) | |
@@ -92,7 +94,7 b' def ghissue_role(name, rawtext, text, lineno, inliner, options={}, content=[]):' | |||||
92 | node = make_link_node(rawtext, app, category, str(issue_num), options) |
|
94 | node = make_link_node(rawtext, app, category, str(issue_num), options) | |
93 | return [node], [] |
|
95 | return [node], [] | |
94 |
|
96 | |||
95 |
def ghuser_role(name, rawtext, text, lineno, inliner, options= |
|
97 | def ghuser_role(name, rawtext, text, lineno, inliner, options=None, content=None): | |
96 | """Link to a GitHub user. |
|
98 | """Link to a GitHub user. | |
97 |
|
99 | |||
98 | Returns 2 part tuple containing list of nodes to insert into the |
|
100 | Returns 2 part tuple containing list of nodes to insert into the | |
@@ -107,13 +109,16 b' def ghuser_role(name, rawtext, text, lineno, inliner, options={}, content=[]):' | |||||
107 | :param options: Directive options for customization. |
|
109 | :param options: Directive options for customization. | |
108 | :param content: The directive content for customization. |
|
110 | :param content: The directive content for customization. | |
109 | """ |
|
111 | """ | |
|
112 | if options is None: | |||
|
113 | options = {} | |||
|
114 | ||||
110 | app = inliner.document.settings.env.app |
|
115 | app = inliner.document.settings.env.app | |
111 | #info('user link %r' % text) |
|
116 | #info('user link %r' % text) | |
112 | ref = 'https://www.github.com/' + text |
|
117 | ref = 'https://www.github.com/' + text | |
113 | node = nodes.reference(rawtext, text, refuri=ref, **options) |
|
118 | node = nodes.reference(rawtext, text, refuri=ref, **options) | |
114 | return [node], [] |
|
119 | return [node], [] | |
115 |
|
120 | |||
116 |
def ghcommit_role(name, rawtext, text, lineno, inliner, options= |
|
121 | def ghcommit_role(name, rawtext, text, lineno, inliner, options=None, content=None): | |
117 | """Link to a GitHub commit. |
|
122 | """Link to a GitHub commit. | |
118 |
|
123 | |||
119 | Returns 2 part tuple containing list of nodes to insert into the |
|
124 | Returns 2 part tuple containing list of nodes to insert into the | |
@@ -128,6 +133,9 b' def ghcommit_role(name, rawtext, text, lineno, inliner, options={}, content=[]):' | |||||
128 | :param options: Directive options for customization. |
|
133 | :param options: Directive options for customization. | |
129 | :param content: The directive content for customization. |
|
134 | :param content: The directive content for customization. | |
130 | """ |
|
135 | """ | |
|
136 | if options is None: | |||
|
137 | options = {} | |||
|
138 | ||||
131 | app = inliner.document.settings.env.app |
|
139 | app = inliner.document.settings.env.app | |
132 | #info('user link %r' % text) |
|
140 | #info('user link %r' % text) | |
133 | try: |
|
141 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now