vite-plugin-cooklang
v0.1.1
Published
A Vite plugin for loading Cooklang markup files.
Downloads
39
Readme
Vite Cooklang Loader
This plugin enables loading of Cooklang markup files.
Setup
Install this package
npm install --save-dev vite-plugin-cooklang
# OR
yarn add -D vite-plugin-cooklang
Update your config
Add the plugin to your Vite config as below:
// vite.config.js
import { defineConfig } from "vite";
import cooklang from "vite-plugin-cooklang";
export default defineConfig({
plugins: [cooklang()],
});
Usage
Recipes are loaded using the Cooklang-TS library and have the below properties:
import recipe from "./test/example/recipes/Easy Pancakes.cook";
const {
//
ingredients,
cookwares,
metadata,
steps,
shoppingList,
} = recipe;
See the test project for an example of using this plugin.
TODO
- [x] Write a readme.
- [ ] Test both inline
Recipe
class and JSON transformer approaches. - [ ] More tests!
Thanks
- The Cooklang-TS TypeScript library
- The Cooklang project and it's contributors
- UnJS Project Starter Template