Skip to content
Snippets Groups Projects
Commit eca60d8f authored by Florian Ziemen's avatar Florian Ziemen
Browse files

Merge branch 'project' into 'main'

set up as quarto project

See merge request !6
parents 5eb63b3b 3618766f
No related branches found
No related tags found
1 merge request!6set up as quarto project
Pipeline #61959 passed
......@@ -2,4 +2,6 @@
index.html
index_files/
.jupyter_cache
public/
\ No newline at end of file
public/
/.quarto/
/summary.qmd
project:
type: website
pre-render: scripts/prepare.py
output-dir: public
website:
title: "Generic Software Skills"
navbar:
left:
- href: index.qmd
text: Home
- summary.qmd
sidebar:
search: true
contents:
- section: "Lectures"
contents: "lectures/*/index.qmd"
format:
html:
theme: cosmo
css: styles.css
toc: true
---
title: "Generic Software Skills"
---
format:
revealjs:
transition: slide
slide-number: true
code-background: true
logo: ../../static/logos.png
footer: "Generic software Skills"
theme: [default, custom.scss]
chalkboard:
buttons: true
navigation-mode: linear
auto-stretch: true
center: true
mermaid:
theme: default
jupyter: python3
execute:
cache: true
File moved
---
title: "Example lecture"
author: "Tobias Kölling, Florian Ziemen, and the teams at MPI-M and DKRZ"
format:
revealjs:
transition: slide
slide-number: true
code-background: true
logo: static/logos.png
footer: "Generic software Skills"
theme: [default, custom.scss]
chalkboard:
buttons: true
navigation-mode: linear
auto-stretch: true
center: true
mermaid:
theme: default
jupyter: python3
execute:
cache: true
---
# Preface
......
#!/bin/bash
for filename in */index.qmd ; do
folder=$(dirname "${filename}")
quarto render "${filename}"
outdir=public/"${folder}"
mkdir -p "${outdir}"
cp "${filename/.qmd/.html}" "${outdir}"
cp -R ${filename/.qmd/}_files "${outdir}"
cp -R ${folder}/static ${outdir}/
done
quarto render
import glob
import logging
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
# But you can use your content.
def parse_file(filename):
logging.debug(f'opening {filename}')
with open(filename) as f:
lines = f.readlines()
titles = [ f"# {x[6:].strip()[1:-1]}\n" for x in lines if x.startswith("title:")]
entries = titles + [ f"#{x}" for x in lines if x[0] == "#" ]
entries = [ f'* {x[4:]}' if x[:4]=="###" else x for x in entries ]
return entries
summery_header = """---
title: "Lecture Overview"
---
"""
def generate_summary():
files = glob.glob("lectures/*/index.qmd")
all_entries = [ ]
for x in files:
all_entries.extend(parse_file(x))
with open("summary.qmd", "w") as outfile:
outfile.write(summery_header)
outfile.writelines(all_entries)
def main():
generate_summary()
if __name__ == "__main__":
exit(main())
File moved
/* css styles */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment