Using Quartz
- Start a local web server to run Quartz
npx quartz build --serveLaTeX
- Block math can be rendered by delimiting math expression with $$
$$
f(x) = \int_{-\infty}^\infty
f\hat(\xi),e^{2 \pi i \xi x}
\,d\xi
$$- Inline math can be rendered by delimiting math expressions with
$...$
NLP Submodule
- Set up submodule to track a branch
- always track latest commit on
masterbranch
- always track latest commit on
- Update submodule configuration https://stackoverflow.com/questions/1777854/how-can-i-specify-a-branch-tag-when-adding-a-git-submodule/18799234#18799234
https://stackoverflow.com/questions/9189575/git-submodule-tracking-latest
[submodule "content/Natural Language Processing/CS_7650_Natural_Language_Processing"]
path = content/Natural Language Processing/CS_7650_Natural_Language_Processing
url = https://github.com/chxtio/CS_7650_Natural_Language_Processing
branch = master- Ensure the submodule is on the correct branch and is tracking the remote branch.
cd /path/to/your/submodule
git checkout master
git branch -u origin/master-Update the parent repository to record the new state of the submodule.
cd /path/to/your/parent/repo
git add path/to/your/submodule
git commit -m "Update submodule to track latest master branch"- Subsequent update for that submodule will have to use the —remote option:
# --remote will also fetch and ensure that
# the latest commit from the branch is used
git submodule update --remoteGit Hooks
Git hooks are scripts placed in the .git/hooks directory of your repository and are executed automatically by Git at specific points (e.g., before a commit, after a commit, etc.). The script in .git/hooks must be executable and follow Git’s naming conventions for hooks, such as post-commit, pre-commit
- create a post-commit hook for Git that runs
npx quartz syncafter every commit- Create
./git/hooks/post-commitfile with the script:
- Create
#!/bin/sh
# Run quartz sync after commit
echo "Running npx quartz sync..."
npx quartz syncUpdating the submodule
- Automatically update the submodule, stage changes, commit, and push every time you make a commit in your parent repository
- Create
update_nlp_submodule.sh:
- Create
#!/bin/sh
# Change to the submodule directory
echo "Navigating to submodule directory..."
cd content/Natural\ Language\ Processing/CS_7650_Natural_Language_Processing/ || { echo "Failed to navigate to submodule directory"; exit 1; }
# Pull the latest changes from the submodule repository
echo "Pulling latest changes for submodule..."
git pull || { echo "Failed to pull changes from submodule"; exit 1; }
# Navigate back to the root directory
echo "Navigating back to the root directory..."
cd ../../.. || { echo "Failed to navigate back to root directory"; exit 1; }
# Stage all changes
echo "Staging changes..."
git add . || { echo "Failed to stage changes"; exit 1; }
# Commit the changes
echo "Committing changes..."
# read -p "Enter commit message: " commit_message
commit_message="Automated update of NLP submodule"
git commit -m "$commit_message" || { echo "Failed to commit changes"; exit 1; }
git push || { echo "Failed to push changes"; exit 1; }
echo "Submodule updated, changes committed, and pushed successfully."
# Usage: chmod +x update_nlp_submodule.sh
# ./update-submodule.sh
# Note: git push triggers a webhook for running npx quartz sync in .git/hooks/post-commit



