forked from WolframResearch/WolframClientForPython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwl.py
More file actions
19 lines (16 loc) · 768 Bytes
/
Copy pathwl.py
File metadata and controls
19 lines (16 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
from docutils import nodes, utils
from docutils.parsers.rst import roles
wl_ref_url = 'http://reference.wolfram.com/language/ref/%s.html'
wxf_ref_url = 'http://reference.wolfram.com/language/tutorial/WXFFormatDescription.html'
def wl_reference_role(role_name, rawtext, wl_symbol, lineno, inliner,
options={}, content=[]):
if wl_symbol == 'WXF':
symbol_ref_url = wxf_ref_url
else:
symbol_ref_url = wl_ref_url % utils.unescape(wl_symbol)
node = nodes.reference(rawtext, wl_symbol, refuri=symbol_ref_url,
classes=['wl', 'external'],
**options)
return [node], []