Skip to content

⚙ Development

😃 Emoji

Emoji are manually added to the front of ingredients and cookware to give the pages a little bit of flare. My hopes is that eventually this can be added to cook-docs as an automated task. For now, emoji.yaml can be used as reference.

emoji.yaml
---
emoji:
  cookware:
    - bowl_with_spoon:
        - large bowl
    - cookie:
        - baking sheet
    - page_facing_up:
        - parchment paper
    - shallow_pan_of_food:
        - medium saucepan
    - spoon:
        - spatula
  ingredients:
    - apple:
        - apple
        - apple sauce
    - bagel:
        - cream cheese
    - bell_pepper:
        - bell pepper
    - bread:
        - bread crumbs
        - bread
    - butter:
        - butter
        - tofu
    - candy:
        - sugar
        - powdered sugar
        - confectioner's sugar
    - carrot:
        - carrot
        - frozen vegetables
    - cheese_wedge:
        - ricotta
        - cheddar
        - cheese
        - jack
        - Parmesan
    - chestnut:
        - nutmeg
        - almonds
        - pine nuts
    - chocolate_bar:
        - chocolate
        - chocolate chips
    - coconut:
        - coconut
    - cup_with_straw:
        - baking soda
    - curry:
        - curry powder
        - lentils
    - custard:
        - cinnamon
    - dango:
        - marshmallows
    - dash:
        - baking powder
    - droplet:
        - water
    - ear_of_rice:
        - flour
        - oats
    - egg:
        - egg
        - mayonnaise
    - eggplant:
        - eggplant
    - falafel:
        - chickpeas
        - falafel
    - fallen_leaf:
        - bay leaf
    - four_leaf_clover:
        - clove
    - garlic:
        - garlic
        - shallot
    - glass_of_milk:
        - almond milk
        - milk
        - whole milk
        - lowfat milk
        - skim milk
    - grapes:
        - grapes
        - grape jelly
        - grape jam
    - green_circle:
        - peas
        - pea pods
    - green_salad:
        - vinaigrette
        - dressing
    - herb:
        - cumin
        - basil
        - parsley
        - thyme
        - oregano
        - cilantro
        - coriander
    - honey_pot:
        - honey
    - hotdog:
        - chorizo
        - mustard
        - Dijon mustard
        - sausage
    - hot_pepper:
        - chile
        - paprika
        - chili powder
    - hotsprings:
        - hot water
    - icecream:
        - vanilla
        - icecream
    - ice_cube:
        - ice water
    - jack_o_lantern:
        - pumpkin
    - leafy_green:
        - cabbage
        - red cabbage
        - shredded cabbage
        - spinach
    - lemon:
        - lemon
        - lemon juice
        - lemon zest
        - lime
        - lime juice
        - lime zest
    - maple_leaf:
        - maple syrup
        - syrup
        - molasses
        - brown sugar
    - microbe:
        - nutritional yeast
    - olive:
        - olive
        - olive oil
    - onion:
        - onion
    - orange_circle:
        - orange
    - peanuts:
        - peanuts
        - peanut butter
    - pineapple:
        - pineapple
    - rice:
        - rice
        - sour cream
    - salt:
        - salt
        - pepper
    - seedling:
        - pumpkin seeds
        - sunflower seeds
        - pepitas
    - spaghetti:
        - spaghetti
        - pasta
        - macaroni
    - sponge:
        - pulp
        - capers
    - strawberry:
        - strawberries
        - strawberry jam
        - strawberry jelly
    - sweet_potato:
        - ginger
    - takeout_box:
        - soysauce
    - tangerine:
        - tangerine
        - orange
    - tomato:
        - tomato
        - marinara sauce
    - tulip:
        - saffron
    - tumbler_glass:
        - rum
    - wine_glass:
        - wine

🏃 Workflow

Below is my current workflow for documenting recipes.

graph TD
  S[Change to or create ./cook/catetory dir];
  A{Does the source<br/>website exist?};
  B[Import recipe using cook-import];
  C[Manually write cook<br/>file using micro editor];
  D{Is the domain<br />supported by<br/>cook-import?};
  E[Visually check cook file];
  F[Test output using cook recipe read command];
  G[Download image file and rename<br/>to same base name as cook file];
  H[Run cook-docs in ./cook/category<br/>to generate markdown file];
  I[Manually check markdown file];
  J[Move markdown file to ./docs/category];
  K[Copy image to ./docs/assets/images<br/>with same base file name as markdown file];
  L[Add markdown file to mkdocs.yaml];
  M[Locally run mkdocs to test mkdocs-material];
  N[Commit and push to repo];
  O{Is the file<br />correct?};
  P[Edit cook file];
  Q{Is the<br/>output correct?};
  R[Edit cook file];
  T{Does the page<br/>render correctly?};
  U[CI GitHub Action workflow<br/>deploys recipe site];
  V{Is the image<br/>format webp?};
  W[Convert the image<br/>to png using dwebp];
  X[Check spelling using<br/>spellchecker-cli];
  Y[Check markdown links<br/>using markdown-link-check];
  Z{What is the<br/>origin of the recipe?};
  AB{What type of device<br/>is being used?}
  AC[Use the GitHub mobile app<br/>to create an issue]
  AD[Use the GitHub website<br/>to create an issue]
  AE[Use GitHub Issues to<br/>determine which recipe to document]
  AF[Close GitHub issue, if applicable.]
  AG[Identify a recipe<br/>to be documented]
  AH[Document link in issue]
  AI[Take image of cookbook/index<br/>card and add it to issue]
  AG --> AB;
  AB --> |Mobile|AC;
  AB --> |Desktop|AD;
  AC --> Z;
  AD --> Z;
  Z --> |Website|AH;
  Z --> |Cookbook/<br/>Index Card|AI;
  AH --> AE;
  AI --> AE;
  AE --> S;
  A --> |Yes|B;
  A --> |No|C;
  B --> D;
  C --> F;
  D --> |Yes|E;
  D --> |No|C;
  E --> F;
  F --> Q;
  Q --> |Yes|G;
  H --> I;
  J --> K;
  K --> L;
  L --> M;
  I --> O;
  O --> |Yes|J;
  O --> |No|P;
  P --> H;
  Q --> |No|R;
  R --> F;
  S --> A;
  M --> T;
  T --> |Yes|X;
  X --> Y;
  Y --> N;
  T --> |No|P;
  N --> U;
  G --> V;
  V --> |Yes|W;
  V --> |No|H;
  W --> H;
  U --> AF;

  click B "#cook-import"
  click C "#cooklang-micro"
  click D "#cook-import"
  click F "#cooklang"
  click H "#cook-docs"
  click U "https://github.com/nicholaswilde/recipes/blob/main/.github/workflows/ci.yaml"
  click X "#spellchecker-cli"
  click Y "#markdown-link-check"

🛠 Tools

Tools used to develop this repository.

Note

All commands are run from the root of the repo unless otherwise specified.

🍚 cooklang

Used to generate shopping lists and manage recipes.

Installation
brew tap cooklang/tap
brew install cooklang/tap/cook
Usage
cook recipe read file.cook

🚚 cook-import

Used to download recipe from website as a cooklang file, if possible.

Usage
cook-import -l <url> -f

📝 cooklang-micro

Used as a cooklang syntax highlighter for the micro editor

🖼 webp

Used to convert images from webp to png.

Installation
sudo apt install webp
Usage
dwebp file.webp -o file.png

🖼 avif

Used to convert images from avif to jpg.

Installation
brew install imagemagick
Usage
magick -quality 75 input.avif output.jpg

🤖 Task

Used to automate tasks.

Installation
brew install go-task/tap/go-task
Usage
# List tasks
task

📃 cook-docs

Used to generate markdown files from cooklang files.

Installation
brew install nicholaswilde/tap/cook-docs
Usage
/recipes/cook/category$ cook-docs

📖 Material for MkDocs

Used as theme for static site.

Installation
pip install mkdocs-material mkdocs-minify-plugin

📖 MkDocs

Used to generate static site.

Installation
(
  wget https://bootstrap.pypa.io/get-pip.py
  python get-pip.py
  pip install mkdocs
)
Usage
task serve
Usage
mkdocs serve

🔤 Spellchecker CLI

Used to check documentation spelling.

Installation
npm install --global spellchecker-cli
Usage
task spellcheck
Usage
chmod +x ./scripts/spellcheck.sh
./scripts/spellcheck.sh
Usage
npx spellchecker -d dictionary.txt -f {"./cook/**/*.cook","./docs/**/*.md"}
Add to dictionary
echo "word to add" >> dictionary.txt
Sort dictionary
task sort
Sort dictionary
sort dictionary.txt -u -o dictionary.txt

Used to check documentation links.

Installation
npm install -g markdown-link-check
Usage
task linkcheck
Usage
chmod +x ./scripts/linkcheck.sh
./scripts/linkcheck.sh
Usage
docker run --rm -v /:/tmp:ro -i -w /tmp ghcr.io/tcort/markdown-link-check:stable "/tmp/path/to/file" -c "/tmp{{ .ROOT_DIR }}/mlc_config.json"

Emojipedia

Website used to search for emoji shortcodes.

Emoji Combos

Website used to search for emoji contexts.

Test Custom Admonition

Pied Piper

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla et euismod nulla. Curabitur feugiat, tortor non consequat finibus, justo purus auctor massa, nec semper lorem quam in massa.

Comments