Skip to content

Commit a33704a

Browse files
committed
Move DEFAULT_REALTYP_TO_COUNTERTYP to proof_type.py
Relocated the DEFAULT_REALTYP_TO_COUNTERTYP mapping from directive.py to proof_type.py for better modularity and to centralize proof type definitions.
1 parent c90acbe commit a33704a

2 files changed

Lines changed: 18 additions & 22 deletions

File tree

sphinx_proof/directive.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,11 @@
1616
from sphinx.util.docutils import SphinxDirective
1717
from .nodes import unenumerable_node, NODE_TYPES
1818
from .nodes import proof_node
19+
from .proof_type import DEFAULT_REALTYP_TO_COUNTERTYP
1920

2021
logger = logging.getLogger(__name__)
2122

2223

23-
DEFAULT_REALTYP_TO_COUNTERTYP = {
24-
"axiom": "axiom",
25-
"theorem": "theorem",
26-
"lemma": "lemma",
27-
"algorithm": "algorithm",
28-
"definition": "definition",
29-
"remark": "remark",
30-
"conjecture": "conjecture",
31-
"corollary": "corollary",
32-
"criterion": "criterion",
33-
"example": "example",
34-
"property": "property",
35-
"observation": "observation",
36-
"proposition": "proposition",
37-
"assumption": "assumption",
38-
"notation": "notation",
39-
}
40-
41-
4224
class ElementDirective(SphinxDirective):
4325
"""A custom Sphinx Directive"""
4426

sphinx_proof/proof_type.py

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,20 @@ class NotationDirective(ElementDirective):
119119
"notation": NotationDirective,
120120
}
121121

122-
DEFAULT_REALTYP_TO_COUNTERTYP = {}
123-
for proof_type in PROOF_TYPES:
124-
DEFAULT_REALTYP_TO_COUNTERTYP[proof_type] = proof_type
122+
DEFAULT_REALTYP_TO_COUNTERTYP = {
123+
"axiom": "axiom",
124+
"theorem": "theorem",
125+
"lemma": "lemma",
126+
"algorithm": "algorithm",
127+
"definition": "definition",
128+
"remark": "remark",
129+
"conjecture": "conjecture",
130+
"corollary": "corollary",
131+
"criterion": "criterion",
132+
"example": "example",
133+
"property": "property",
134+
"observation": "observation",
135+
"proposition": "proposition",
136+
"assumption": "assumption",
137+
"notation": "notation",
138+
}

0 commit comments

Comments
 (0)