Skip to content

David7ce/recipesage-converter

Repository files navigation

RecipeSage Converter

A command-line tool that converts RecipeSage JSON recipe exports to multiple formats: PDF cookbooks and Obsidian-compatible markdown files.

Features

PDF Export

  • 🍽️ Hierarchical TOC: Recipes organized by main categories (principal, postre, snack) and subcategories (carnes, pescado, verduras, etc.)
  • 📖 Professional Layout: Clean, readable PDF format with proper page structure
  • 🔗 Smart Source Links: Readable source formatting with recipe name + website
  • 📑 Complete Index: Ingredient index with page references

Obsidian Export

  • 📚 Markdown Format: Individual .md files for each recipe
  • 🏷️ Frontmatter: Complete metadata with categories, tags, images, and sources
  • 🔗 Obsidian Compatible: Ready to import into Obsidian vaults
  • 📁 Organized Structure: Clean file names and folder organization

Both Formats

  • Simple CLI: Easy-to-use command-line interface
  • 🎯 Fast Processing: Efficient batch conversion

Installation

npm install

Usage

PDF Conversion

Convert a RecipeSage JSON export to PDF:

npm run convert recipes.json

Or use tsx directly:

npx tsx cli.ts recipes.json

The tool will generate a recipe-book.pdf file in the same directory.

Obsidian Conversion

Convert a RecipeSage JSON export to Obsidian markdown files:

npm run obsidian recipes.json

Or use tsx directly:

npx tsx obsidian-converter.ts recipes.json

The tool will generate individual .md files in the obsidian_recipes directory (or specify a custom directory as the second argument).

Recipe Structure

The PDF is organized as follows:

  1. Title Page: Recipe book cover
  2. Table of Contents: Hierarchical organization with emoji categories
  3. Ingredient Index: Alphabetical list of all ingredients with page numbers
  4. Recipe Pages: Individual recipe details with ingredients, instructions, and source links

Input Format

Use the JSON export from RecipeSage. The tool expects an array of recipe objects with standard RecipeSage format.

Dependencies

  • PDFKit: PDF generation
  • TypeScript: Type safety and development
  • TSX: TypeScript execution

Development

Build and run:

npm run build
npm run convert your-recipes.json

About

CLI recipes converter from Recipesage JSON to PDF

Topics

Resources

Stars

Watchers

Forks

Contributors