Skip to content

Commit 7ec299b

Browse files
committed
Refactor repo
Move webapp related things to web.
1 parent ae4ca07 commit 7ec299b

File tree

82 files changed

+702
-542
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+702
-542
lines changed

.github/workflows/docker-latex.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,19 @@ jobs:
4747

4848
- name: Build webapp
4949
run: |
50+
cd web
5051
npm i
5152
npm run build
53+
cd ..
5254
5355
- name: Build pdf using docker image
5456
run: |
55-
docker run --rm -v "$(pwd):/home/porter/app" --name maths --user root --hostname latex latex sh ./deploy.sh --parallel --production --dist-dir="dist" --cache-uri="https://maths.nrv.nu/pdf/archive.tar.gz"
57+
docker run --rm -v "$(pwd):/home/porter/app" --name maths --user root --hostname latex latex sh ./deploy.sh --parallel --production --dist-dir="web/dist" --cache-uri="https://maths.nrv.nu/pdf/archive.tar.gz"
5658
5759
- name: Upload site artifact
5860
uses: actions/upload-pages-artifact@v2
5961
with:
60-
path: "dist${{ steps.pages.outputs.base_path }}"
62+
path: "web/dist${{ steps.pages.outputs.base_path }}"
6163

6264
deploy:
6365
environment:

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ build
44
dist
55
dist-ssr
66
node_modules
7-
public/*.tar.gz
8-
public/pdf
7+
web/public/*.tar.gz
8+
web/public/pdf
99

1010
# Images/PDFs
1111
*.pdf

deploy.sh

+18-12
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ EOF
4141
generate_file_index() {
4242
# Add files
4343
printf "" > $registry_path
44-
find ./analys_b | grep .tex >> $registry_path
45-
find ./linjär_algebra | grep .tex >> $registry_path
44+
find ./maths | grep .tex >> $registry_path
45+
find ./dsp | grep .tex >> $registry_path
4646
find ./misc | grep .tex >> $registry_path
4747

4848
# Filter out dependencies from registry database
@@ -182,19 +182,25 @@ postbuild() {
182182
tar -czf archive.tar.gz pdf
183183
cd $root_dir
184184

185-
if [[ $is_production = true ]]; then
186-
if ! [[ -e "$dist_dir" ]]; then
187-
mkdir -p "$dist_dir"
188-
fi
185+
if [[ $is_production = false ]]; then
186+
return
187+
fi
189188

190-
if [[ -e "$dist_dir/pdf" ]]; then
191-
rm -rf "$dist_dir/pdf"
192-
fi
189+
if ! [[ -e "$dist_dir" ]]; then
190+
mkdir -p "$dist_dir"
191+
fi
193192

194-
cp -rf "$build_dir/pdf" "$dist_dir"
195-
cp "$registry_path" "$dist_dir/pdf"
196-
cp "$build_dir/archive.tar.gz" "$dist_dir/pdf"
193+
if [[ -e "$dist_dir/pdf" ]]; then
194+
rm -rf "$dist_dir/pdf"
195+
fi
196+
197+
if [[ -e "web/dist" ]]; then
198+
cp -rf web/dist/* dist
197199
fi
200+
201+
cp -rf "$build_dir/pdf" "$dist_dir"
202+
cp "$registry_path" "$dist_dir/pdf"
203+
cp "$build_dir/archive.tar.gz" "$dist_dir/pdf"
198204
}
199205

200206
parse_args $@

dsp/dsp.tex

+143
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
\documentclass[11pt]{article}
2+
\usepackage[utf8]{inputenc}
3+
\usepackage[T1]{fontenc} % Fix weird character
4+
\usepackage{geometry}
5+
\usepackage{amsmath}
6+
\usepackage{amssymb}
7+
\usepackage{gensymb}
8+
\usepackage{spalign}
9+
\usepackage{xfrac}
10+
\usepackage{parskip}
11+
\usepackage{float} % figure[H]
12+
\usepackage[english]{babel}
13+
\usepackage[style=ieee,backend=biber,urldate=iso,date=iso]{biblatex}
14+
\usepackage[breaklinks=true,bookmarks=true,hidelinks]{hyperref}
15+
\usepackage{tikz}
16+
\usepackage{pgfplots}
17+
\usepackage{circuitikz}
18+
\usepackage{subcaption}
19+
\usepackage[yyyymmdd]{datetime}
20+
\usetikzlibrary {arrows.meta}
21+
\pgfplotsset{compat=newest,compat/show suggested version=false}
22+
23+
% Custom shape
24+
\makeatletter
25+
\pgfdeclareshape{dflowpass}{
26+
\inheritsavedanchors[from=rectangle]
27+
\inheritanchorborder[from=rectangle]
28+
\inheritanchor[from=rectangle]{center}
29+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
30+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
31+
% Add more custom anchors if needed
32+
\backgroundpath{
33+
% Draw the switch shape (rectangle with diagonal lines)
34+
\pgfsetlinewidth{0.85pt}
35+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
36+
\pgfpathmoveto{\pgfpoint{-0.35cm}{0.125cm}}
37+
\pgfpathlineto{\pgfpoint{0.15cm}{0.125cm}}
38+
\pgfpathlineto{\pgfpoint{0.35cm}{-0.2cm}}
39+
\pgfusepath{draw}
40+
}
41+
}
42+
\pgfdeclareshape{dfhighpass}{
43+
\inheritsavedanchors[from=rectangle]
44+
\inheritanchorborder[from=rectangle]
45+
\inheritanchor[from=rectangle]{center}
46+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
47+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
48+
\backgroundpath{
49+
% Draw the switch shape (rectangle with diagonal lines)
50+
\pgfsetlinewidth{1pt}
51+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
52+
\pgfpathmoveto{\pgfpoint{0.35cm}{0.125cm}}
53+
\pgfpathlineto{\pgfpoint{-0.15cm}{0.125cm}}
54+
\pgfpathlineto{\pgfpoint{-0.35cm}{-0.2cm}}
55+
\pgfusepath{draw}
56+
}
57+
}
58+
\pgfdeclareshape{dfbandpass}{
59+
\inheritsavedanchors[from=rectangle]
60+
\inheritanchorborder[from=rectangle]
61+
\inheritanchor[from=rectangle]{center}
62+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
63+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
64+
\backgroundpath{
65+
% Draw the switch shape (rectangle with diagonal lines)
66+
\pgfsetlinewidth{1pt}
67+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
68+
\pgfpathmoveto{\pgfpoint{-0.35cm}{-0.2cm}}
69+
\pgfpathlineto{\pgfpoint{-0.20cm}{0.125cm}}
70+
\pgfpathlineto{\pgfpoint{0.15cm}{0.125cm}}
71+
\pgfpathlineto{\pgfpoint{0.35cm}{-0.2cm}}
72+
\pgfusepath{draw}
73+
}
74+
}
75+
\pgfdeclareshape{quantizer}{
76+
\inheritsavedanchors[from=rectangle]
77+
\inheritanchorborder[from=rectangle]
78+
\inheritanchor[from=rectangle]{center}
79+
\anchor{left}{\pgfpoint{-0.5cm}{0cm}}
80+
\anchor{right}{\pgfpoint{0.5cm}{0cm}}
81+
\backgroundpath{
82+
% Draw the switch shape (rectangle with diagonal lines)
83+
\pgfsetlinewidth{0.8pt}
84+
\pgfpathrectanglecorners{\pgfpoint{-0.5cm}{-0.5cm}}{\pgfpoint{0.5cm}{0.5cm}}
85+
\pgfpathmoveto{\pgfpoint{-0.25cm}{-0.25cm}}
86+
\pgfpathlineto{\pgfpoint{0cm}{-0.25cm}}
87+
\pgfpathlineto{\pgfpoint{0cm}{0.25cm}}
88+
\pgfpathlineto{\pgfpoint{0.25cm}{0.25cm}}
89+
\pgfusepath{draw}
90+
}
91+
}
92+
\pgfdeclareshape{quantamp}{
93+
\inheritsavedanchors[from=op amp]
94+
\inheritanchorborder[from=op amp]
95+
\inheritanchor[from=op amp]{center}
96+
\inheritanchor[from=op amp]{+}
97+
\inheritanchor[from=op amp]{-}
98+
\inheritanchor[from=op amp]{out}
99+
\inheritanchor[from=op amp]{up}
100+
\inheritanchor[from=op amp]{down}
101+
\backgroundpath{
102+
\pgfsetlinewidth{0.8pt}
103+
\pgfpathmoveto{\pgfpoint{-0.5cm}{0.55cm}}
104+
\pgfpathlineto{\pgfpoint{0.5cm}{0}}
105+
\pgfpathlineto{\pgfpoint{-0.5cm}{-0.55cm}}
106+
\pgfpathclose
107+
\pgfpathmoveto{\pgfpoint{-0.35cm}{-0.2cm}}
108+
\pgfpathlineto{\pgfpoint{-0.2cm}{-0.2cm}}
109+
\pgfpathlineto{\pgfpoint{-0.2cm}{0.2cm}}
110+
\pgfpathlineto{\pgfpoint{-0.05cm}{0.2cm}}
111+
\pgfusepath{draw}
112+
}
113+
}
114+
\makeatother
115+
116+
\geometry{
117+
a4paper,
118+
hmargin=2.54cm,
119+
tmargin=1.27cm,
120+
bmargin=1.27cm,
121+
includeheadfoot
122+
}
123+
\setcounter{secnumdepth}{0} % Disable section numbering
124+
125+
\begin{filecontents}{dsp.bib}
126+
@book{mcclellan2015dsp,
127+
title = {DSP First},
128+
author = {James H. McClellan and Ronald W. Schafer and Mark A. Yoder},
129+
year = {2015},
130+
edition = {Second, Global},
131+
publisher = {Pearson},
132+
isbn = {9780136019251}
133+
}
134+
\end{filecontents}
135+
\addbibresource{dsp.bib}
136+
137+
\begin{document}
138+
139+
\section{Digital Signal Processing}
140+
141+
\newpage
142+
\printbibliography
143+
\end{document}
File renamed without changes.

misc/opamp.tex dsp/opamp.tex

File renamed without changes.

misc/pdm.py dsp/pdm.py

File renamed without changes.

misc/pdm.tex dsp/pdm.tex

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

.eslintrc.yml web/.eslintrc.yml

File renamed without changes.

index.html web/index.html

File renamed without changes.

0 commit comments

Comments
 (0)