Skip to content

Commit 4217619

Browse files
committed
Simplify build, revamp slides, add html2pdf
Remove per-course rendering/asset copying and simplify local build.sh output; add ignore for _quarto_internal_scss_error.scss. Disable Quarto execute.freeze (set to false) so code is re-run on render. Major redesign of r-and-rmarkdown/styles/slides.scss: updated palette, typography, layout, code/table/list styles, utilities, animations and dark-mode hooks to modernize the Reveal.js theme. Add tools/html2pdf.py: a Playwright-based CLI to convert Reveal.js HTML slides to PDF.
1 parent 8c5dc7e commit 4217619

6 files changed

Lines changed: 541 additions & 246 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ venv/
4646
*.docx
4747

4848
**/*.quarto_ipynb
49+
_quarto_internal_scss_error.scss

_quarto.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@ format:
5151
toc: true
5252
code-copy: true
5353

54+
execute:
55+
freeze: false
56+
echo: true
57+
5458
lang: zh

build.sh

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/bin/bash
2-
32
# 本地构建脚本
4-
# 模拟GitHub Actions的构建流程
53

64
set -e
75

@@ -15,56 +13,9 @@ rm -rf _site
1513

1614
# 渲染根目录
1715
echo ""
18-
echo "1. 渲染根目录网站..."
16+
echo "渲染网站..."
1917
quarto render
2018

21-
# 渲染各个课程
22-
echo ""
23-
echo "2. 渲染课程..."
24-
for course in r-and-rmarkdown; do
25-
if [ -d "$course" ] && [ -f "$course/_quarto.yml" ]; then
26-
echo " 构建课程: $course"
27-
cd "$course"
28-
quarto render
29-
cd ..
30-
fi
31-
done
32-
33-
# 组织构建输出
34-
echo ""
35-
echo "3. 组织构建输出..."
36-
mkdir -p _site
37-
38-
# 复制根目录文件
39-
if [ -f "index.html" ]; then
40-
cp index.html _site/
41-
fi
42-
43-
for file in license.html resources.html syllabus.html learning-resources.html robots.txt sitemap.xml search.json; do
44-
if [ -f "$file" ]; then
45-
cp "$file" _site/
46-
fi
47-
done
48-
49-
# 复制资源目录
50-
for dir in site_libs styles logo; do
51-
if [ -d "$dir" ]; then
52-
cp -r "$dir" _site/
53-
fi
54-
done
55-
56-
# 复制课程
57-
for course in r-and-rmarkdown; do
58-
if [ -d "$course/_site" ]; then
59-
echo " 复制课程: $course"
60-
mkdir -p "_site/$course"
61-
cp -r "$course/_site"/* "_site/$course/"
62-
if [ -f "logo/csu_logo.png" ]; then
63-
cp "logo/csu_logo.png" "_site/$course/"
64-
fi
65-
fi
66-
done
67-
6819
echo ""
6920
echo "=========================================="
7021
echo "构建完成!"

r-and-rmarkdown/_quarto.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ format:
132132
link-external-newwindow: true
133133

134134
execute:
135-
freeze: auto
135+
freeze: false
136136
echo: true
137137

138138
bibliography: references.bib

0 commit comments

Comments
 (0)