Skip to content

Commit 9e3391b

Browse files
committed
Refactor proof type mapping to use PROOF_TYPES
Replaces the hardcoded DEFAULT_REALTYP_TO_COUNTERTYP dictionary with a dynamic construction based on PROOF_TYPES from proof_type.py. This improves maintainability by centralizing proof type definitions.
1 parent 72293a5 commit 9e3391b

1 file changed

Lines changed: 4 additions & 18 deletions

File tree

sphinx_proof/directive.py

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,13 @@
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 PROOF_TYPES
1920

2021
logger = logging.getLogger(__name__)
2122

22-
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-
}
23+
DEFAULT_REALTYP_TO_COUNTERTYP = {}
24+
for typ in PROOF_TYPES:
25+
DEFAULT_REALTYP_TO_COUNTERTYP[typ] = typ
4026

4127

4228
class ElementDirective(SphinxDirective):

0 commit comments

Comments
 (0)