Skip to content

Commit e32deaa

Browse files
BI-5092 Add COLOR, SIZE, BR to docs & suggest (#382)
* BI-5092 Add COLOR, SIZE, BR to docs & suggest * Update ru texts * Update en texts
1 parent 989743d commit e32deaa

File tree

5 files changed

+40
-16
lines changed

5 files changed

+40
-16
lines changed

lib/dl_formula/dl_formula/definitions/functions_markup.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,6 @@ class FuncColor(FuncMarkup):
251251
]
252252
variants = make_variants("cl")
253253

254-
scopes = Function.scopes & ~Scope.SUGGESTED & ~Scope.DOCUMENTED
255-
256254

257255
class FuncSize(FuncMarkup):
258256
name = "size"
@@ -263,14 +261,12 @@ class FuncSize(FuncMarkup):
263261
ArgTypeSequence([MARKUP_EFFECTIVELY, DataType.STRING]),
264262
]
265263
variants = make_variants("sz")
266-
scopes = Function.scopes & ~Scope.SUGGESTED & ~Scope.DOCUMENTED
267264

268265

269266
class FuncBr(FuncMarkup):
270267
name = "br"
271268
arg_cnt = 0
272269
variants = make_variants("br")
273-
scopes = Function.scopes & ~Scope.SUGGESTED & ~Scope.DOCUMENTED
274270

275271

276272
DEFINITIONS_MARKUP = [

lib/dl_formula_ref/dl_formula_ref/functions/markup.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from dl_formula_ref.categories.markup import CATEGORY_MARKUP
2+
from dl_formula_ref.i18n.registry import FormulaRefTranslatable as Translatable
23
from dl_formula_ref.localization import get_gettext
34
from dl_formula_ref.registry.base import FunctionDocRegistryItem
45
from dl_formula_ref.registry.example import SimpleExample
6+
from dl_formula_ref.registry.note import Note
57

68

79
_ = get_gettext()
@@ -40,20 +42,36 @@
4042
FUNCTION_COLOR = FunctionDocRegistryItem(
4143
name="color",
4244
category=CATEGORY_MARKUP,
43-
description=_("Stylizes the passed text with the passed color."),
45+
description=_("Enables specifying the color for the provided text."),
46+
examples=[
47+
SimpleExample("COLOR([text], '#5282ff')"),
48+
SimpleExample("COLOR([text], 'blue')"),
49+
SimpleExample("COLOR([text], 'rgb(82, 130, 255)')"),
50+
SimpleExample("COLOR([text], 'rgba(82, 130, 255, 0.5)')"),
51+
],
52+
notes=[
53+
Note(
54+
Translatable("You can specify the color in any web format, such as HEX, keyword (e.g., `green`), RGB, etc.")
55+
),
56+
],
4457
)
4558

46-
4759
FUNCTION_SIZE = FunctionDocRegistryItem(
4860
name="size",
4961
category=CATEGORY_MARKUP,
50-
description=_("Stylizes the passed text with the passed size."),
62+
description=_("Enables specifying the size (in pixels) for the provided text."),
63+
examples=[
64+
SimpleExample("SIZE([text], '26px')"),
65+
],
5166
)
5267

5368
FUNCTION_BR = FunctionDocRegistryItem(
5469
name="br",
5570
category=CATEGORY_MARKUP,
5671
description=_("Adds a line break."),
72+
examples=[
73+
SimpleExample("'Line 1' + BR() + 'Line 2'"),
74+
],
5775
)
5876

5977
FUNCTIONS_MARKUP = [

lib/dl_formula_ref/dl_formula_ref/locales/en/LC_MESSAGES/dl_formula_ref_dl_formula_ref.po

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,10 +1041,15 @@ msgid ""
10411041
"marked up text."
10421042
msgstr ""
10431043

1044-
msgid "Stylizes the passed text with the passed color."
1044+
msgid "Enables specifying the color for the provided text."
10451045
msgstr ""
10461046

1047-
msgid "Stylizes the passed text with the passed size."
1047+
msgid ""
1048+
"You can specify the color in any web format, such as HEX, keyword (e.g., "
1049+
"`green`), RGB, etc."
1050+
msgstr ""
1051+
1052+
msgid "Enables specifying the size (in pixels) for the provided text."
10481053
msgstr ""
10491054

10501055
msgid "Adds a line break."
Binary file not shown.

lib/dl_formula_ref/dl_formula_ref/locales/ru/LC_MESSAGES/dl_formula_ref_dl_formula_ref.po

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,16 +1584,21 @@ msgstr ""
15841584
"Объединяет размеченный текст. Также может быть использован для конвертации "
15851585
"обычных строк в размеченный текст."
15861586

1587-
#, fuzzy
1588-
msgid "Stylizes the passed text with the passed color."
1589-
msgstr "Выделяет переданный текст жирным шрифтом."
1587+
msgid "Enables specifying the color for the provided text."
1588+
msgstr "Позволяет указать цвет для переданного текста."
15901589

1591-
#, fuzzy
1592-
msgid "Stylizes the passed text with the passed size."
1593-
msgstr "Выделяет переданный текст жирным шрифтом."
1590+
msgid ""
1591+
"You can specify the color in any web format, such as HEX, keyword (e.g., "
1592+
"`green`), RGB, etc."
1593+
msgstr ""
1594+
"Цвет можно указать в любом формате представления веб-цвета: HEX, ключевым "
1595+
"словом (например, `green`), RGB и т. д."
1596+
1597+
msgid "Enables specifying the size (in pixels) for the provided text."
1598+
msgstr "Позволяет указать размер в пикселях для переданного текста."
15941599

15951600
msgid "Adds a line break."
1596-
msgstr ""
1601+
msgstr "Добавляет перенос строки."
15971602

15981603
msgid "Returns the absolute value of {arg:0}."
15991604
msgstr "Возвращает абсолютное значение заданного числа {arg:0}."

0 commit comments

Comments
 (0)