Skip to content

Commit 1d05ffc

Browse files
committed
switch from recommonmark to myst_parser
1 parent 871460e commit 1d05ffc

File tree

10 files changed

+82
-21
lines changed

10 files changed

+82
-21
lines changed

docs/conf.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ def copy_overview(f_read: Path, f_write: Path, rebuild=False) -> None:
5252
"IPython.sphinxext.ipython_directive",
5353
"IPython.sphinxext.ipython_console_highlighting",
5454
"nbsphinx",
55-
"recommonmark",
5655
'sphinxcontrib.bibtex',
57-
'sphinx_copybutton'
56+
'sphinx_copybutton',
57+
"myst_parser"
5858
]
5959

6060
# Autodoc settings
@@ -71,12 +71,6 @@ def copy_overview(f_read: Path, f_write: Path, rebuild=False) -> None:
7171

7272
copybutton_prompt_text = ">>> "
7373

74-
# For recommonmark
75-
source_suffix = {
76-
'.rst': 'restructuredtext',
77-
'.txt': 'restructuredtext',
78-
'.md': 'markdown',
79-
}
8074

8175
nbsphinx_execute = 'always'
8276
# Some notebooks take longer than the default 30 s limit.

docs/copula.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copula
2+
3+
TODO: background information about copulas. For general/maths syntax see [`review.md`](review.md).

docs/copula.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/fpca.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Functional Principal Component Analysis (fPCA)
2+
3+
TODO: background information about fPCA. For general/maths syntax see [`review.md`](review.md).

docs/fpca.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/references.bib

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@book{ deisenroth_faisal_ong_2020,
2+
place={Cambridge},
3+
title={Mathematics for Machine Learning},
4+
DOI={10.1017/9781108679930},
5+
publisher={Cambridge University Press},
6+
author={Deisenroth, Marc Peter and Faisal, A. Aldo and Ong, Cheng Soon},
7+
year={2020}
8+
}

docs/refs.bib

Whitespace-only changes.

docs/review.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Review
2+
3+
TODO: some background statistical information/review of PDF/CDF and other terms used in `copula.md` and `fpca.md`?
4+
5+
Note: I render files with the [MyST parser](https://myst-parser.readthedocs.io/en/latest/examples/wealth_dynamics_md.html) as it makes it easier to use standard LaTeX syntax. E.g. (from [their example](https://myst-parser.readthedocs.io/en/latest/examples/wealth_dynamics_md.html) -- note that [labels are not aligned correctly in the readthedocs theme](https://github.com/readthedocs/sphinx_rtd_theme/pull/383) but we can fix this later/use another theme in the case all eqs needs to be labelled):
6+
7+
8+
## Example: Citations/Reference
9+
10+
I use [sphinxcontrib-bibtex](https://sphinxcontrib-bibtex.readthedocs.io/en/latest/quickstart.html) to render references. This can be used to cite with something like:
11+
12+
For a review, see, for example,
13+
{cite}`deisenroth_faisal_ong_2020`.
14+
15+
References are in [`references.bib`](references.bib)
16+
17+
## Example syntax in Markdown with MyST: A Model of Wealth Dynamics
18+
19+
Having discussed inequality measures, let us now turn to wealth
20+
dynamics.
21+
22+
The model we will study is
23+
24+
$$
25+
w_{t+1} = (1 + r_{t+1}) s(w_t) + y_{t+1}
26+
$$
27+
28+
where
29+
30+
- $w_t$ is wealth at time $t$ for a given household,
31+
- $r_t$ is the rate of return of financial assets,
32+
- $y_t$ is current non-financial (e.g., labor) income and
33+
- $s(w_t)$ is current wealth net of consumption
34+
35+
Letting $\{z_t\}$ be a correlated state process of the form
36+
37+
$$z_{t+1} = a z_t + b + \sigma_z \epsilon_{t+1}$$
38+
39+
we'll assume that
40+
41+
$$R_t := 1 + r_t = c_r \exp(z_t) + \exp(\mu_r + \sigma_r \xi_t)$$
42+
43+
and
44+
45+
$$y_t = c_y \exp(z_t) + \exp(\mu_y + \sigma_y \zeta_t)$$
46+
47+
Here $\{ (\epsilon_t, \xi_t, \zeta_t) \}$ is IID and standard normal in
48+
$\mathbb R^3$.
49+
50+
(md:sav_ah)=
51+
52+
```{math}
53+
---
54+
label: md:sav_ah
55+
---
56+
s(w) = s_0 w \cdot \mathbb 1\{w \geq \hat w\}
57+
```
58+
59+
60+
where $s_0$ is a positive constant.
61+
62+
63+
```{bibliography} references.bib
64+
:style: alpha
65+
```

docs/review.rst

Lines changed: 0 additions & 4 deletions
This file was deleted.

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ dependencies:
2525
- sphinx
2626
- sphinx-autobuild
2727
- sphinx_rtd_theme
28+
- myst-parser
2829
- m2r
2930
- nbsphinx
30-
- recommonmark
3131
- gdown
3232
- sphinxcontrib-bibtex
3333
- sphinx-copybutton

0 commit comments

Comments
 (0)