Skip to content

Commit e6f0f9e

Browse files
committed
First version automated marp
1 parent 767def7 commit e6f0f9e

File tree

4 files changed

+129
-3
lines changed

4 files changed

+129
-3
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# bld
22
bld/*
33

4-
#pdfs
5-
*.pdf
6-
4+
*DS_Store
75

86
# Byte-compiled / optimized / DLL files
97
__pycache__/

src/scipy_dev/presentation/custom.css

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/* @theme custom */
2+
3+
@import 'gaia';
4+
5+
section {
6+
/* Override default background */
7+
background: #faebd7;
8+
}
9+
10+
section.split {
11+
overflow: visible;
12+
display: grid;
13+
grid-template-columns: 500px 500px;
14+
grid-template-rows: 100px auto;
15+
grid-template-areas:
16+
"slideheading slideheading"
17+
"leftpanel rightpanel";
18+
}
19+
section.split h3 {
20+
grid-area: slideheading;
21+
font-size: 50px;
22+
}
23+
section.split .leftcol { grid-area: leftpanel; }
24+
section.split .rightcol { grid-area: rightpanel; }

src/scipy_dev/presentation/main.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
paginate: true
3+
marp: true
4+
theme: custom
5+
---
6+
7+
<!-- _footer: IZA and IFS, University of Bonn -->
8+
<!-- paginate: false -->
9+
## Practical Numerical Optimization with Estimagic, JaxOpt, Scipy
10+
11+
Scipy Conference 2022
12+
13+
<br/>
14+
15+
#### Janos Gabler & Tim Mensinger
16+
17+
---
18+
<!-- paginate: true -->
19+
## Index
20+
21+
1. Introduction
22+
2. References
23+
24+
25+
---
26+
<!-- paginate: false -->
27+
<!-- _class: lead -->
28+
# Introduction
29+
30+
---
31+
<!-- paginate: true -->
32+
### A slide with page numbers
33+
34+
---
35+
### A two-column slide
36+
<!-- _class: split -->
37+
38+
<div class=leftcol>
39+
40+
#### Title left column
41+
- listed item
42+
- listed item
43+
- listed item
44+
45+
</div>
46+
47+
<div class=rightcol>
48+
49+
#### Title right column
50+
51+
```python
52+
def f(x):
53+
return x ** 2
54+
55+
g = converter.wrap(f, kwargs, key="value")
56+
```
57+
58+
</div>
59+
60+
---
61+
### References
62+
63+
- JAX Opt
64+
- scipy.optimize
+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import pytask
2+
import subprocess
3+
4+
from scipy_dev.config import BLD
5+
from scipy_dev.config import SRC
6+
7+
8+
CSS_PATH = SRC.joinpath("presentation", "custom.css").resolve()
9+
10+
11+
main_files = ["main"]
12+
13+
for file in main_files:
14+
15+
for output_format in ["pdf", "html"]:
16+
17+
kwargs = {
18+
"depends_on": SRC.joinpath("presentation", f"{file}.md"),
19+
"produces": BLD.joinpath("public", "presentation", f"{file}.{output_format}"),
20+
}
21+
22+
@pytask.mark.task(id=f"{file}-{output_format}", kwargs=kwargs)
23+
def task_render_presentation(depends_on, produces):
24+
25+
commands = [
26+
"marp", # executable
27+
"--html", # allows html code in markdown files
28+
"--theme-set", str(CSS_PATH), # use custom css file
29+
"--output", str(produces), # output file
30+
# meta data
31+
"--title", "Scipy 2022: Estimagic Tutorial",
32+
"--author", "Janos Gabler and Tim Mensinger",
33+
]
34+
35+
if "pdf" in produces.suffix:
36+
commands.append("--pdf")
37+
38+
commands += ["--", depends_on] # source file
39+
40+
subprocess.call(commands)

0 commit comments

Comments
 (0)