Using Quartz

  • Start a local web server to run Quartz
npx quartz build --serve

LaTeX

  • 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

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 --remote

Git 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 sync after every commit
    • Create ./git/hooks/post-commit file with the script:
#!/bin/sh
# Run quartz sync after commit
echo "Running npx quartz sync..."
npx quartz sync

Updating 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:
#!/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

Test

https://github.com/chxtio/SlackBot2.0/commits/master/