-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.qmd
49 lines (40 loc) · 918 Bytes
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
format:
gfm: default
execute:
echo: false
engine: knitr
---
# severe-CDI
```{python paper_meta}
#| output: asis
import yaml
is_yaml = False
yaml_lines = list()
with open('paper/paper.qmd', 'r') as infile:
for line in infile:
if line.startswith('---'):
is_yaml = not is_yaml
elif is_yaml:
yaml_lines.append(line)
yaml_dict = yaml.load(''.join(yaml_lines), Loader = yaml.CLoader)
print('####', ''.join(yaml_dict['title']))
print('\n')
print(', '.join(auth['name'] for auth in yaml_dict['author']))
```
## Abstract
```{python abstract}
#| output: asis
print(yaml_dict['abstract'])
```
## Manuscript
- [Quarto](paper/paper.qmd)
- [PDF](paper/paper.pdf)
- [Markdown](paper/paper-gfm.md)
### Word count
```{python word_count}
#| output: asis
with open('paper/word_count.txt', 'r') as infile:
for line in infile:
print('-', line.strip(), end = '\n')
```