Files
nicholaswilde_recipes/scripts/refactor_nav.py
2026-07-02 20:55:35 -07:00

345 lines
26 KiB
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

################################################################################
#
# refactor_nav.py
# ----------------
# Refactor zensical navigation index
#
# @author nιcнolaѕ wιlde, 0x08b7d7a3
# @date 08 Mar 2026
# @version 0.1.0
#
################################################################################
import os
# Define the new navigation blocks as strings
sides_nav_str = """[[project.nav]]
Sides = [
{ "Potatoes" = [
{ "America's Test Kitchen Best Baked Potatoes" = "sides/potatoes/america's-test-kitchen-best-baked-potatoes.md" },
{ "America's Test Kitchen Best Baked Sweet Potatoes" = "sides/potatoes/america's-test-kitchen-best-baked-sweet-potatoes.md" },
{ "Amish Potato Salad" = "sides/potatoes/amish-potato-salad.md" },
{ "Cheesy Potatoes" = "sides/potatoes/cheesy-potatoes.md" },
{ "Crispy Herbes de Provence Potatoes" = "sides/potatoes/crispy-herbes-de-provence-potatoes.md" },
{ "French Potato Salad" = "sides/potatoes/french-potato-salad.md" },
{ "Funeral Potatoes" = "sides/potatoes/funeral-potatoes.md" },
{ "Golden French Mashed Potatoes" = "sides/potatoes/golden-french-mashed-potatoes.md" },
{ "Greek Style Lemon Roasted Potatoes" = "sides/potatoes/greek-style-lemon-roasted-potatoes.md" },
{ "Ina Garten's Potato Salad" = "sides/potatoes/ina-garten's-potato-salad.md" },
{ "Internet-Famous Crispy Potatoes" = "sides/potatoes/internet-famous-crispy-potatoes.md" },
{ "Joel Robuchons Mashed Potatoes" = "sides/potatoes/joel-robuchons-mashed-potatoes.md" },
{ "Julia Child's Garlic Mashed Potatoes" = "sides/potatoes/julia-child's-garlic-mashed-potatoes.md" },
{ "Loaded Vegan Potato Skins" = "sides/potatoes/loaded-vegan-potato-skins.md" },
{ "Pommes Dauphine" = "sides/potatoes/pommes-dauphine.md" },
{ "Pommes Mont D'or" = "sides/potatoes/pommes-mont-d'or.md" },
{ "Potato Au Gratin" = "sides/potatoes/potato-au-gratin.md" },
{ "Potato Salad" = "sides/potatoes/potato-salad.md" },
{ "Scalloped Potatoes" = "sides/potatoes/scalloped-potatoes.md" },
{ "Tater Tots" = "sides/potatoes/tater-tots.md" },
{ "The Best Crispy Roast Potatoes Ever Recipe" = "sides/potatoes/the-best-crispy-roast-potatoes-ever-recipe.md" },
{ "Tortilla de Patatas" = "sides/potatoes/tortilla-de-patatas.md" },
{ "Vegan Mashed Potatoes" = "sides/potatoes/vegan-mashed-potatoes.md" },
] },
{ "Vegetables" = [
{ "Asparagus Purée" = "sides/vegetables/asparagus-purée.md" },
{ "Braised Asparagus with Lemon and Chives" = "sides/vegetables/braised-asparagus-with-lemon-and-chives.md" },
{ "Brown Sugar and Spice Roasted Carrots" = "sides/vegetables/brown-sugar-and-spice-roasted-carrots.md" },
{ "Brussels Sprouts With Warm Honey Glaze" = "sides/vegetables/brussels-sprouts-with-warm-honey-glaze.md" },
{ "Buffalo-Baked Baby Carrots" = "sides/vegetables/buffalo-baked-baby-carrots.md" },
{ "Buffalo Cauliflower Wings" = "sides/vegetables/buffalo-cauliflower-wings.md" },
{ "Butter-Basted Grilled Mushrooms" = "sides/vegetables/butter-basted-grilled-mushrooms.md" },
{ "Cauliflower Purée with Thyme" = "sides/vegetables/cauliflower-purée-with-thyme.md" },
{ "Charred Brussels Sprouts with Walnuts & Gorgonzola" = "sides/vegetables/charred-brussels-sprouts-with-walnuts-&-gorgonzola.md" },
{ "Cilantro Almond Pesto Brussels Sprouts" = "sides/vegetables/cilantro-almond-pesto-brussels-sprouts.md" },
{ "Creamed Spinach" = "sides/vegetables/creamed-spinach.md" },
{ "Fried Green Tomatoes" = "sides/vegetables/fried-green-tomatoes.md" },
{ "Garlic and Lemon Roasted Romanesco Cauliflower" = "sides/vegetables/garlic-and-lemon-roasted-romanesco-cauliflower.md" },
{ "Garlic Mushrooms" = "sides/vegetables/garlic-mushrooms.md" },
{ "Grilled Mushrooms with Rosemary-Lemon Basting Butter" = "sides/vegetables/grilled-mushrooms-with-rosemary-lemon-basting-butter.md" },
{ "Grilled Sweet Potatoes with Chimichurri" = "sides/vegetables/grilled-sweet-potatoes-with-chimichurri.md" },
{ "Hasselback Roasted Zucchini" = "sides/vegetables/hasselback-roasted-zucchini.md" },
{ "Honey Glazed Carrots and Parsnips" = "sides/vegetables/honey-glazed-carrots-and-parsnips.md" },
{ "Ina Garten's Parmesan Roasted Broccoli" = "sides/vegetables/ina-garten's-parmesan-roasted-broccoli.md" },
{ "Jalapeño Corn Pudding" = "sides/vegetables/jalapeño-corn-pudding.md" },
{ "Kale Chips" = "sides/vegetables/kale-chips.md" },
{ "Kickstarter Garlic Mushrooms" = "sides/vegetables/kickstarter-garlic-mushrooms.md" },
{ "Kickstarter Lemony Roasted Cauliflower" = "sides/vegetables/kickstarter-lemony-roasted-cauliflower.md" },
{ "Lemon Garlic Cauliflower Rice" = "sides/vegetables/lemon-garlic-cauliflower-rice.md" },
{ "Maple Harissa Glazed Sweet Potatoes" = "sides/vegetables/maple-harissa-glazed-sweet-potatoes.md" },
{ "Maple Roasted Brussels Sprouts with Pumpkin Seeds" = "sides/vegetables/maple-roasted-brussels-sprouts-with-pumpkin-seeds.md" },
{ "Maple Roasted Carrots with Tahini and Pomegranate" = "sides/vegetables/maple-roasted-carrots-with-tahini-and-pomegranate.md" },
{ "Mashed Sweet Potatoes with Caramelized Shallots" = "sides/vegetables/mashed-sweet-potatoes-with-caramelized-shallots.md" },
{ "Miso-Glazed Bok Choy" = "sides/vegetables/miso-glazed-bok-choy.md" },
{ "Miso-Glazed Carrots" = "sides/vegetables/miso-glazed-carrots.md" },
{ "Mushroom Medley" = "sides/vegetables/mushroom-medley.md" },
{ "Parsnip Purée" = "sides/vegetables/parsnip-purée.md" },
{ "Pea Purée" = "sides/vegetables/pea-purée.md" },
{ "Roasted Delicata Squash" = "sides/vegetables/roasted-delicata-squash.md" },
{ "Roasted Fennel with Garlic and Thyme" = "sides/vegetables/roasted-fennel-with-garlic-and-thyme.md" },
{ "Sautéed Mushrooms" = "sides/vegetables/sautéed-mushrooms.md" },
{ "Skillet-Steamed Haricots Verts" = "sides/vegetables/skillet-steamed-haricots-verts.md" },
{ "Spicy Garlic Edamame" = "sides/vegetables/spicy-garlic-edamame.md" },
{ "Steamed Broccoli with Vinaigrette" = "sides/vegetables/steamed-broccoli-with-vinaigrette.md" },
{ "Vegetable Casserole" = "sides/vegetables/vegetable-casserole.md" },
{ "Zesty Roasted Vegetables" = "sides/vegetables/zesty-roasted-vegetables.md" },
] },
{ "Grains & Legumes" = [
{ "Basmati Pilaf" = "sides/grains-and-legumes/basmati-pilaf.md" },
{ "Black Eyed Peas and Greens" = "sides/grains-and-legumes/black-eyed-peas-and-greens.md" },
{ "Brazilian Rice" = "sides/grains-and-legumes/brazilian-rice.md" },
{ "Corn Tortillas" = "sides/grains-and-legumes/corn-tortillas.md" },
{ "Couscous" = "sides/grains-and-legumes/couscous.md" },
{ "Fried Green Plantains" = "sides/grains-and-legumes/fried-green-plantains.md" },
{ "Garlic Rice" = "sides/grains-and-legumes/garlic-rice.md" },
{ "Gracias Madre Black Beans" = "sides/grains-and-legumes/gracias-madre-black-beans.md" },
{ "Green Rice" = "sides/grains-and-legumes/green-rice.md" },
{ "Pearl Couscous" = "sides/grains-and-legumes/pearl-couscous.md" },
{ "Quinoa" = "sides/grains-and-legumes/quinoa.md" },
{ "Refried Black Beans" = "sides/grains-and-legumes/refried-black-beans.md" },
{ "Vegan Baked Beans" = "sides/grains-and-legumes/vegan-baked-beans.md" },
] },
{ "Salads" = [
{ "Andrew Kings Pasta Salad" = "sides/salads/andrew-kings-pasta-salad.md" },
{ "Balsamic-Dressed Cucumber with Olives" = "sides/salads/balsamic-dressed-cucumber-with-olives.md" },
{ "Beach Day Chickpea Salad" = "sides/salads/beach-day-chickpea-salad.md" },
{ "Blueberry Chickpea Salad" = "sides/salads/blueberry-chickpea-salad.md" },
{ "Eggless Egg Salad" = "sides/salads/eggless-egg-salad.md" },
{ "Fiesta Salad" = "sides/salads/fiesta-salad.md" },
{ "Lemony Broccoli Salad with Chickpeas & Feta" = "sides/salads/lemony-broccoli-salad-with-chickpeas-&-feta.md" },
{ "Macaroni Salad" = "sides/salads/macaroni-salad.md" },
{ "Mexican Coleslaw" = "sides/salads/mexican-coleslaw.md" },
{ "Pasta Salad" = "sides/salads/pasta-salad.md" },
{ "Red Cabbage Salad" = "sides/salads/red-cabbage-salad.md" },
{ "Spicy Cashew Quinoa Salad" = "sides/salads/spicy-cashew-quinoa-salad.md" },
{ "Spinach Salad with Gorgonzola and Pear" = "sides/salads/spinach-salad-with-gorgonzola-and-pear.md" },
{ "Three-Bean Salad" = "sides/salads/three-bean-salad.md" },
{ "Tomato Feta Pasta Salad" = "sides/salads/tomato-feta-pasta-salad.md" },
{ "Tomato Salad" = "sides/salads/tomato-salad.md" },
{ "Vegan Caesar Salad" = "sides/salads/vegan-caesar-salad.md" },
{ "Vegan Kale Caesar with Crispy Chickpeas" = "sides/salads/vegan-kale-caesar-with-crispy-chickpeas.md" },
{ "Vegan Ricotta & Sun-Dried Tomato Pesto Salad" = "sides/salads/vegan-ricotta-&-sun-dried-tomato-pesto-salad.md" },
] },
{ "Snacks" = [
{ "Banana Chips" = "sides/snacks/banana-chips.md" },
{ "Bow Tie Pasta Chips" = "sides/snacks/bow-tie-pasta-chips.md" },
{ "Caprese Flatbread" = "sides/snacks/caprese-flatbread.md" },
{ "Carrot Cake Protein Bites" = "sides/snacks/carrot-cake-protein-bites.md" },
{ "Carrot Slaw" = "sides/snacks/carrot-slaw.md" },
{ "Cheese Soufflé" = "sides/snacks/cheese-soufflé.md" },
{ "Cheesy Popcorn" = "sides/snacks/cheesy-popcorn.md" },
{ "Club Crackers" = "sides/snacks/club-crackers.md" },
{ "Deviled Eggs" = "sides/snacks/deviled-eggs.md" },
{ "Dried Fruit and Nut Mix" = "sides/snacks/dried-fruit-and-nut-mix.md" },
{ "Falafel Scones with Harissa Yogurt" = "sides/snacks/falafel-scones-with-harissa-yogurt.md" },
{ "Fennel and Potato Cassola" = "sides/snacks/fennel-and-potato-cassola.md" },
{ "Granola Bars" = "sides/snacks/granola-bars.md" },
{ "Honey and Walnut Baked Brie" = "sides/snacks/honey-and-walnut-baked-brie.md" },
{ "Honey Roasted Peanuts" = "sides/snacks/honey-roasted-peanuts.md" },
{ "Hummus with Pesto" = "sides/snacks/hummus-with-pesto.md" },
{ "Josh Elkin's Mushroom Toast" = "sides/snacks/josh-elkin's-mushroom-toast.md" },
{ "Kettle Corn" = "sides/snacks/kettle-corn.md" },
{ "Kroket" = "sides/snacks/kroket.md" },
{ "Laugenbrezeln (German Lye Pretzels)" = "sides/snacks/laugenbrezeln-(german-lye-pretzels).md" },
{ "Madre Crab Cakes" = "sides/snacks/madre-crab-cakes.md" },
{ "No Bake Sunshine Energy Bites" = "sides/snacks/no-bake-sunshine-energy-bites.md" },
{ "Peanut Butter Bites" = "sides/snacks/peanut-butter-bites.md" },
{ "Peanut Butter Chocolate Chip Protein Bites" = "sides/snacks/peanut-butter-chocolate-chip-protein-bites.md" },
{ "Pickled Red Onions" = "sides/snacks/pickled-red-onions.md" },
{ "Ritz Crackers" = "sides/snacks/ritz-crackers.md" },
{ "Roasted Chickpea Snack" = "sides/snacks/roasted-chickpea-snack.md" },
{ "Rosemary Roasted Cashews" = "sides/snacks/rosemary-roasted-cashews.md" },
{ "Scottish Oatcakes" = "sides/snacks/scottish-oatcakes.md" },
{ "Strawberry Protein Bites" = "sides/snacks/strawberry-protein-bites.md" },
{ "Unsweetened Applesauce" = "sides/snacks/unsweetened-applesauce.md" },
] },
]"""
sauces_nav_str = """[[project.nav]]
"Sauces & Dressings" = [
{ "Mother Sauces" = [
{ "Béchamel" = "sauces-and-dressings/mother-sauces/béchamel.md" },
{ "Espagnole" = "sauces-and-dressings/mother-sauces/espagnole.md" },
{ "Hollandaise" = "sauces-and-dressings/mother-sauces/hollandaise.md" },
{ "Tomate" = "sauces-and-dressings/mother-sauces/tomate.md" },
{ "Velouté" = "sauces-and-dressings/mother-sauces/velouté.md" },
] },
{ "Vinaigrettes" = [
{ "All-Purpose Vinaigrette" = "sauces-and-dressings/vinaigrettes/all-purpose-vinaigrette.md" },
{ "Broccoli Salad Dressing" = "sauces-and-dressings/vinaigrettes/broccoli-salad-dressing.md" },
{ "Cilantro Dressing" = "sauces-and-dressings/vinaigrettes/cilantro-dressing.md" },
{ "Citrus Honey Dressing" = "sauces-and-dressings/vinaigrettes/citrus-honey-dressing.md" },
{ "Creamy Cilantro Dressing" = "sauces-and-dressings/vinaigrettes/creamy-cilantro-dressing.md" },
{ "French Dressing" = "sauces-and-dressings/vinaigrettes/french-dressing.md" },
{ "Honey Mustard Vinaigrette" = "sauces-and-dressings/vinaigrettes/honey-mustard-vinaigrette.md" },
{ "Hummus-Orange Juice Dressing" = "sauces-and-dressings/vinaigrettes/hummus-orange-juice-dressing.md" },
{ "Ina Garten's Perfect Vinaigrette" = "sauces-and-dressings/vinaigrettes/ina-garten's-perfect-vinaigrette.md" },
{ "Italian Vinaigrette" = "sauces-and-dressings/vinaigrettes/italian-vinaigrette.md" },
{ "Jane's 3, 2, 1 Salad Dressing" = "sauces-and-dressings/vinaigrettes/jane's-3,-2,-1-salad-dressing.md" },
{ "Orange Juice-Lime Salad Dressing" = "sauces-and-dressings/vinaigrettes/orange-juice-lime-salad-dressing.md" },
{ "Pizzeria Vinaigrette" = "sauces-and-dressings/vinaigrettes/pizzeria-vinaigrette.md" },
{ "Red Wine Vinaigrette" = "sauces-and-dressings/vinaigrettes/red-wine-vinaigrette.md" },
{ "Rip's Salad Dressing" = "sauces-and-dressings/vinaigrettes/rip's-salad-dressing.md" },
{ "Roasted Red Pepper Dressing" = "sauces-and-dressings/vinaigrettes/roasted-red-pepper-dressing.md" },
{ "Strawberry Tarragon Dressing" = "sauces-and-dressings/vinaigrettes/strawberry-tarragon-dressing.md" },
{ "Sumac Lemon Vinaigrette" = "sauces-and-dressings/vinaigrettes/sumac-lemon-vinaigrette.md" },
{ "Vinaigrette" = "sauces-and-dressings/vinaigrettes/vinaigrette.md" },
] },
{ "Salsas" = [
{ "Aaron Combs' Salsa" = "sauces-and-dressings/salsas/aaron-combs'-salsa.md" },
{ "Pumpkin Seed Salsa" = "sauces-and-dressings/salsas/pumpkin-seed-salsa.md" },
{ "Salsa Brava" = "sauces-and-dressings/salsas/salsa-brava.md" },
{ "Salsa Fresca (Pico de Gallo)" = "sauces-and-dressings/salsas/salsa-fresca-(pico-de-gallo).md" },
{ "Salsa Macha" = "sauces-and-dressings/salsas/salsa-macha.md" },
{ "Salsa Negra" = "sauces-and-dressings/salsas/salsa-negra.md" },
{ "Salsa Ranchera" = "sauces-and-dressings/salsas/salsa-ranchera.md" },
{ "Salsa Roja" = "sauces-and-dressings/salsas/salsa-roja.md" },
{ "Salsa Verde" = "sauces-and-dressings/salsas/salsa-verde.md" },
{ "Sweet-and-Spicy Corn Salsa" = "sauces-and-dressings/salsas/sweet-and-spicy-corn-salsa.md" },
] },
{ "Dips & Spreads" = [
{ "Aji Verde" = "sauces-and-dressings/dips-and-spreads/aji-verde.md" },
{ "Balsamic Onion Jam" = "sauces-and-dressings/dips-and-spreads/balsamic-onion-jam.md" },
{ "Beet Hummus" = "sauces-and-dressings/dips-and-spreads/beet-hummus.md" },
{ "Benedictine Sandwich Spread" = "sauces-and-dressings/dips-and-spreads/benedictine-sandwich-spread.md" },
{ "Blue Cheese Herb Spread" = "sauces-and-dressings/dips-and-spreads/blue-cheese-herb-spread.md" },
{ "Cashew Chipotle Ranch Dressing" = "sauces-and-dressings/dips-and-spreads/cashew-chipotle-ranch-dressing.md" },
{ "Cashew Crema" = "sauces-and-dressings/dips-and-spreads/cashew-crema.md" },
{ "Cashew Nacho Cheese" = "sauces-and-dressings/dips-and-spreads/cashew-nacho-cheese.md" },
{ "Cashew Queso Blanco" = "sauces-and-dressings/dips-and-spreads/cashew-queso-blanco.md" },
{ "Chipotle Mayonnaise" = "sauces-and-dressings/dips-and-spreads/chipotle-mayonnaise.md" },
{ "Chipotle Ranch Dressing" = "sauces-and-dressings/dips-and-spreads/chipotle-ranch-dressing.md" },
{ "Claire's Five-Onion Dip" = "sauces-and-dressings/dips-and-spreads/claire's-five-onion-dip.md" },
{ "Edamame Hummus" = "sauces-and-dressings/dips-and-spreads/edamame-hummus.md" },
{ "Green Goddess Dressing" = "sauces-and-dressings/dips-and-spreads/green-goddess-dressing.md" },
{ "Hearts of Palm Ceviche" = "sauces-and-dressings/dips-and-spreads/hearts-of-palm-ceviche.md" },
{ "Homemade Ranch Dip" = "sauces-and-dressings/dips-and-spreads/homemade-ranch-dip.md" },
{ "Hummus" = "sauces-and-dressings/dips-and-spreads/hummus.md" },
{ "Mayonnaise" = "sauces-and-dressings/dips-and-spreads/mayonnaise.md" },
{ "Mexicrema Dressing" = "sauces-and-dressings/dips-and-spreads/mexicrema-dressing.md" },
{ "Oil-Free Easy French Hummus Dressing" = "sauces-and-dressings/dips-and-spreads/oil-free-easy-french-hummus-dressing.md" },
{ "Oil-Free Hummus" = "sauces-and-dressings/dips-and-spreads/oil-free-hummus.md" },
{ "Persian Yogurt Dip with Shallots (Mast-O Musir)" = "sauces-and-dressings/dips-and-spreads/persian-yogurt-dip-with-shallots-(mast-o-musir).md" },
{ "Ranch Dip" = "sauces-and-dressings/dips-and-spreads/ranch-dip.md" },
{ "Ranch Dressing" = "sauces-and-dressings/dips-and-spreads/ranch-dressing.md" },
{ "Roasted Garlic Hummus" = "sauces-and-dressings/dips-and-spreads/roasted-garlic-hummus.md" },
{ "Spinach Dip" = "sauces-and-dressings/dips-and-spreads/spinach-dip.md" },
{ "Tahini" = "sauces-and-dressings/dips-and-spreads/tahini.md" },
{ "Tofu Mayonnaise" = "sauces-and-dressings/dips-and-spreads/tofu-mayonnaise.md" },
{ "Tzatziki Dip" = "sauces-and-dressings/dips-and-spreads/tzatziki-dip.md" },
{ "Tzatziki Sauce" = "sauces-and-dressings/dips-and-spreads/tzatziki-sauce.md" },
{ "Vegan Caesar Dressing" = "sauces-and-dressings/dips-and-spreads/vegan-caesar-dressing.md" },
{ "Vegan Chipotle Ranch Dressing" = "sauces-and-dressings/dips-and-spreads/vegan-chipotle-ranch-dressing.md" },
{ "Vegan Ranch Dressing" = "sauces-and-dressings/dips-and-spreads/vegan-ranch-dressing.md" },
{ "Vegan Sour Cream" = "sauces-and-dressings/dips-and-spreads/vegan-sour-cream.md" },
{ "Whipped Almond Ricotta" = "sauces-and-dressings/dips-and-spreads/whipped-almond-ricotta.md" },
] },
{ "Sweet Sauces" = [
{ "Berry Sauce" = "sauces-and-dressings/sweet-sauces/berry-sauce.md" },
{ "Crème Anglaise" = "sauces-and-dressings/sweet-sauces/crème-anglaise.md" },
{ "Hot Fudge Sauce" = "sauces-and-dressings/sweet-sauces/hot-fudge-sauce.md" },
{ "Mixed Berry Coulis" = "sauces-and-dressings/sweet-sauces/mixed-berry-coulis.md" },
{ "Salted Caramel Sauce" = "sauces-and-dressings/sweet-sauces/salted-caramel-sauce.md" },
{ "Simple Berry Compote" = "sauces-and-dressings/sweet-sauces/simple-berry-compote.md" },
{ "Single Jar of Fruit Jam" = "sauces-and-dressings/sweet-sauces/single-jar-of-fruit-jam.md" },
{ "Sweet-and-Spicy Ketchup" = "sauces-and-dressings/sweet-sauces/sweet-and-spicy-ketchup.md" },
] },
{ "Gravy & Savory Sauces" = [
{ "Pesto" = [
{ "Balsamic Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/balsamic-pesto.md" },
{ "Basic Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/basic-pesto.md" },
{ "Broccoli Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/broccoli-pesto.md" },
{ "Cilantro Almond Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/cilantro-almond-pesto.md" },
{ "Cook's Country Perfect Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/cook's-country-perfect-pesto.md" },
{ "Jalapeño Lime Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/jalapeño-lime-pesto.md" },
{ "Joy of Cooking Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/joy-of-cooking-pesto.md" },
{ "Lemon Arugula Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/lemon-arugula-pesto.md" },
{ "Lemon-Pepper Parsley Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/lemon-pepper-parsley-pesto.md" },
{ "Mascarpone Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/mascarpone-pesto.md" },
{ "Sun-Dried Tomato Pesto" = "sauces-and-dressings/gravy-and-savory-sauces/pesto/sun-dried-tomato-pesto.md" },
] },
{ "Adobo Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/adobo-sauce.md" },
{ "Alfredo Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/alfredo-sauce.md" },
{ "Applied Homemade Vegetarian Gravy" = "sauces-and-dressings/gravy-and-savory-sauces/applied-homemade-vegetarian-gravy.md" },
{ "Arrabbiata Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/arrabbiata-sauce.md" },
{ "Asian Sweet-and-Sour Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/asian-sweet-and-sour-sauce.md" },
{ "A Very Popular BBQ Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/a-very-popular-bbq-sauce.md" },
{ "Buffalo Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/buffalo-sauce.md" },
{ "Butternut Squash Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/butternut-squash-sauce.md" },
{ "Carrot-Tamarind Chutney" = "sauces-and-dressings/gravy-and-savory-sauces/carrot-tamarind-chutney.md" },
{ "Chilero Hot Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/chilero-hot-sauce.md" },
{ "Chimichurri" = "sauces-and-dressings/gravy-and-savory-sauces/chimichurri.md" },
{ "Classic Mustard" = "sauces-and-dressings/gravy-and-savory-sauces/classic-mustard.md" },
{ "Classic Tartar Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/classic-tartar-sauce.md" },
{ "Creamy Peanut Tofu Marinade" = "sauces-and-dressings/gravy-and-savory-sauces/creamy-peanut-tofu-marinade.md" },
{ "Creamy Vegan Cheese Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/creamy-vegan-cheese-sauce.md" },
{ "Dijon Mustard" = "sauces-and-dressings/gravy-and-savory-sauces/dijon-mustard.md" },
{ "Enchilada Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/enchilada-sauce.md" },
{ "Garlic Aioli" = "sauces-and-dressings/gravy-and-savory-sauces/garlic-aioli.md" },
{ "Homemade Chilli Oil" = "sauces-and-dressings/gravy-and-savory-sauces/homemade-chilli-oil.md" },
{ "Honey Mustard Dipping Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/honey-mustard-dipping-sauce.md" },
{ "Indian Mango Chutney" = "sauces-and-dressings/gravy-and-savory-sauces/indian-mango-chutney.md" },
{ "Lebanese Garlic Sauce (Toum)" = "sauces-and-dressings/gravy-and-savory-sauces/lebanese-garlic-sauce-(toum).md" },
{ "Magnolia Ranchero Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/magnolia-ranchero-sauce.md" },
{ "Maple Soy Tofu Marinade" = "sauces-and-dressings/gravy-and-savory-sauces/maple-soy-tofu-marinade.md" },
{ "Marinara Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/marinara-sauce.md" },
{ "Miso Glaze" = "sauces-and-dressings/gravy-and-savory-sauces/miso-glaze.md" },
{ "Mushroom Gravy" = "sauces-and-dressings/gravy-and-savory-sauces/mushroom-gravy.md" },
{ "Mushroom Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/mushroom-sauce.md" },
{ "New York-Style Pizza Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/new-york-style-pizza-sauce.md" },
{ "New York Times' Classic Marinara Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/new-york-times'-classic-marinara-sauce.md" },
{ "Peanut Dipping Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/peanut-dipping-sauce.md" },
{ "Pumpkin Curry Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/pumpkin-curry-sauce.md" },
{ "Roasted Red Pepper Coulis" = "sauces-and-dressings/gravy-and-savory-sauces/roasted-red-pepper-coulis.md" },
{ "Roasted Red Pepper Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/roasted-red-pepper-sauce.md" },
{ "Simple Barbecue Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/simple-barbecue-sauce.md" },
{ "Simple Tartar Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/simple-tartar-sauce.md" },
{ "Spaghetti Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/spaghetti-sauce.md" },
{ "Special Sauce for Burgers" = "sauces-and-dressings/gravy-and-savory-sauces/special-sauce-for-burgers.md" },
{ "Spicy Vegan Mayo" = "sauces-and-dressings/gravy-and-savory-sauces/spicy-vegan-mayo.md" },
{ "Thai Red Curry Tofu Marinade" = "sauces-and-dressings/gravy-and-savory-sauces/thai-red-curry-tofu-marinade.md" },
{ "The Soyfoods Council Chimichurri" = "sauces-and-dressings/gravy-and-savory-sauces/the-soyfoods-council-chimichurri.md" },
{ "Tomato Bruschetta" = "sauces-and-dressings/gravy-and-savory-sauces/tomato-bruschetta.md" },
{ "Tomato Ragu" = "sauces-and-dressings/gravy-and-savory-sauces/tomato-ragu.md" },
{ "Tomato Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/tomato-sauce.md" },
{ "Vegetarian Sausage Gravy" = "sauces-and-dressings/gravy-and-savory-sauces/vegetarian-sausage-gravy.md" },
{ "White Mac and Cheese Sauce" = "sauces-and-dressings/gravy-and-savory-sauces/white-mac-and-cheese-sauce.md" },
] },
]"""
if __name__ == "__main__":
with open("zensical.toml", "r") as f:
lines = f.readlines()
new_lines = []
skip_mode = False
for i, line in enumerate(lines):
if line.strip() == "[[project.nav]]":
# Check next line
if i + 1 < len(lines):
next_line = lines[i+1].strip()
if next_line.startswith('Sides ='):
new_lines.append(sides_nav_str + "\n")
skip_mode = True
continue
elif next_line.startswith('"Sauces & Dressings" ='):
new_lines.append(sauces_nav_str + "\n")
skip_mode = True
continue
if skip_mode:
if line.strip() == "]" or (line.strip() == "" and i+1 < len(lines) and lines[i+1].strip() == "[[project.nav]]"):
# End of current list? Actually zensical.toml uses [[project.nav]] for each section.
# So we skip until the next [[project.nav]] or some other top level table.
if i + 1 < len(lines) and (lines[i+1].startswith("[[project.nav]]") or lines[i+1].startswith("[project.")):
skip_mode = False
continue
continue
new_lines.append(line)
with open("zensical.toml", "w") as f:
f.writelines(new_lines)
print("zensical.toml refactored successfully.")