Updated build system.

This commit is contained in:
Bokuan Li
2026-01-05 20:11:28 -05:00
parent abbed78434
commit a807369ab0
12 changed files with 438 additions and 47 deletions

6
.gitignore vendored
View File

@@ -4,3 +4,9 @@ document/*
*.swp *.swp
tags tags
document.paux document.paux
*.aux
*.bbl
*.blg
*.log
*.out
*.pdf

View File

@@ -6,6 +6,13 @@
"workspace::Save", "workspace::Save",
["task::Spawn", { "task_name": "Build and Serve" }], ["task::Spawn", { "task_name": "Build and Serve" }],
], ],
"ctrl-b": "editor::MoveLeft",
"ctrl-i": [
"editor::InsertSnippet",
{
"snippet": "\\textit{$1}$0",
},
],
}, },
}, },
] ]

View File

@@ -19,5 +19,10 @@
"HTML": { "HTML": {
"format_on_save": "off", "format_on_save": "off",
}, },
"Python": {
"format_on_save": "off",
},
}, },
"soft_wrap": "preferred_line_length",
"preferred_line_length": 80,
} }

View File

@@ -5,4 +5,10 @@
"args": ["bash", "build-serve.sh"], "args": ["bash", "build-serve.sh"],
"cwd": "${ZED_WORKTREE_ROOT}", "cwd": "${ZED_WORKTREE_ROOT}",
}, },
{
"label": "Upload to Server",
"command": "wsl",
"args": ["bash", "upload.sh"],
"cwd": "${ZED_WORKTREE_ROOT}",
},
] ]

131
build.groovy Normal file
View File

@@ -0,0 +1,131 @@
def projectRoot = '/home/gerby/gerby'
def vGPython = "${projectRoot}/gerby-venv/bin/python"
def vGPip = "${projectRoot}/gerby-venv/bin/pip"
def vPPython = "${projectRoot}/plastex-venv/bin/python"
def vPPip = "${projectRoot}/plastex-venv/bin/pip"
def vPlastex = "${projectRoot}/plastex-venv/bin/plastex"
def discordHook = "https://discord.com/api/webhooks/1456391390513856676/yniOv0Gbxp2UwW1pbZcekpXsC8y1dYppGQ90O7He-df24IODggrgXdMFwvz-RMWM15j8"
pipeline {
agent any
stages {
stage('Create Links') {
steps {
dir("${projectRoot}/gerby-website/gerby/tools/") {
sh 'rm ./document || true'
sh 'rm ./document.paux || true'
sh 'rm ./tags || true'
sh 'ln -s ../../../document document'
sh 'ln -s ../../../document.paux document.paux'
sh 'ln -s ../../../tags tags'
}
dir("${projectRoot}/gerby-website/") {
sh 'rm ./hello-world.sqlite || true'
sh 'rm ./comments.sqlite || true'
sh 'ln -s gerby/tools/hello-world.sqlite hello-world.sqlite'
sh 'ln -s gerby/tools/comments.sqlite comments.sqlite'
}
}
}
stage('Bibliography') {
steps {
dir("${projectRoot}/") {
sh 'pdflatex -interaction=nonstopmode document.tex || true'
sh 'bibtex document || true'
sh 'pdflatex -interaction=nonstopmode document.tex || true'
}
}
}
stage('Delete Tags') {
when {
expression { params['Redo Tags'] == true }
}
steps {
dir("${projectRoot}/") {
sh 'rm ./tags || true'
sh 'rm ./gerby-website/gerby/tools/hello-world.sqlite || true'
}
}
}
// The document folder is needed for the website to run, hence it is not cleared at the end of the compile process.
stage('Delete Previous Build') {
steps {
dir("${projectRoot}/") {
sh "rm -r ./document"
}
}
}
stage('Tag') {
steps {
dir("${projectRoot}/") {
sh "${vGPython} tagger.py >> tags"
}
}
}
stage('Plastex') {
steps {
dir("${projectRoot}/") {
sh "${vPlastex} --renderer=Gerby ./document.tex"
}
}
}
stage('Update Database') {
steps {
dir("${projectRoot}/gerby-website/gerby/tools") {
sh "${vGPython} update.py"
}
}
}
}
post {
always {
dir("${projectRoot}/") {
sh 'rm document.aux || true'
sh 'rm document.bbl || true'
sh 'rm document.blg || true'
sh 'rm document.log || true'
sh 'rm document.out || true'
sh 'rm document.pdf || true'
}
script {
def formatTime = { milliseconds ->
long seconds = (long)(milliseconds / 1000)
long mins = (long)(seconds / 60)
long secs = seconds % 60
return mins > 0 ? "${mins}m${secs}s" : "${secs}s"
}
def buildTitle = "Build Website #${env.BUILD_NUMBER}"
if (params['Redo Tags']) {
buildTitle += " (Retag)"
}
def queueTimeMs = currentBuild.startTimeInMillis - currentBuild.timeInMillis
def queueTime = formatTime(queueTimeMs)
def buildTime = formatTime(currentBuild.duration)
def description = """
**Build:** [#${env.BUILD_NUMBER}](${env.BUILD_URL})
**Console:** [Console Output](${env.BUILD_URL}console)
**Queue Time:** ${queueTime}
**Build Duration:** ${buildTime}
**Status:** ${currentBuild.currentResult}
""".trim()
discordSend(
webhookURL: discordHook,
title: buildTitle,
description: description,
result: currentBuild.currentResult
)
}
}
}
}

View File

@@ -1,6 +1,22 @@
rm -r ./document rm -r ./document
# Make the bibliography. Errors here don't matter.
pdflatex -interaction=nonstopmode document.tex > /dev/null 2>&1
bibtex document > /dev/null 2>&1
pdflatex -interaction=nonstopmode document.tex > /dev/null 2>&1
# Website compilation procedure
python3 tagger.py >> tags python3 tagger.py >> tags
plastex --renderer=Gerby ./document.tex plastex --renderer=Gerby ./document.tex
cd ./gerby-website/gerby/tools cd ./gerby-website/gerby/tools
python3 update.py python3 update.py
cd ../../.. cd ../../..
# Clean up the tex compilations.
rm document.aux > /dev/null 2>&1
rm document.bbl > /dev/null 2>&1
rm document.blg > /dev/null 2>&1
rm document.log > /dev/null 2>&1
rm document.out > /dev/null 2>&1
rm document.pdf > /dev/null 2>&1

View File

@@ -2,54 +2,16 @@
\usepackage{amssymb, amsmath, hyperref} \usepackage{amssymb, amsmath, hyperref}
\usepackage{preamble} \usepackage{preamble}
\theoremstyle{plain}
\newtheorem{theorem}[subsection]{Theorem}
\newtheorem{proposition}[subsection]{Proposition}
\newtheorem{lemma}[subsection]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}[subsection]{Definition}
\newtheorem{example}[subsection]{Example}
\newtheorem{exercise}[subsection]{Exercise}
\newtheorem{situation}[subsection]{Situation}
\theoremstyle{remark}
\newtheorem{remark}[subsection]{Remark}
\newtheorem{remarks}[subsection]{Remarks}
\numberwithin{equation}{subsection}
\newcommand{\hi}{gamer}
\begin{document} \begin{document}
\chapter{A first chapter}
\label{chapter:first}
\section{A first section} \input{./src/cat/index.tex}
\label{section:first} \input{./src/topology/index.tex}
\input{./src/fa/index.tex}
\input{./src/measure/index.tex}
\begin{lemma} \bibliographystyle{abbrv} % We choose the "plain" reference style
\label{lemma:pythagoras} \bibliography{refs} % Entries are in the refs.bib file
$a^2=b^2+c^2$
\hi
\end{lemma}
\begin{proof}
greetings fellow gamer
\[\xymatrix{ & Y_1 & \\ X \ar[ru]^{f_1} \ar[r]^{f_3} \ar[rd]_{f_2} & Y_3 \ar[u]_{a_{31}} \ar[d]^{a_{32}} & Y \ar[lu]_{s_1} \ar[l]_{s_3} \ar[ld]^{s_2} \\ & Y_2 & }\]
\end{proof}
\section{A second section}
\label{section:second}
\chapter{A second chapter}
\label{chapter:second}
\section{A third section}
\label{section:third}
\section{A fourth section}
\label{section:fourth}
\end{document} \end{document}

View File

@@ -1,2 +1,235 @@
\newcommand{\hello}{hi} \NeedsTeXFormat{LaTeX2e}
\newcommand{\gaming}{hehe} \ProvidesPackage{jerrylicious}[Jerry's Tex Mess]
\RequirePackage{amsthm,amssymb,amsfonts,amsmath}
\RequirePackage{enumerate}
\RequirePackage{tikz-cd}
% ------------- Block Environmets ---------------
\makeatletter
\theoremstyle{plain}
\newtheorem{theorem}[subsection]{Theorem}
\newtheorem{proposition}[subsection]{Proposition}
\newtheorem{lemma}[subsection]{Lemma}
\theoremstyle{definition}
\newtheorem{definition}[subsection]{Definition}
\newtheorem{example}[subsection]{Example}
% \newtheorem{exercise}[subsection]{Exercise}
% \newtheorem{situation}[subsection]{Situation}
\theoremstyle{remark}
\newtheorem{rem}[subsection]{Remark}
\newtheorem{remark}[subsection]{Remark}
% \newtheorem{remarks}[subsection]{Remarks}
\numberwithin{equation}{subsection}
\makeatother
% ------------- References --------------
\newcommand{\lemmaautorefname}{Lemma}
\newcommand{\lemautorefname}{Lemma}
% ------------------ Shortcuts --------------------------
% All kinds of brackets.
\newcommand{\paren}[1]{\left(#1\right)}
\newcommand{\parens}[1]{\left(#1\right)}
\newcommand{\bracs}[1]{\left\{#1\right\}}
\newcommand{\braks}[1]{\left[#1\right]}
\newcommand{\angles}[1]{\left\langle#1\right\rangle}
\newcommand{\abs}[1]{\left|#1\right|}
\newcommand{\bracsn}[1]{\{{#1}\}}
\newcommand{\anglesn}[1]{\langle {#1} \rangle}
% Probability
\newcommand{\ev}{\mathbb{E}}
\newcommand{\var}[1]{\text{Var}\paren{#1}}
\newcommand{\cov}[1]{\text{Cov}\paren{#1}}
\newcommand{\sig}[1]{\sigma_{#1}^2}
\newcommand{\bp}{\mathbf{P}}
% Complex numbers
\newcommand{\re}[1]{\text{Re}\paren{#1}}
\newcommand{\im}[1]{\text{Im}\paren{#1}}
\newcommand{\sgn}{\text{sgn}}
% Bold stuff for algebra.
\newcommand{\zero}{\mathbf{0}}
\newcommand{\one}{\mathbf{1}}
% Number Systems/Algebraic Structures
\newcommand{\polyfield}[1]{\mathbb{F}[#1]}
\newcommand{\field}{\mathbb{F}}
\newcommand{\nat}{\mathbb{N}}
\newcommand{\natp}{\mathbb{N}^+}
\newcommand{\natz}{\mathbb{N}_0}
\newcommand{\integer}{\mathbb{Z}}
\newcommand{\complex}{\mathbb{C}}
\newcommand{\real}{\mathbb{R}}
\newcommand{\rd}{\real^d}
\newcommand{\realp}{\mathbb{R}_{>0}} % Real positive
\newcommand{\realnn}{\mathbb{R}_{\ge 0}} % Real non-negative
\newcommand{\rational}{\mathbb{Q}}
\newcommand{\quot}[1]{\integer/{#1}\integer}
\newcommand{\polyfields}[1]{F[{#1}_1, \cdots, {#1}_n]}
\newcommand{\polyfieldf}[1]{F({#1}_1, \cdots, {#1}_n)}
\newcommand{\gal}[1]{\text{Gal}\paren{#1}}
\newcommand{\aut}[1]{\text{Aut}\paren{#1}}
\newcommand{\fa}{\mathfrak{a}}
\newcommand{\fb}{\mathfrak{b}}
\newcommand{\fv}{\mathfrak{v}}
% Sequences and Limits
\newcommand{\limv}[1]{\lim_{#1 \to \infty}}
\newcommand{\seq}[1]{\bracs{#1}_{1}^{\infty}}
\newcommand{\limsupd}[1]{\underset{#1}{\ol{\lim}}}
\newcommand{\liminfd}[1]{\underset{#1}{\underline{\lim}}}
\newcommand{\seqi}[1]{\bracs{{#1}_{i}}_{i \in I}}
\newcommand{\seqj}[1]{\bracs{{#1}_{j}}_{j \in J}}
\newcommand{\drarrow}{\searrow}
\newcommand{\downto}{\searrow}
\newcommand{\upto}{\nearrow}
\newcommand{\eps}{\varepsilon}
% Optional upper index argument.
\newcommand{\seqf}[2][n]{\bracs{#2}_{1}^{#1}}
\newcommand{\seqfz}[2][n]{\bracs{#2}_{0}^{#1}}
% Isomorphisms
\newcommand{\isoto}{\tilde{\rightarrow}}
\newcommand{\iso}{\cong}
\newcommand{\modulo}{\text{mod }}
% Algebra properties
\newcommand{\ord}{\text{Ord }}
\newcommand{\orb}[1]{\text{Orb}\paren{#1}}
\newcommand{\stab}[1]{\text{Stab}\paren{#1}}
\newcommand{\rank}{\text{rank }}
\newcommand{\inp}{\angles{\cdot, \cdot}}
\newcommand{\eig}{\text{Eig}}
\newcommand{\proj}{\text{proj}}
\newcommand{\tr}{\text{tr}}
\newcommand{\spec}[1]{\text{Spec}\paren{#1}}
\newcommand{\ba}{\mathbf{A}}
% Dual Pairings & Inner Products
\newcommand{\dpb}[2]{\angles{#1}_{#2}} % Dual Pairing with a specific space. B because it's apparently already defined in tex.
\newcommand{\dpn}[2]{\langle {#1} \rangle_{#2}} % Dual Pairing, without scaling the braces.
\newcommand{\dprd}[1]{\dpb{#1}{\rd}} % R^d dual pairing.
\newcommand{\dprdn}[1]{\dpn{#1}{\rd}} % R^d dual pairing.
\newcommand{\dpd}[1]{\dpb{#1}{\mathcal{D}}} % Distribution dual pairing
\newcommand{\dpdn}[1]{\dpn{#1}{\mathcal{D}}}
\newcommand{\dpe}[1]{\dpb{#1}{E}} % E for Banach.
\newcommand{\dpen}[1]{\dpn{#1}{E}} % E for Banach.
\newcommand{\dph}[1]{\dpb{#1}{H}} % H for Hilbert.
\newcommand{\dphn}[1]{\dpn{#1}{H}} % H for Hilbert.
% Floor and ceiling
\newcommand{\fl}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\cl}[1]{\left\lceil #1 \right\rceil}
% Topology
\newcommand{\topo}{\mathcal{T}}
\newcommand{\inte}{\text{int}}
\newcommand{\exte}{\text{ext}}
\newcommand{\diam}{\text{diam}}
\newcommand{\net}[1]{\angles{{#1}_{\alpha}}_{\alpha \in A}}
\newcommand{\netb}[1]{\angles{{#1}_{\beta}}_{\beta \in B}}
\newcommand{\supp}[1]{\text{supp}\paren{#1}}
\newcommand{\fF}{\mathfrak{F}}
\newcommand{\fS}{\mathfrak{S}}
\newcommand{\fB}{\mathfrak{B}}
\newcommand{\fU}{\mathfrak{U}}
\newcommand{\fV}{\mathfrak{V}}
\newcommand{\fG}{\mathfrak{G}}
\newcommand{\bs}{\mathbf{S}}
% Curly Letters
\newcommand{\alg}{\mathcal{A}}
\newcommand{\agb}[1]{\mathcal{M}\paren{#1}}
\newcommand{\cm}{\mathcal{M}}
\newcommand{\cf}{\mathcal{F}}
\newcommand{\ce}{\mathcal{E}}
\newcommand{\pow}[1]{\mathcal{P}\paren{#1}}
\newcommand{\cb}{\mathcal{B}}
\newcommand{\cn}{\mathcal{N}}
\newcommand{\lms}{\mathcal{L}}
\newcommand{\ch}{\mathcal{H}}
\renewcommand{\cl}{\mathcal{L}}
\newcommand{\cc}{\mathcal{C}}
\newcommand{\ct}{\mathcal{T}}
\newcommand{\cx}{\mathcal{X}}
\newcommand{\cy}{\mathcal{Y}}
\newcommand{\cs}{\mathcal{S}}
\newcommand{\cd}{\mathcal{D}}
\newcommand{\scp}{\mathscr{P}}
% Jokes
\newcommand{\lol}{\boxed{\text{LOL.}}}
\newcommand{\ez}{\boxed{\mathbb{EZ}}}
% Colours
\newcommand{\pblue}[1]{\textcolor[rgb]{0, 0.44, 0.75}{#1}}
\newcommand{\poran}[1]{\textcolor{orange}{#1}}
\newcommand{\pb}[1]{\pblue{#1}}
\newcommand{\po}[1]{\poran{#1}}
\newcommand{\pg}[1]{\textcolor[rgb]{0, 0.69, 0.31}{#1}}
\newcommand{\pp}[1]{\textcolor[rgb]{0.35, 0.25, 0.64}{#1}}
\newcommand{\ps}[1]{\textcolor[rgb]{0.58, 0.25, 0.45}{#1}}
% Formatting
\newcommand{\ol}[1]{\overline{#1}}
\newcommand{\ul}[1]{\underline{#1}}
\newcommand{\wh}[1]{\widehat{#1}}
\newcommand{\td}[1]{\widetilde{#1}}
\newcommand{\norm}[1]{\abs{\abs{#1}}}
\newcommand{\norms}[2]{\abs{\abs{#1}}_{#2}}
\newcommand{\normn}[1]{||{#1}||}
\newcommand{\normns}[2]{||{#1}||_{#1}}
\newcommand{\normrd}[1]{\norms{#1}{\real^d}}
\newcommand{\normrdn}[1]{\normns{#1}{\real^d}}
% for variation
\newcommand{\var}{\text{var}}
% Category Shenanigans
\newcommand{\mf}[1]{\mathfrak{#1}}
\newcommand{\catc}{\mathfrak{C}}
\newcommand{\cata}{\mathfrak{A}}
\newcommand{\obj}[1]{\text{Ob}\paren{#1}}
\newcommand{\mor}[1]{\text{Mor}\paren{#1}}
% Tangent Space Shenanigans
\newcommand{\ppi}{\frac{\partial}{\partial x^i}}
\newcommand{\ppj}{\frac{\partial}{\partial y^j}}
\newcommand{\ppip}{\ppi\bigg\vert_p}
\renewcommand{\part}[2]{\frac{\partial{#1}}{\partial{#2}}}
\newcommand{\vf}{\mathfrak{X}}
\newcommand{\grad}[1]{\text{grad}\paren{#1}}
\newcommand{\Grad}[1]{\text{Grad}\paren{#1}}
\renewcommand{\div}[1]{\text{div}\paren{#1}}
% Random spaces
\newcommand{\laut}[1]{\text{Laut}({#1})}
\newcommand{\loci}{L^1_{\text{loc}}}
\newcommand{\symbi}{L^2_{\text{sym}}}
\newcommand{\met}{\text{Met}}
\newcommand{\ri}{\text{Ri}}
\newcommand{\ind}[1]{\text{ind}\paren{#1}}
\newcommand{\scl}{\mathscr{L}}
\newcommand{\sch}{\mathscr{H}}
\newcommand{\frl}{\mathfrak{L}}
% Real or Complex Numbers
\newcommand{\RC}{\bracs{\real, \complex}}

View File

@@ -54,3 +54,13 @@
year={1993}, year={1993},
publisher={Springer New York} publisher={Springer New York}
} }
@book{Folland,
title={Real Analysis: Modern Techniques and Their Applications},
author={Folland, G.B.},
isbn={9780471317166},
lccn={98037260},
series={Pure and Applied Mathematics: A Wiley Series of Texts, Monographs and Tracts},
url={https://books.google.ca/books?id=N8jVDwAAQBAJ},
year={1999},
publisher={Wiley}
}

View File

@@ -55,7 +55,7 @@ except IndexError:
last = -1 last = -1
filenames = glob.glob("*.tex") filenames = glob.glob("./src/**/*.tex", recursive=True) + ["document.tex"]
# filenames = ["document.tex"] # filenames = ["document.tex"]
# where we should start # where we should start

4
upload-software.sh Normal file
View File

@@ -0,0 +1,4 @@
ssh gerby@178.156.199.217 "rm -r /home/gerby/gerby/gerby-website"
ssh gerby@178.156.199.217 "rm -r /home/gerby/gerby/plastex"
rsync -avz gerby-website plastex gerby@178.156.199.217:/home/gerby/gerby

11
upload.sh Normal file
View File

@@ -0,0 +1,11 @@
ssh gerby@178.156.199.217 "rm /home/gerby/gerby/document.tex"
ssh gerby@178.156.199.217 "rm /home/gerby/gerby/preamble.sty"
ssh gerby@178.156.199.217 "rm -r /home/gerby/gerby/src"
rsync -avz preamble.sty document.tex src gerby@178.156.199.217:/home/gerby/gerby
USER="jerrylicious"
API_TOKEN="1199813d21c0022313bd9e7c8fa98d47b0"
BUILD_TOKEN="AAAAC3NzaC1lZDI1NTE5AAAAIBlYjedLVBgIxxutWbnFm0bgs87jswTfhgOfGaPzzqTZ"
CRUMB=$(curl -s "https://$USER:$API_TOKEN@jenkins.jerrylicious.me/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,\":\" ,//crumb)")
curl -X POST -H "$CRUMB" "https://$USER:$API_TOKEN@jenkins.jerrylicious.me/job/Gerby/job/Build%20Project/buildWithParameters?token=$BUILD_TOKEN&Redo%20Tags=false"