You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/syntax.md
+71-27Lines changed: 71 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@ This documentation utilized the [Markedly Structured Text (MyST)](https://myst-p
6
6
7
7
This package utilizes a [Sphinx domain](https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html) - named "proof" - to describe and link typeset markup objects (theorems, proofs, corollaries, etc.) which we think belong together. All directives follow the pattern `{<domain_name>:<typeset>}` while all the roles follow the pattern `{<domain_name>:ref}`. To utilize any directive in the `proof` domain follow the pattern `{prf:<typeset>}`. To reference any directive follow the pattern `{prf:ref}`.
8
8
9
-
## Proofs
9
+
## Collection of Directives
10
+
11
+
### Proofs
10
12
11
13
A proof directive can be included using the `prf:proof` pattern. Unlike the other directives provided through this extension, a proof directive does not include any parameters nor does it require any arguments. A proof directive can easily be referenced through [targets](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing).
12
14
@@ -66,7 +68,7 @@ Hence $\| y - z \| \geq \| y - \hat y \|$, which completes the proof.
A theorem directive can be included using the `prf:theorem` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
72
74
@@ -133,11 +135,11 @@ The vector $\hat y$ is called the **orthogonal projection** of $y$ onto $S$.
You can refer to a theorem using the `{prf:ref}` role like: ```{prf:ref}`my-theorem` ```, which will replace the reference with the theorem number like so: {prf:ref}`my-theorem`. When an explicit text is provided, this caption will serve as the title of the reference. For example, ```{prf:ref}`Orthogonal-Projection-Theorem <my-theorem>` ``` will produce: {prf:ref}`Orthogonal-Projection-Theorem <my-theorem>`.
139
141
140
-
## Axioms
142
+
###Axioms
141
143
142
144
An axiom directive can be included using the `prf:theorem` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
143
145
@@ -171,12 +173,12 @@ Every Cauchy sequence on the real line is convergent.
171
173
172
174
_Source:_ {cite}`economic-dynamics-book`
173
175
174
-
### Referencing Axioms
176
+
####Referencing Axioms
175
177
176
178
You can refer to an axiom using the `{prf:ref}` role like: ```{prf:ref}`my-axiom` ```, which will replace the reference with the axiom number like so: {prf:ref}`my-axiom`. When an explicit text is provided, this caption will serve as the title of the reference.
177
179
178
180
179
-
## Lemmas
181
+
###Lemmas
180
182
181
183
A lemma directive can be included using the `prf:lemma` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
182
184
@@ -222,12 +224,12 @@ K(\hat F, \theta) = (\theta I - C'\hat P C)^{-1} C' \hat P (A - B \hat F)
You can refer to a lemma using the `{prf:ref}` role like: ```{prf:ref}`my-lemma` ```, which will replace the reference with the lemma number like so: {prf:ref}`my-lemma`. When an explicit text is provided, this caption will serve as the title of the reference.
228
230
229
231
230
-
## Definitions
232
+
###Definitions
231
233
232
234
A definition directive can be included using the `prf:definition` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
You can refer to a definition using the `{prf:ref}` role like: ```{prf:ref}`my-definition` ```, which will replace the reference with the definition number like so: {prf:ref}`my-definition`. When an explicit text is provided, this caption will serve as the title of the reference.
282
284
283
-
## Criteria
285
+
###Criteria
284
286
285
287
A criterion directive can be included using the `prf:criterion` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
286
288
@@ -324,12 +326,12 @@ and only if for all non-zero integers $m$,
You can refer to a criterion using the `{prf:ref}` role like: ```{prf:ref}`weyls-criterion` ```, which will replace the reference with the criterion number like so: {prf:ref}`weyls-criterion`. When an explicit text is provided, this caption will serve as the title of the reference.
330
332
331
333
332
-
## Remarks
334
+
###Remarks
333
335
334
336
A remark directive can be included using the `prf:remark` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
335
337
@@ -384,12 +386,12 @@ This property is called **spherical symmetry** (see p 81. in Leamer
You can refer to a remark using the `{prf:ref}` role like: ```{prf:ref}`my-remark` ```, which will replace the reference with the remark number like so: {prf:ref}`my-remark`. When an explicit text is provided, this caption will serve as the title of the reference.
390
392
391
393
392
-
## Conjectures
394
+
###Conjectures
393
395
394
396
**Example**
395
397
@@ -409,11 +411,11 @@ This is a dummy conjecture to illustrate that one can use math in titles.
409
411
```
410
412
``````
411
413
412
-
### Referencing Conjectures
414
+
####Referencing Conjectures
413
415
414
416
You can refer to a conjecture using the `{prf:ref}` role like: ```{prf:ref}`my-conjecture` ```, which will replace the reference with the conjecture number like so: {prf:ref}`my-conjecture`. When an explicit text is provided, this caption will serve as the title of the reference.
415
417
416
-
## Corollaries
418
+
###Corollaries
417
419
418
420
A corollary directive can be included using the `prf:corollary` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
419
421
@@ -449,12 +451,12 @@ that $\vert \vert A \vert \vert < 1$.
You can refer to a corollary using the `{prf:ref}` role like: ```{prf:ref}`my-corollary` ```, which will replace the reference with the corollary number like so: {prf:ref}`my-corollary`. When an explicit text is provided, this caption will serve as the title of the reference.
455
457
456
458
457
-
## Algorithms
459
+
###Algorithms
458
460
459
461
460
462
An algorithm directive can be included using the `prf:algorithm` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
@@ -512,12 +514,12 @@ An algorithm directive can be included using the `prf:algorithm` pattern. The di
You can refer to a algorithms using the `{prf:ref}` role like: ```{prf:ref}`my-algorithm` ```, which will replace the reference with the algorithm number like so: {prf:ref}`my-algorithm`. When an explicit text is provided, this caption will serve as the title of the reference.
518
520
519
521
520
-
## Examples
522
+
###Examples
521
523
522
524
An example directive can be included using the `prf:example` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
You can refer to an example using the `{prf:ref}` role like: ```{prf:ref}`my-example` ```, which will replace the reference with the example number like so: {prf:ref}`my-example`. When an explicit text is provided, this caption will serve as the title of the reference.
587
589
588
590
589
-
## Properties
591
+
###Properties
590
592
591
593
A property directive can be included using the `prf:property` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
592
594
@@ -618,11 +620,11 @@ This is a dummy property to illustrate the directive.
618
620
```
619
621
``````
620
622
621
-
### Referencing Properties
623
+
####Referencing Properties
622
624
623
625
You can refer to a property using the `{prf:ref}` role like: ```{prf:ref}`my-property` ```, which will replace the reference with the property number like so: {prf:ref}`my-property`. When an explicit text is provided, this caption will serve as the title of the reference.
624
626
625
-
## Observations
627
+
###Observations
626
628
627
629
An observation directive can be included using the `prf:observation` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
628
630
@@ -654,11 +656,11 @@ This is a dummy observation directive.
654
656
```
655
657
``````
656
658
657
-
### Referencing Observations
659
+
####Referencing Observations
658
660
659
661
You can refer to an observation using the `{prf:ref}` role like: ```{prf:ref}`my-observation` ```, which will replace the reference with the observation number like so: {prf:ref}`my-observation`. When an explicit text is provided, this caption will serve as the title of the reference.
660
662
661
-
## Propositions
663
+
###Propositions
662
664
663
665
A proposition directive can be included using the `prf:proposition` pattern. The directive is enumerated by default and can take in an optional title argument. The following options are also supported:
664
666
@@ -690,6 +692,48 @@ This is a dummy proposition directive.
690
692
```
691
693
``````
692
694
693
-
### Referencing Propositions
695
+
####Referencing Propositions
694
696
695
697
You can refer to a proposition using the `{prf:ref}` role like: ```{prf:ref}`my-proposition` ```, which will replace the reference with the proposition number like so: {prf:ref}`my-proposition`. When an explicit text is provided, this caption will serve as the title of the reference.
698
+
699
+
## How to Hide Content
700
+
701
+
Directive content can be hidden using the `dropdown` class which is available through [sphinx-togglebutton](https://sphinx-togglebutton.readthedocs.io/en/latest/). If your project utilizes the [MyST-NB](https://myst-nb.readthedocs.io/en/latest/) extension, there is no need to activate `sphinx-togglebutton` since it is already bundled with `MyST-NB`.
702
+
703
+
For Sphinx projects, add `"sphinx_togglebutton"` to your `extensions` list in `conf.py` to activate the extension
704
+
705
+
```python
706
+
extensions = [
707
+
...
708
+
"sphinx_togglebutton"
709
+
...
710
+
]
711
+
```
712
+
713
+
For Jupyter Book projects, add `sphinx_togglebutton` under `extra_extensions`
714
+
715
+
```yaml
716
+
sphinx:
717
+
extra_extensions:
718
+
- sphinx_togglebutton
719
+
```
720
+
721
+
To hide the directive, simply add `:class: dropdown` as a directive option.
722
+
723
+
**Example**
724
+
725
+
```{prf:theorem}
726
+
:class: dropdown
727
+
728
+
This is an example of how to hide the content of a directive.
729
+
```
730
+
731
+
**MyST Syntax**:
732
+
733
+
````
734
+
```{prf:theorem}
735
+
:class: dropdown
736
+
737
+
This is an example of how to hide the content of a directive.
0 commit comments