Skip to content

Commit

Permalink
Standardize all files with EditorConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatTSGuy committed Dec 19, 2023
1 parent 2ace245 commit babf95a
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/Parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Ingredient, Cookware, Step, Metadata, Item, ShoppingList } from './cook
* @property defaultCookwareAmount The default value to pass if there is no cookware amount. By default the amount is 1
* @property defaultIngredientAmount The default value to pass if there is no ingredient amount. By default the amount is "some"
* @property includeStepNumber Whether or not to include the step number in ingredient and cookware nodes
*
*
*/
export interface ParserOptions {
defaultCookwareAmount?: string | number;
Expand All @@ -29,7 +29,7 @@ export default class Parser {

/**
* Creates a new parser with the supplied options
*
*
* @param options The parser's options
*/
constructor(options?: ParserOptions) {
Expand All @@ -40,10 +40,10 @@ export default class Parser {

/**
* Parses a Cooklang string and returns any metadata, steps, or shopping lists
*
*
* @param source A Cooklang recipe
* @returns The extracted ingredients, cookwares, metadata, steps, and shopping lists
*
*
* @see {@link https://cooklang.org/docs/spec/#the-cook-recipe-specification|Cooklang Recipe}
*/
parse(source: string): ParseResult {
Expand Down Expand Up @@ -236,4 +236,4 @@ function parseShoppingListCategory(items: string): Array<Item> {
}

return list;
}
}
8 changes: 4 additions & 4 deletions src/Recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ export default class Recipe {

/**
* Creates a new recipe from the supplied Cooklang string
*
*
* @param source The Cooklang string to parse. If `source` is ommited, an empty recipe is created
* @param options The options to pass to the parser
*
*
* @see {@link https://cooklang.org/docs/spec/#the-cook-recipe-specification|Cooklang Recipe}
*/
constructor(source?: string, options?: ParserOptions) {
Expand All @@ -27,7 +27,7 @@ export default class Recipe {

/**
* Generates a Cooklang string from the recipes metadata, steps, and shopping lists
*
*
* @returns The generated Cooklang string
*/
toCooklang(): string {
Expand Down Expand Up @@ -73,4 +73,4 @@ export default class Recipe {

return [metadataStr, stepStrs.join('\n\n'), shoppingListStrs.join('\n\n')].join('\n');
}
}
}
4 changes: 2 additions & 2 deletions src/example.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const source = `
>> total time: 6 minutes
>> servings: 2
Place the @apple juice{1,5%cups}, @banana{one sliced}, @frozen mixed berries{1,5%cups} and @vanilla greek yogurt{3/4%cup} in a #blender{}; blend until smooth. If the smoothie seems too thick, add a little more liquid (1/4 cup).
Place the @apple juice{1,5%cups}, @banana{one sliced}, @frozen mixed berries{1,5%cups} and @vanilla greek yogurt{3/4%cup} in a #blender{}; blend until smooth. If the smoothie seems too thick, add a little more liquid (1/4 cup).
Taste and add @honey{} if desired. Pour into two glasses and garnish with fresh berries and mint sprigs if desired.
`;
Expand Down Expand Up @@ -33,4 +33,4 @@ console.log(getImageURL('Mixed Berry Smoothie', {
step: 1,
extension: 'png'
}));
// 'Mixed Berry Smoothie.1.png'
// 'Mixed Berry Smoothie.1.png'
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ export interface ImageURLOptions {

/**
* Creates a URL for an image of the the supplied recipe.
*
*
* @example
* ```typescript
* getImageURL('Baked Potato', { extension: 'jpg', step: 2 });
* // returns "Baked Potato.2.jpg"
* ```
*
*
* @param name Name of the .cook file.
* @param options The URL options.
* @returns The image URL for the givin recipe and step.
*
*
* @see {@link https://cooklang.org/docs/spec/#adding-pictures|Cooklang Pictures Specification}
*/
export function getImageURL(name: string, options?: ImageURLOptions) {
Expand Down Expand Up @@ -51,4 +51,4 @@ Slowly stir eggs onto pan, cook for about ~{10-15%sec}, then remove and add @ses
Stir @miso paste{} into kombu broth, and bring to boil
Pour the soup into the egg-stirring bowl, and top with chopped @scallions
`));
`));
2 changes: 1 addition & 1 deletion tests/custom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,4 @@ tests:
- type: text
value: "step"
metadata:
"source": "example.com"
"source": "example.com"
2 changes: 1 addition & 1 deletion tools/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ function writer() {
return this.output;
},
}
}
}

0 comments on commit babf95a

Please sign in to comment.