Skip to content

Commit 9ba9efb

Browse files
authored
Merge pull request #46 from executablebooks/fix/41/update-domain-name
👌 IMPROVE: Rename "proof" domain and role to "prf"
2 parents f996c65 + cbc27b3 commit 9ba9efb

File tree

15 files changed

+87
-87
lines changed

15 files changed

+87
-87
lines changed

docs/source/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sphinxcontrib-prettyproof `0.0.2` is in a development stage and may change rapid
2828

2929
1. directives are automatically numbered
3030
2. supports directive options such as `class`, `label`, and `nonumber`
31-
3. can easily be referenced through `proof:ref` role
31+
3. can easily be referenced through `prf:ref` role
3232

3333
(getting-started)=
3434
## Getting Started

docs/source/syntax.md

Lines changed: 67 additions & 67 deletions
Large diffs are not rendered by default.

sphinxcontrib/prettyproof/directive.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ class ElementDirective(SphinxDirective):
3535

3636
def run(self) -> List[Node]:
3737
env = self.env
38-
domain_name, typ = self.name.split(":")[0], self.name.split(":")[1]
38+
typ = self.name.split(":")[1]
3939
serial_no = env.new_serialno()
4040

4141
if not hasattr(env, "proof_list"):
4242
env.proof_list = {}
4343

4444
# If class in options add to class array
45-
classes, class_name = [domain_name, typ], self.options.get("class", [])
45+
classes, class_name = ["proof", typ], self.options.get("class", [])
4646
if class_name:
4747
classes.extend(class_name)
4848

@@ -114,10 +114,10 @@ class ProofDirective(SphinxDirective):
114114
}
115115

116116
def run(self) -> List[Node]:
117-
domain_name, typ = self.name.split(":")[0], self.name.split(":")[1]
117+
typ = self.name.split(":")[1]
118118

119119
# If class in options add to class array
120-
classes, class_name = [domain_name, typ], self.options.get("class", [])
120+
classes, class_name = ["proof", typ], self.options.get("class", [])
121121
if class_name:
122122
classes.extend(class_name)
123123

sphinxcontrib/prettyproof/domain.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
class ProofIndex(Index):
2929

30-
name = "proof"
30+
name = "prf"
3131
localname = "Proof Index"
3232
shortname = "Proof"
3333

@@ -62,13 +62,13 @@ def result_nodes(
6262
self, document: document, env: BuildEnvironment, node: Element, is_ref: bool
6363
) -> Tuple[List[Node], List[system_message]]:
6464

65-
node["refdomain"] = "proof"
65+
node["refdomain"] = "prf"
6666
return [node], []
6767

6868

6969
class ProofDomain(Domain):
7070

71-
name = "proof"
71+
name = "prf"
7272
label = "Proof Domain"
7373

7474
roles = {"ref": ProofXRefRole()}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
index
22
=====
33

4-
.. proof:algorithm:: Test algorithm directive
4+
.. prf:algorithm:: Test algorithm directive
55
:label: label-1
66

77
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
88

99

10-
.. proof:algorithm::
10+
.. prf:algorithm::
1111
:label: label-1
1212

1313
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
index
22
=====
33

4-
This is a missing ref :proof:ref:`foo`.
4+
This is a missing ref :prf:ref:`foo`.

tests/books/test-mybook/algorithm/_algo_labeled_titled_with_classname.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
content 1
22
=========
33

4-
.. proof:algorithm:: Test algorithm directive
4+
.. prf:algorithm:: Test algorithm directive
55
:class: test-algo
66
:label: test-algo-label
77

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
content 2
22
=========
33

4-
.. proof:algorithm:: Test algorithm directive
4+
.. prf:algorithm:: Test algorithm directive
55
:nonumber:
66

77
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
content 3
22
=========
33

4-
referencing with number :proof:ref:`test-algo-label`.
4+
referencing with number :prf:ref:`test-algo-label`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
content 4
22
=========
33

4-
referencing with text: :proof:ref:`text <test-algo-label>`.
4+
referencing with text: :prf:ref:`text <test-algo-label>`.

0 commit comments

Comments
 (0)