Files
nicholaswilde_recipes/Taskfile.yaml

248 lines
6.9 KiB
YAML

---
version: '3'
vars:
VER: 2.5
ROOT_DIR:
sh: git rev-parse --show-toplevel
PORT: 8000
tasks:
build:
desc: Build the static site
cmds:
- uv run zensical build
docs:deps:
desc: Install Zensical
cmds:
- uv pip install zensical
docs:check:
desc: Check Zensical version
cmds:
- uv pip show zensical
docs:update:
desc: Update Zensical
cmds:
- uv pip install --upgrade zensical
glite:
desc: Run Gemini with the gemini-2.5-flash-lite model.
cmds:
- gemini -m gemini-{{ .VER }}-flash-lite
gpro:
desc: 'Run Gemini with the gemini-{{ .VER }}-pro model.'
cmds:
- gemini -m gemini-{{ .VER }}-pro
gflash:
desc: Run Gemini with the gemini-2.5-flash model.
cmds:
- gemini -m gemini-{{ .VER }}-flash
add-lazy-loading:
desc: Add lazy image loading
dir: '{{.USER_WORKING_DIR}}'
cmds:
- >-
sed -i 's/\(\!\[.*\)/\1\{ loading=lazy \}/' {{ .CLI_ARGS }}
add-comments:
desc: Add a front matter tag
cmds:
- yq --front-matter="process" '.comments = "true"' {{ .CLI_ARGS }}
add-tag:
desc: Add a front matter tag
cmds:
- yq -i --front-matter="process" '.tags += ["{{ (split " " .CLI_ARGS)._0 }}"]' {{ (split " " .CLI_ARGS)._1 }}
clean:
desc: Clean markdown files from cook dir
cmds:
- find cook -name "*.md" -delete
deps:
desc: Install dependencies
cmds:
- brew install typos-cli
linkcheck:
desc: Check for dead links using lychee
cmds:
- lychee docs/
linkcheck-offline:
desc: Check for dead local links and images using lychee (offline)
cmds:
- lychee --offline docs/
linkcheck-file:
desc: Link check a given file using lychee
cmds:
- lychee {{shellQuote .FILE}}
lint:
desc: Lint the project
cmds:
- task: markdownlint
- task: yamllint
- task: shuck
lint-changed:
desc: Lint only modified/changed files (saves tokens)
cmds:
- uv run python3 scripts/lint-changed.py
git-summary:
desc: Show a token-efficient summary of git workspace status and changes
cmds:
- uv run python3 scripts/git-summary.py
shuck:
desc: Run shuck shell linter
cmds:
- shuck check scripts/
list-ingredients:
desc: List all ingredients in all cook recipes and copy to clipboard.
cmds:
- ./scripts/list-ingredients.sh
markdownlint:
desc: Run markdownlint-cli
cmds:
- rumdl check .
markdownlint-fix:
desc: Run markdownlint-cli fix
cmds:
- rumdl check --fix .
serve:
desc: Serve a local zensical server
cmds:
- uv run zensical serve
server:
desc: Serve a cook server
cmds:
- cook server
silent: true
emoji:
desc: Show available emoji
cmds:
- yq '.emoji' includes/emoji.yaml
emoji-ing:
desc: Show available ingredients emoji
cmds:
- yq '.emoji.ingredients' includes/emoji.yaml
emoji-cw:
desc: Show available cookware emoji
cmds:
- yq '.emoji.cookware' includes/emoji.yaml
emoji-search:
desc: Search for emoji
cmds:
- yq '.emoji.ingredients[]|pick(["{{ .SHORTCODE }}"])|select(length>0)' includes/emoji.yaml
emoji-sort:
desc: Sort emoji.yaml
cmds:
- yq -i 'sort_keys(.emoji)' includes/emoji.yaml
- yq -i '.emoji.cookware|=sort_by(keys | .[0])' includes/emoji.yaml
- yq -i '.emoji.ingredients|=sort_by(keys | .[0])' includes/emoji.yaml
- yq includes/emoji.yaml
sort:
desc: Sort dictionary.txt
cmds:
- sort {{ .ROOT_DIR }}/dictionary.txt -u -o {{ .ROOT_DIR }}/dictionary.txt
spellcheck:
desc: Spellcheck cook files
cmds:
- uv run scripts/generate_typos_config.py
- typos
spellcheck-file:
desc: Spellcheck a single file
cmds:
- uv run scripts/generate_typos_config.py
- typos {{shellQuote .FILE}}
commit:
desc: Commit new cook files, FILES.
cmds:
- cmd: ./scripts/commit.sh {{shellQuote .FILES }}
ignore_error: true
yamllint:
desc: Run yamllint
cmds:
- yamllint-rs .
move:
desc: Move recipes markdown file and image, FILES.
cmds:
- ./scripts/move.sh {{shellQuote .FILES }}
hyperlink-ingredient:
desc: Hyperlink an ingredient in a recipe markdown file
cmds:
- >-
uv run python3 scripts/hyperlink-ingredient.py
--target {{shellQuote .TARGET}}
--ingredient {{shellQuote .INGREDIENT}}
hyperlink-ingredient-global:
desc: Hyperlink an ingredient globally in all recipe markdown files
cmds:
- >-
uv run python3 scripts/hyperlink-ingredient-global.py
--ingredient {{shellQuote .INGREDIENT}}
deg:
desc: Replace temperatures with degree symbols
cmds:
- >-
sed -E -i -e 's/([[:digit:]]+)F/\1°F/'
-e 's/ degrees F/°F/'
-e 's/ degrees/°F/'
-e 's/([[:digit:]]+)[[:space:]]F/\1°F/' {{shellQuote .FILE }}
validate:
desc: Validate zensical.toml
cmds:
- uv run python -c "import tomllib, sys; tomllib.load(open('zensical.toml', 'rb'))"
preconditions:
- test: test -n "$(uv run python -c 'import tomllib' 2>/dev/null && echo 'found')"
msg: |
tomllib not found. Please install a Python version that includes tomllib (Python 3.11+).
silent: true
encrypt:
desc: Encrypt mcp_config.json and settings.json files using sops
cmds:
- |
if [ -f .agents/mcp_config.json ]; then
sops --encrypt --input-type json --output-type json \
--output .agents/mcp_config.json.enc .agents/mcp_config.json
elif [ -f mcp_config.json ]; then
sops --encrypt --input-type json --output-type json --output mcp_config.json.enc mcp_config.json
fi
- |
if [ -f .agents/settings.json ]; then
sops --encrypt --input-type json --output-type json --output .agents/settings.json.enc .agents/settings.json
elif [ -f settings.json ]; then
sops --encrypt --input-type json --output-type json --output settings.json.enc settings.json
fi
decrypt:
desc: Decrypt mcp_config.json.enc and settings.json.enc files using sops
cmds:
- |
if [ -f .agents/mcp_config.json.enc ]; then
sops --decrypt --input-type json --output-type json \
--output .agents/mcp_config.json .agents/mcp_config.json.enc
elif [ -f mcp_config.json.enc ]; then
sops --decrypt --input-type json --output-type json --output mcp_config.json mcp_config.json.enc
fi
- |
if [ -f .agents/settings.json.enc ]; then
sops --decrypt --input-type json --output-type json --output .agents/settings.json .agents/settings.json.enc
elif [ -f settings.json.enc ]; then
sops --decrypt --input-type json --output-type json --output settings.json settings.json.enc
fi
default:
cmds:
- task -a
silent: true