File size: 481 Bytes
5760099
 
 
 
 
629450c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
---
toc-location: right-body
toc-title: Table Of Contents
toc-expand: 2
---

```{python}
#|output: asis
#|echo: false

# This cell steals the README as the home page for now, but excludes the table of contents (quarto adds its own)
import re
pattern = re.compile(
    r"<table>\s*<tr>\s*<td>\s*## Table of Contents.*?</td>\s*</tr>\s*</table>",
    re.DOTALL | re.IGNORECASE
)

with open('README.md', 'r') as f:
    txt = f.read()

cleaned = pattern.sub("", txt)
print(cleaned)
```