Skip to content

Commit 8eb2e45

Browse files
authored
Merge pull request #38 from executablebooks/remove-exc-dir
🗑️ DEPRECATE: Remove exercise directive
2 parents b1de9e6 + bb1b3e8 commit 8eb2e45

File tree

6 files changed

+3
-76
lines changed

6 files changed

+3
-76
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/) extension
1010
for producing proof, theorem, axiom, lemma, definition, criterion, remark, conjecture,
11-
corollary, algorithm, exercise, example, property, observation and proposition directives.
11+
corollary, algorithm, example, property, observation and proposition directives.
1212

1313

1414
## Get started

docs/source/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
66
install
77
syntax
8-
contribute
98
testing
109
zreferences
1110
```
@@ -18,7 +17,7 @@ zreferences
1817

1918
This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/) extension
2019
for producing proof, theorem, axiom, lemma, definition, criterion, remark, conjecture,
21-
corollary, algorithm, exercise, example, property, observation and proposition directives.
20+
corollary, algorithm, example, property, observation and proposition directives.
2221

2322

2423
```{warning}

docs/source/syntax.md

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -514,58 +514,6 @@ _Source:_ [Wikipedia](https://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algor
514514

515515
You can refer to a algorithms using the `{proof:ref}` role like: ```{proof:ref}`my-algorithm` ```, which will replace the reference with the algorithm number like so: {proof:ref}`my-algorithm`. When an explicit text is provided, this caption will serve as the title of the reference.
516516

517-
## Exercises
518-
519-
An exercise directive can be included using the `proof:exercise` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
520-
521-
* `label` : text
522-
523-
A unique identifier for your exercise that you can use to reference it with `{proof:ref}`. Cannot contain spaces or special characters.
524-
* `class` : text
525-
526-
Value of the exercise’s class attribute which can be used to add custom CSS or JavaScript.
527-
* `nonumber` : flag (empty)
528-
529-
Turns off exercise auto numbering.
530-
531-
**Example**
532-
533-
```{proof:exercise}
534-
:label: my-exercise
535-
536-
Recall that $n!$ is read as "$n$ factorial" and defined as
537-
$n! = n \times (n - 1) \times \cdots \times 2 \times 1$.
538-
539-
There are functions to compute this in various modules, but let's
540-
write our own version as an exercise.
541-
542-
In particular, write a function `factorial` such that `factorial(n)` returns $n!$
543-
for any positive integer $n$.
544-
```
545-
546-
**MyST Syntax**
547-
548-
``````md
549-
```{proof:exercise}
550-
:label: my-exercise
551-
552-
Recall that $n!$ is read as "$n$ factorial" and defined as
553-
$n! = n \times (n - 1) \times \cdots \times 2 \times 1$.
554-
555-
There are functions to compute this in various modules, but let's
556-
write our own version as an exercise.
557-
558-
In particular, write a function `factorial` such that `factorial(n)` returns $n!$
559-
for any positive integer $n$.
560-
```
561-
``````
562-
563-
_Source:_ [QuantEcon](https://python-programming.quantecon.org/functions.html#Exercise-1)
564-
565-
### Referencing Exercises
566-
567-
You can refer to an exercise using the `{proof:ref}` role like: ```{proof:ref}`my-exercise` ```, which will replace the reference with the exercise number like so: {proof:ref}`my-exercise`. When an explicit text is provided, this caption will serve as the title of the reference.
568-
569517

570518
## Examples
571519

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
LONG_DESCRIPTION = """
88
This package contains a [Sphinx](http://www.sphinx-doc.org/en/master/) extension
99
for producing proof, theorem, axiom, lemma, definition, criterion, remark, conjecture,
10-
corollary, algorithm, exercise, example, property, observation and proposition
11-
directives.
10+
corollary, algorithm, example, property, observation and proposition directives.
1211
1312
This project is maintained and supported by [najuzilu](https://github.com/najuzilu).
1413
"""

sphinxcontrib/_static/proof.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,6 @@ div.criterion p.admonition-title {
8080
background-color: var(--caution-title-color);
8181
}
8282

83-
/*********************************************
84-
* Exercise *
85-
*********************************************/
86-
div.exercise {
87-
border-left: .2rem solid var(--note-border-color);
88-
background-color: var(--note-title-color);
89-
}
90-
91-
div.exercise p.admonition-title {
92-
background-color: var(--note-title-color);
93-
}
94-
9583
/*********************************************
9684
* Lemma *
9785
*********************************************/

sphinxcontrib/prettyproof/proof_type.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ class AxiomDirective(ElementDirective):
6565
name = "axiom"
6666

6767

68-
class ExerciseDirective(ElementDirective):
69-
"""A custom exercise directive."""
70-
71-
name = "exercise"
72-
73-
7468
class ExampleDirective(ElementDirective):
7569
"""A custom example directive."""
7670

@@ -105,7 +99,6 @@ class PropositionDirective(ElementDirective):
10599
"corollary": CorollaryDirective,
106100
"algorithm": AlgorithmDirective,
107101
"criterion": CriterionDirective,
108-
"exercise": ExerciseDirective,
109102
"example": ExampleDirective,
110103
"property": PropertyDirective,
111104
"observation": ObservationDirective,

0 commit comments

Comments
 (0)