Hi Eileen and Others,

Paprika uses the file extension type to recognize the importing format.  You 
need to use text files and name them with a ".yml" extension for YAML format 
before you import.  Keywords like "name" and "servings" are followed by a colon 
and a space, then the text argument.  For blocks of text, such as a list of 
ingredients, directions, or notes, use a colon, space, and then a vertical line 
character (Shift-Backslash or "|", where the backslash is the rightmost key 
below "delete" and above "return" on an English language input keyboard).  
Then, the subsequent lines of text until the next line with a keyword will all 
be part of the text block associated with that keyword.  For the recipe 
categories keyword argument(s), enclose your categories between left and right 
square brackets.  You can have multiple categories listed, like:
categories: [Main Courses, Meat, Thanksgiving]
You don't have to use all the available keywords for recipes, and the order you 
list them also doesn't matter, as long as they follow the name. You could 
probably just have a "name" keyword, and then everything else (ingredients, 
directions, etc.) under a text block for "notes" and import your recipes.  Of 
course, your recipes would all be uncategorized, and the ingredients and 
directions wouldn't be separated or appear under the sections for ingredients 
and directions,  but this would be a valid import format.

If you plan to import multiple recipes at once within a single file, then the 
"name" keyword has to be preceded by a hyphen and a space, so the import 
process can  determine where new recipes start. If you only import a single 
recipe at a time, it doesn't matter whether you precede the name with a hyphen 
and a space or not. The easiest way to check this out is to try importing a 
single text recipe, and then examine the result and determine whether there are 
changes you want to apply before you import all your recipes.  I personally 
don't like importing these file by file, nor do I find the ".yml" extension a 
natural one to use.  So the way I handled the import was to start with my 
recipes as plain text files with the specified format.  Then I used the 
Terminal command line to put all the recipe TXT files in a given folder into a 
single ".yml" file that I imported.  Linux users will recognize the "cat" 
command to concatenate (put together) multiple files into a single file.  I 
perform this in Terminal in the directory that holds a group of my recipe files 
in TXT format. This is just one way to combine files into a single file that I 
name "recipes1.yml"; you don't have to do it this way:
cat *.txt > recipes1.yml

I'll paste in a sample recipe for an example.  (Hope the formatting works, 
because I'm not at my computer, so I'm copying the text from the Mail Archive 
post I sent to the Mac-Access list a year ago as part of a reply to a question 
about Paprika vs. MacGourmet, which is a very nice desktop Mac package, but 
doesn't have the same easy sync and integration with iOS devices.  Also, I 
never found a way to bulk import your own recipes the way you can in Paprika in 
MacGourmet or any other major recipe manager software -- and I don't mean that 
you can't copy and paste in recipes one by one in these apps.  Certainly  you 
can do that and spend time reformatting each recipe by hand in any of these 
software applications.  You can also batch import your own recipes directly 
into the iOS version of the app, using the file structure keywords I've 
described in this post.  But every experiment trial you made would involve 
connecting up your iOS device to your computer, using iTunes file sharing to 
transfer over the ".yml" files and then using the import function to check 
whether you'd gotten things right and the way you want.  This just seemed too 
painful to do at the same time I was trying to learn about the YAML file 
format.  There is a brief description of this format in the section of the 
Paprika Recipe Manager User Guide on importing recipes.

Here's an example of a text recipe I successfully imported into Paprika, in a 
file that I named "recipe.yml". It was an old plain text file that I had from a 
scan and OCR, and I just added the keyword syntax for fields like name, 
servings, ingredients, directions, etc.  You don't need to have a leading 
hyphen and space before the name if you're only importing one recipe in the 
file.  In general, key words end with a colon and a space, and text blocks (for 
ingredients and directions) have a vertical line after the colon and space.  
VO's reading sounds a bit better if you have complete sentences on each line, 
but I didn't change the sentence breaks from the way this came out from the 
scan and OCR when I imported.  Incidentally, if I try to import a file with 
multiple recipes and there's a problem with one of the entries, it will simply 
fail to import the group.  I don't have to worry about partial imports.

- name: Latin Black Bean Soup
 servings: 5-6
 prep_time: 20 min
 cook_time: 40 min
 on_favorites: yes
 categories: [Soup]
 ingredients: |
   ¼ cup olive oil
   1 large onion, chopped
   4 large cloves garlic, minced
   1 large green pepper, cored, seeded, finely chopped
   1 teaspoon each, leaf oregano, ground cumin
   2 cups precooked black beans and broth
   6-ounce can tomato paste 
   3 tbsp red wine vinegar 
   1 to 2 teaspoons salt
   2 cups cooked brown rice
   Sour cream, sliced radishes, minced hot chilies, chopped cilantro
 directions: |
   Heat oil in a frying pan and sauté onion, garlic 
   and green pepper together with seasonings.  When 
   vegetables are softened, add them to the black 
   beans that have cooked for at least 1 hour. Add 
   tomato paste, vinegar and salt and simmer, covered, 
   for at least ½ hour. Add rice and serve in bowls 
   garnished with sour cream, radishes, chilies 
   (to taste) and cilantro.

HTH.  Cheers,

Esther


-- 
You received this message because you are subscribed to the Google Groups 
"MacVisionaries" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to macvisionaries+unsubscr...@googlegroups.com.
To post to this group, send email to macvisionaries@googlegroups.com.
Visit this group at http://groups.google.com/group/macvisionaries.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to