/
definitions.py
70 lines (64 loc) · 1.62 KB
/
definitions.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
IPUB_META_ROUTE = "ipub.pandoc"
ATTRIBUTE_CITE_CLASS = "attribute-Cite"
RAWSPAN_CLASS = "raw-span-content"
RAWDIV_CLASS = "raw-div-content"
CONVERTED_CITE_CLASS = "converted-Cite"
CONVERTED_DIRECTIVE_CLASS = "converted-rst-dir"
CONVERTED_OTHER_CLASS = "converted-Other"
# NB: it appears '-' and '^' are already used by sphinx
PREFIX_MAP = (
("", (
("classes", ()),
("attributes", (("latex", "cite"), ("rst", "cite")))
)),
("+", (
("classes", ()),
("attributes", (("latex", "cref"), ("rst", "numref")))
)),
("!", (
("classes", ()),
("attributes", (("latex", "ref"), ("rst", "ref")))
)),
("=", (
("classes", ()),
("attributes", (("latex", "eqref"), ("rst", "eq")))
)),
("?", (
("classes", ("capital",)),
("attributes", (("latex", "Cref"), ("rst", "numref")))
)),
("&", (
("classes", ()),
("attributes", (("latex", "gls"), ("rst", "gls"))),
)),
("%", (
("classes", ("capital",)),
("attributes", (("latex", "Gls"), ("rst", "glsc")))
)),
)
PREFIX_MAP_LATEX_R = (
('cref', '+'),
('Cref', '?'),
('ref', '!'),
('eqref', '='),
("cite", ""),
("gls", "&"),
("Gls", "%")
)
PREFIX_MAP_RST_R = (
('numref', '+'),
('ref', '!'),
('eq', '='),
("cite", ""),
("gls", "&"),
("glsc", "%")
)
CITE_HTML_NAMES = (
("Math", "eqn."),
("Image", "fig."),
("Table", "tbl.")
)
RST_KNOWN_ROLES = (
"py:attr", "py:meth", "py:class", "py:func", "py:mod",
"attr", "meth", "class", "func", "mod",
"download", "doc", "file", "program")