Skip to content

Commit 071d69b

Browse files
committed
workflow new
1 parent d6197b3 commit 071d69b

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Convert and Publish Notebooks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
convert-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/[email protected]
15+
16+
- name: Set up Python
17+
uses: actions/[email protected]
18+
with:
19+
python-version: '3.11'
20+
21+
- name: Install Jupyter and Quarto
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install jupyter nbconvert quarto-cli
25+
26+
- name: Convert Notebooks to QMD
27+
run: |
28+
mkdir -p qmd
29+
for notebook in $(find . -name "*.ipynb"); do
30+
jupyter nbconvert --to markdown --output-dir=qmd "$notebook"
31+
done
32+
33+
- name: Render QMD Files
34+
run: |
35+
for qmd in $(find qmd -name "*.md"); do
36+
quarto render "$qmd" --output-dir rendered
37+
done
38+
39+
- name: Create Markdown Content
40+
run: |
41+
echo "# Portfolio" > rendered/index.md
42+
for rendered_file in $(find rendered -name "*.html"); do
43+
echo "- [$(basename "$rendered_file" .html)]($rendered_file)" >> rendered/index.md
44+
done
45+
46+
- name: Deploy to GitHub Pages
47+
uses: peaceiris/actions-gh-pages@v4
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: ./rendered

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ All the codes are written in an <b>intuitive manner</b> rather than efficient or
2828

2929
The notes were written in JupyterLab, the interative plot requires ```ipympl```. To install, type in ```conda install -c conda-forge ipympl``` if you have JupyterLab 3.x. Check <a href='https://github.com/matplotlib/ipympl'><code>ipympl</code>page</a> for more details.
3030

31+
## Environment Setup
32+
I use poetry to management environment, if you happen to use VS code like me, please follow the steps below:
33+
1. In Windows powershell and install poetry ``` (Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -p```
34+
2. Navigate to ```cd $env:APPDATA\Python\Scripts```, check if poetry being installed.
35+
3. Open a notepad ```notepad $profile``` and set alias for poetry ```Set-Alias poetry "C:\Users\user\AppData\Roaming\Python\Scripts\poetry.exe"``` in notepad, I prefered this way, because sometimes setting env path not working in windows.
36+
4. Reload profile by ```. $profile```.
37+
5. If you are on your personal computer ```Set-ExecutionPolicy RemoteSigned -Scope CurrentUser``` to unstrict your execution policy and choose Y.
38+
6. Resume the default restricted policy for security ```Set-ExecutionPolicy Restricted -Scope CurrentUser```.
39+
7. Now check ```poetry --version```, if you see the version printed, good to go.
40+
8. You choose to use ```poetry update```, or just manage version at your own convenience.
41+
3142
## What to Expect from Notes
3243
These notes will equip you with most needed and basic knowledge for other subjects, such as Data Science, Econometrics, Mathematical Statistics, Financial Engineering, Control Theory and etc., which heavily rely on linear algebra. Please go through the tutorial patiently, you will certainly have a better grasp of the fundamental concepts of linear algebera. Then further step is to study the special matrices and their application with your domain knowledge.
3344

0 commit comments

Comments
 (0)