Skip to content

Commit e577341

Browse files
Make citation pattern configurable
1 parent 20decf6 commit e577341

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

numpydoc/numpydoc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ def rename_references(app, what, name, obj, options, lines,
4343
references = []
4444
for line in lines:
4545
line = line.strip()
46-
m = re.match(sixu('^.. \\[([a-z0-9_.-])\\]'), line, re.I)
46+
m = re.match(sixu('^.. \\[(%s)\\]') % app.config.numpydoc_citation_re,
47+
line, re.I)
4748
if m:
4849
references.append(m.group(1))
4950

@@ -133,6 +134,7 @@ def setup(app, get_doc_object_=get_doc_object):
133134
app.add_config_value('numpydoc_show_class_members', True, True)
134135
app.add_config_value('numpydoc_show_inherited_class_members', True, True)
135136
app.add_config_value('numpydoc_class_members_toctree', True, True)
137+
app.add_config_value('numpydoc_citation_re', '[a-z0-9_.-]', True)
136138

137139
# Extra mangling domains
138140
app.add_domain(NumpyPythonDomain)

0 commit comments

Comments
 (0)