mirror of
https://github.com/nicholaswilde/recipes.git
synced 2026-02-04 16:35:27 +00:00
- Convert 'Applied Homemade Vegetarian Gravy' to Markdown - Add ingredient emojis to the gravy recipe - Update zensical.toml with new recipe mapping - Update AGENTS.md with instructions for missing emojis - Add 'celery' and 'stew' categories to includes/emoji.yaml
5.7 KiB
5.7 KiB
Project Overview
This project is a personal recipe collection managed as a documentation site using Zensical. Recipes are primarily written in a custom .cook format and then converted to Markdown (.md) files, which are then served by Zensical. The site is deployed to GitHub Pages. The project uses various tools for linting, spellchecking, and link checking to maintain quality.
Main Technologies
- Zensical: Static site generator for documentation.
- Zensical Material Theme: Provides the visual theme for the documentation site.
- Taskfile: A task runner for automating development and deployment workflows.
- Docker: Used to containerize various development tools and the server.
- Cooklang: A plain text format for writing recipes, indicated by
.cookfiles and thecook servercommand. - Python: Used for Zensical and its plugins.
- Git: Version control system.
- GitHub Actions: For continuous integration and deployment to GitHub Pages.
- Pre-commit hooks: For enforcing code quality and formatting before commits.
Building and Running
- Build Docker image:
task build - Start local development server (Docker):
task serve(access athttp://0.0.0.0:8000) - Start local development server (local Zensical install):
task serve-local - Start Cooklang server:
task server - Deploy to GitHub Pages: The GitHub Actions workflow
ci.yamlautomatically deploys the docs on pushes tomainbranch (pathsdocs/**,mkdocs.**). Manually, this would involvezensical gh-deploy --forceafter installing dependencies.
Development Conventions
- Pre-commit hooks:
trailing-whitespace: Removes trailing whitespace.end-of-file-fixer: Ensures files end with a newline.mixed-line-ending: Standardizes line endings.markdownlint: Lints Markdown files for style and consistency.markdown-link-check: Checks for broken links in Markdown files.
- Linting:
task lint: Runsmarkdownlintandyamllint.task markdownlint: Runsmarkdownlint-cli.task yamllint: Runsyamllint.
- Spellchecking:
task spellcheck(usesspellchecker-cliwithdictionary.txt). - Link Checking:
task linkcheck(usesmarkdown-link-check). - Recipe Management: Recipes are stored in
cook/as.cookfiles and must be organized by category in subdirectories (e.g.,cook/breakfast/,cook/desserts/). There are scripts to manage these, such asscripts/commit.shandscripts/move.sh. - Markdown Formatting: Specific formatting for images (
add-lazy-loading) and temperatures (deg) is applied usingsed. - Front Matter: Markdown files use front matter for metadata like comments and tags.
- Dependencies: Python dependencies for Zensical are managed via
pip installin the CI workflow.spellchecker-cliis installed globally vianpm install. - Recipe Markdown Pages: Recipe markdown pages in
docs/should use emoji fromincludes/emoji.yaml. - Recipe Markdown Format: Recipe markdown pages should follow a consistent format, including front matter for metadata (e.g., comments, tags), a main title with an emoji, an image with
loading=lazy, a table for serving and time information, and sections for ingredients, cookware, and instructions. Each ingredient in the ingredients section should be prefixed with an emoji shortcode fromincludes/emoji.yaml. Instructions should be numbered steps, with!!! tipused for additional information.
Recipe Import Process
- Create the
.cookfile: Follow the specification in the Cooklang Specification section. - Add the Image: Download an image from the source, name it the same as the cook file (e.g.,
Recipe Name.jpg), and place it in the same directory as the.cookfile. - Run the Move Task: Execute
FILES=<path/to/cookfile> task move. This converts the.cookfile to Markdown and runs spellcheck and link check. - Update
zensical.toml: Add the recipe mapping (e.g.,{ "Recipe Name" = "category/recipe-name.md" },) to the correct section inzensical.toml. - Add Ingredient Emojis: Update the generated Markdown file by adding emoji shortcodes to each item in the ingredients section (referencing
includes/emoji.yaml). If an ingredient is missing fromincludes/emoji.yaml, use your best judgement to pick one and updateincludes/emoji.yamlwith the new mapping. Ensure that the selected emoji is compatible with mkdocs-material.
Cooklang Specification
Recipes in this project are written using the Cooklang specification. Here is a quick reference for creating .cook files:
- Metadata: Defined at the top of the file using
>> key: value. Common keys includesource,serves,total time,time required,image, andtags.>> source: https://example.com/recipe >> serves: 4 >> total time: 30 minutes - Ingredients: Use
@followed by the ingredient name. If there is a quantity, use{}.- Simple:
@salt{} - With quantity:
@water{1%cup} - With quantity (no unit):
@eggs{2} - Multi-word ingredient:
@ground beef{1%lb}
- Simple:
- Cookware: Use
#followed by the cookware name.- Simple:
#pan{} - Multi-word:
#frying pan{}
- Simple:
- Timer: Use
~followed by the duration in{}.- Example:
~{25%minutes}
- Example:
- Comments: Use
[-and-]for block comments or--for line comments.- Example:
[- This is a comment -]
- Example:
- Steps: Write instructions as natural text. Ingredients, cookware, and timers are embedded directly within the sentences.