Skip to content

Commit dfbca1d

Browse files
committed
temp instructions for card import structure
Signed-off-by: Anna Khismatullina <[email protected]>
1 parent 088f9bb commit dfbca1d

File tree

1 file changed

+135
-0
lines changed

1 file changed

+135
-0
lines changed

Diff for: dev/import-tool/docs/huly/CARDS_INSTRUCTIONS.md

+135
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Card Import Format Guide
2+
3+
## Directory Structure
4+
5+
6+
All files are organized in the following structure:
7+
8+
```
9+
workspace/
10+
├── Recipes.yaml # Base type configuration
11+
├── Recipes/ # Base type cards folder
12+
│ ├── Classic Margherita Pizza.md
13+
│ └── Chocolate Lava Cake.md
14+
└── Recipes/Vegan/ # Child type folder
15+
├── Vegan Recipe.yaml # Child type configuration
16+
└── Mushroom Risotto.md # Child type card
17+
```
18+
19+
## Types (Master Tags)
20+
21+
Types are described in YAML files and define the structure of cards.
22+
23+
### Base Type
24+
Create file `Recipes.yaml`:
25+
26+
```
27+
class: card:class:MasterTag
28+
title: Recipe
29+
properties:
30+
- label: cookingTime # Property name
31+
type: TypeString # Data type
32+
- label: servings
33+
type: TypeNumber
34+
# ... other properties
35+
```
36+
37+
### Child Type
38+
Create file `Recipes/Vegan/Vegan Recipe.yaml`:
39+
40+
```
41+
class: card:class:MasterTag
42+
title: Vegan Recipe
43+
properties:
44+
- label: proteinSource
45+
type: TypeString
46+
# ... additional properties
47+
```
48+
49+
## Cards
50+
51+
Cards are Markdown files with YAML header and content.
52+
53+
### Base Type Card
54+
Create file `Recipes/Classic Margherita Pizza.md`:
55+
56+
```
57+
title: Classic Margherita Pizza
58+
cookingTime: 30 minutes
59+
servings: 4
60+
difficulty: Medium
61+
category: Italian
62+
calories: 850
63+
chef: Mario Rossi
64+
```
65+
66+
# Content in Markdown format
67+
## Sections
68+
- Lists
69+
- Instructions
70+
- Notes
71+
72+
### Child Type Card
73+
Create file `Recipes/Vegan/Mushroom Risotto.md`:
74+
75+
```
76+
title: Vegan Mushroom Risotto
77+
cookingTime: 45 minutes
78+
servings: 4
79+
difficulty: Medium
80+
category: Italian
81+
calories: 380
82+
chef: Maria Green
83+
proteinSource: Mushrooms # Child type properties
84+
isGlutenFree: true
85+
allergens: None
86+
```
87+
88+
# Content in Markdown format
89+
90+
## Important Rules
91+
92+
1. File Names:
93+
- Type YAML files must end with `.yaml`
94+
- Cards must have `.md` extension
95+
- File names can contain spaces
96+
97+
2. Directory Structure:
98+
- Child types must be in a subfolder named after the type
99+
- Child type cards must be in the same folder as its configuration
100+
101+
3. Card YAML Header:
102+
- Must start and end with `---`
103+
- Must contain all properties defined in the type
104+
- Values must match specified data types
105+
106+
4. Card Content:
107+
- After YAML header goes regular Markdown text
108+
- Can use all Markdown features (headings, lists, tables, etc.)
109+
110+
## Examples from Our System
111+
112+
1. Base Recipe Type:
113+
- File: `Recipes.yaml`
114+
- Defines basic recipe properties (cooking time, servings, difficulty, etc.)
115+
116+
2. Base Type Cards:
117+
- `Recipes/Classic Margherita Pizza.md` - pizza recipe
118+
- `Recipes/Chocolate Lava Cake.md` - dessert recipe
119+
120+
3. Vegan Recipe Child Type:
121+
- File: `Recipes/Vegan/Vegan Recipe.yaml`
122+
- Adds specific properties (protein source, gluten-free, allergens)
123+
124+
4. Child Type Card:
125+
- `Recipes/Vegan/Mushroom Risotto.md` - vegan risotto
126+
- Uses both base properties and vegan type properties
127+
128+
## Supported Data Types (to be extended)
129+
130+
- TypeString - text values
131+
- TypeNumber - numeric values
132+
- TypeBoolean - yes/no (true/false)
133+
- TypeDate - dates
134+
- TypeHyperlink - links
135+
- TypeEnum - enumeration (list of possible values) (not supported yet)

0 commit comments

Comments
 (0)