Skip to content

Commit 41b65c5

Browse files
committed
work flow to convert ipynb to qmd
1 parent 037b182 commit 41b65c5

File tree

4 files changed

+118
-54
lines changed

4 files changed

+118
-54
lines changed

.github/workflows/convert-to-qmd.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Convert Notebooks and Update Book
2+
3+
on:
4+
push:
5+
paths:
6+
- 'notebooks/**.ipynb'
7+
8+
jobs:
9+
convert-and-copy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout the Linear_Algebra_with_Python repository
14+
uses: actions/[email protected]
15+
16+
- name: Install Quarto
17+
run: |
18+
wget https://github.com/quarto-dev/quarto-cli/releases/download/v1.5.56/quarto-1.5.56-linux-amd64.tar.gz
19+
tar -xvzf quarto-1.5.56-linux-amd64.tar.gz
20+
sudo cp -r quarto-1.5.56/* /usr/local/
21+
22+
- name: Convert Notebooks to QMD
23+
run: |
24+
mkdir -p converted_chapters
25+
for notebook in notebooks/*.ipynb; do
26+
quarto convert "$notebook" --to qmd -o "converted_chapters/$(basename "$notebook" .ipynb).qmd"
27+
done
28+
29+
- name: Checkout the weijie-chen.github.io repository
30+
uses: actions/[email protected]
31+
with:
32+
repository: weijie-chen/weijie-chen.github.io
33+
path: book_repo
34+
35+
- name: Copy Converted QMD Files to Book Repository
36+
run: |
37+
mkdir -p book_repo/linear-algebra-with-python-book/chapters
38+
cp converted_chapters/*.qmd book_repo/linear-algebra-with-python-book/chapters/
39+
40+
- name: Update Table of Contents in index.html
41+
run: |
42+
toc=""
43+
for chapter in book_repo/linear-algebra-with-python-book/chapters/*.qmd; do
44+
chapter_name=$(basename "$chapter" .qmd)
45+
toc="$toc<li>$chapter_name</li>\n"
46+
done
47+
sed -i '/<section class="table-of-contents">/,/<\/section>/{//!d}' book_repo/linear-algebra-with-python-book/index.html
48+
sed -i "/<section class=\"table-of-contents\">/a $toc" book_repo/linear-algebra-with-python-book/index.html
49+
50+
- name: Commit and Push Changes
51+
run: |
52+
cd book_repo
53+
git config user.name "GitHub Actions"
54+
git config user.email "[email protected]"
55+
git add linear-algebra-with-python-book/chapters/*
56+
git add linear-algebra-with-python-book/index.html
57+
git commit -m "Updated chapters and Table of Contents"
58+
git push

index.html

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -131,42 +131,42 @@ <h1 style="margin-top: -40px;">
131131
<hr>
132132

133133
<main>
134-
<article>
135-
136-
<!-- <div class="language-link">
137-
<a href="es.html">- Español -</a>
138-
</div> -->
139-
140-
<p> <i>Linear Algebra with Python</i> is designed to
141-
provide a comprehensive
142-
refresher on the essential concepts of linear
143-
algebra, tailored for professionals and students in
144-
fields such as statistics, econometrics,
145-
quantitative analysis, and data science. Whether
146-
you're a seasoned expert or someone looking to
147-
solidify your foundational knowledge, this guide
148-
offers an in-depth exploration of critical topics in
149-
linear algebra, enriched with Python-based
150-
computation and visualization.</p>
151-
152-
<p>Throughout this book, we will delve into key concepts
153-
that are pivotal for advanced quantitative skill
154-
sets, including linear combinations, vector spaces,
155-
linear transformations, eigenvalues and
156-
eigenvectors, diagonalization, singular value
157-
decomposition, and more. Each concept is carefully
158-
explained and demonstrated with Python, making
159-
abstract ideas more concrete and applicable to
160-
real-world scenarios.</p>
161-
162-
<p>Ready to get started? Skip ahead to the <a
163-
href="content/table_of_contents.html">Table of
164-
Contents.</a>
165-
</p>
134+
<article>
135+
136+
<!-- <div class="language-link">
137+
<a href="es.html">- Español -</a>
138+
</div> -->
139+
140+
<p> <i>Linear Algebra with Python</i> is designed to
141+
provide a comprehensive
142+
refresher on the essential concepts of linear
143+
algebra, tailored for professionals and students in
144+
fields such as statistics, econometrics,
145+
quantitative analysis, and data science. Whether
146+
you're a seasoned expert or someone looking to
147+
solidify your foundational knowledge, this guide
148+
offers an in-depth exploration of critical topics in
149+
linear algebra, enriched with Python-based
150+
computation and visualization.</p>
151+
152+
<p>Throughout this book, we will delve into key concepts
153+
that are pivotal for advanced quantitative skill
154+
sets, including linear combinations, vector spaces,
155+
linear transformations, eigenvalues and
156+
eigenvectors, diagonalization, singular value
157+
decomposition, and more. Each concept is carefully
158+
explained and demonstrated with Python, making
159+
abstract ideas more concrete and applicable to
160+
real-world scenarios.</p>
161+
162+
<p>Ready to get started? Skip ahead to the <a
163+
href="content/table_of_contents.html">Table of
164+
Contents.</a>
165+
</p>
166166

167-
<hr>
167+
<hr>
168168

169-
<h2 style="text-align: center;">WHAT IT IS ABOUT</h2>
169+
<h2 style="text-align: center;">WHAT IT IS ABOUT</h2>
170170

171171
<div
172172
style=" text-wrap: wrap; display: flex; justify-content: center;">

linear-algebra-with-python-book/css/styles.css

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ body {
9090
cursor: pointer;
9191
}
9292

93-
/* Article styling */
93+
/* introduction */
9494
.introduction {
9595
display: flex;
9696
flex-direction: column;
@@ -99,9 +99,7 @@ body {
9999
color: var(--text-color);
100100
background-color: var(--second-bg-color);
101101
border-radius: 10px;
102-
}
103-
104-
/* Smooth transition for fixed elements */
105-
#book-cover {
106-
transition: top 0.5s ease-in-out;
107-
}
102+
margin: 20px auto 0 auto; /* Center the section horizontally */
103+
max-width: 900px; /* Limit the width of the section */
104+
line-height: 1.6;
105+
}

linear-algebra-with-python-book/index.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ <h2>Weijie Chen</h2>
2929
</section>
3030

3131
<section class="introduction">
32-
33-
<!-- <div class="language-link">
34-
<a href="es.html">- Español -</a>
35-
</div> -->
36-
32+
<h2>INTRODUCTION</h2>
33+
<br>
34+
<br>
3735
<p> <i>Linear Algebra with Python</i> is designed to
3836
provide a comprehensive
3937
refresher on the essential concepts of linear
@@ -45,7 +43,7 @@ <h2>Weijie Chen</h2>
4543
offers an in-depth exploration of critical topics in
4644
linear algebra, enriched with Python-based
4745
computation and visualization.</p>
48-
46+
<br>
4947
<p>Throughout this book, we will delve into key concepts
5048
that are pivotal for advanced quantitative skill
5149
sets, including linear combinations, vector spaces,
@@ -56,14 +54,24 @@ <h2>Weijie Chen</h2>
5654
abstract ideas more concrete and applicable to
5755
real-world scenarios.</p>
5856

59-
<p>Ready to get started? Skip ahead to the <a
60-
href="content/table_of_contents.html">Table of
61-
Contents.</a>
62-
</p>
63-
6457
<hr>
65-
</section>
66-
<h2 style="text-align: center;">WHAT IT IS ABOUT</h2>
58+
</section>
59+
<section class="table-of-contents">
60+
<h2>TABLE OF CONTENTS</h2>
61+
<br>
62+
<br>
63+
<!-- <ul>
64+
<li>Chapter 1: Introduction to Linear Algebra</li>
65+
<li>Chapter 2: Linear Combinations and Span</li>
66+
<li>Chapter 3: Vector Spaces</li>
67+
<li>Chapter 4: Linear Transformations</li>
68+
<li>Chapter 5: Eigenvalues and Eigenvectors</li>
69+
<li>Chapter 6: Diagonalization</li>
70+
<li>Chapter 7: Singular Value Decomposition</li>
71+
<li>Chapter 8: Applications of Linear Algebra</li>
72+
</ul> -->
73+
<hr>
74+
</section>
6775

6876

6977

0 commit comments

Comments
 (0)