Skip to content

Commit 704e1fc

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

File tree

1 file changed

+123
-0
lines changed

1 file changed

+123
-0
lines changed

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

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

0 commit comments

Comments
 (0)