Skip to content

Commit

Permalink
add testing
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Jan 25, 2025
1 parent c80ff11 commit cd76d56
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config/yaml/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
| نام ویژگی | توضیح | تولید |
|-----------|------------|-------|
| `منبع` | | `href` |
| `لینک` | | `src` |

<h2 id="include">دستور <code>بارگیری</code></h2>

Expand Down Expand Up @@ -425,6 +426,7 @@
| نام ویژگی | توضیح | تولید |
|-----------|------------|-------|
| `منبع` | | `src` |
| `لینک` | | `src` |

<h2 id="font">دستور <code>قلم</code></h2>

Expand Down
14 changes: 14 additions & 0 deletions config/yaml/json/layout/attribute/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,20 @@
]
}
},
{
"generate_name": "src",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_LINK",
"reserved_values": "",
"type": "AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY",
"text": {
"en": [
"link"
],
"fa": [
"لینک"
]
}
},
{
"generate_name": "label",
"id": "AST_LAYOUT_ATTRIBUTE_TYPE_LABEL",
Expand Down
6 changes: 4 additions & 2 deletions config/yaml/json/layout/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"id": "AST_LAYOUT_TYPE_LINK",
"is_single": false,
"attributes": [
"AST_LAYOUT_ATTRIBUTE_TYPE_HREF"
"AST_LAYOUT_ATTRIBUTE_TYPE_HREF",
"AST_LAYOUT_ATTRIBUTE_TYPE_LINK"
],
"text": {
"en": [
Expand Down Expand Up @@ -884,7 +885,8 @@
]
},
"attributes": [
"AST_LAYOUT_ATTRIBUTE_TYPE_SRC"
"AST_LAYOUT_ATTRIBUTE_TYPE_SRC",
"AST_LAYOUT_ATTRIBUTE_TYPE_LINK"
]
},
{
Expand Down
9 changes: 9 additions & 0 deletions config/yaml/layout/attribute/type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,15 @@ items:
- src
fa:
- منبع
- generate_name: src
id: AST_LAYOUT_ATTRIBUTE_TYPE_LINK
reserved_values: ''
type: AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY
text:
en:
- link
fa:
- لینک
- generate_name: label
id: AST_LAYOUT_ATTRIBUTE_TYPE_LABEL
reserved_values: ''
Expand Down
2 changes: 2 additions & 0 deletions config/yaml/layout/type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ items:
is_single: false
attributes:
- AST_LAYOUT_ATTRIBUTE_TYPE_HREF
- AST_LAYOUT_ATTRIBUTE_TYPE_LINK
text:
en:
- link
Expand Down Expand Up @@ -604,6 +605,7 @@ items:
- تصویر
attributes:
- AST_LAYOUT_ATTRIBUTE_TYPE_SRC
- AST_LAYOUT_ATTRIBUTE_TYPE_LINK
- descriptions: ''
examples: ''
generate_name: font
Expand Down
7 changes: 7 additions & 0 deletions example/image.salam
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
صفحه:

تصویر:
منبع="https://editor.salamlang.ir/images/favicon.svg"
تمام

تمام
2 changes: 2 additions & 0 deletions src/generated-config/ast_layout_attribute_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_HREF, "HREF", "href", "من

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_SRC, "SRC", "src", "منبع", "src", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_LINK, "LINK", "link", "لینک", "src", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_LABEL, "LABEL", "label", "برچسب", "label", AST_LAYOUT_ATTRIBUTE_FILTER_STRING_ANY, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)

ADD_LAYOUT_ATTRIBUTE_TYPE(AST_LAYOUT_ATTRIBUTE_TYPE_REPEAT, "REPEAT", "repeat", "تکرار", "repeat", AST_LAYOUT_ATTRIBUTE_FILTER_NUMBER, NULL, NULL, AST_LAYOUT_ATTRIBUTE_VALUE_HANDLER_SIMPLE)
Expand Down
1 change: 0 additions & 1 deletion src/generated-config/ast_layout_type_attributes_all.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ layout_map_entry_t layout_map[] = {
{ AST_LAYOUT_TYPE_MEDIA, valid_attributes_media, valid_attributes_media_length },

// ----------- END AUTO GENERATED ----------- //

};

const size_t map_size = sizeof(layout_map) / sizeof(layout_map[0]);
Expand Down
2 changes: 2 additions & 0 deletions src/generated-config/ast_layout_type_attributes_values.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// ----------- BEGIN AUTO GENERATED ----------- //
ast_layout_attribute_type_t valid_attributes_link[] = {
AST_LAYOUT_ATTRIBUTE_TYPE_HREF,
AST_LAYOUT_ATTRIBUTE_TYPE_LINK,
};
const size_t valid_attributes_link_length = sizeof(valid_attributes_link) / sizeof(valid_attributes_link[0]);

Expand Down Expand Up @@ -211,6 +212,7 @@ const size_t valid_attributes_input_length = sizeof(valid_attributes_input) / si

ast_layout_attribute_type_t valid_attributes_img[] = {
AST_LAYOUT_ATTRIBUTE_TYPE_SRC,
AST_LAYOUT_ATTRIBUTE_TYPE_LINK,
};
const size_t valid_attributes_img_length = sizeof(valid_attributes_img) / sizeof(valid_attributes_img[0]);

Expand Down

0 comments on commit cd76d56

Please sign in to comment.