aboutsummaryrefslogtreecommitdiff
path: root/scripts/style_api_gen.py
diff options
context:
space:
mode:
authorGabor Kiss-Vamosi <kisvegabor@gmail.com>2024-03-10 07:46:40 +0100
committerGitHub <noreply@github.com>2024-03-10 14:46:40 +0800
commit7a59cd15ec4fc2466d2286aeecc339a4617b8fcd (patch)
treec6a6b00ff841961e5ad2f74de6530ef2175561f3 /scripts/style_api_gen.py
parent5971c33e45eaeb5684a15537ea9b96e9b9773aed (diff)
downloadlvgl-7a59cd15ec4fc2466d2286aeecc339a4617b8fcd.tar.gz
lvgl-7a59cd15ec4fc2466d2286aeecc339a4617b8fcd.zip
docs(style): output the style properties to style-props.rst (#5802)
Diffstat (limited to 'scripts/style_api_gen.py')
-rwxr-xr-xscripts/style_api_gen.py35
1 files changed, 23 insertions, 12 deletions
diff --git a/scripts/style_api_gen.py b/scripts/style_api_gen.py
index ad651051f..f1a3231ff 100755
--- a/scripts/style_api_gen.py
+++ b/scripts/style_api_gen.py
@@ -558,7 +558,9 @@ def style_const_set(p):
def docs(p):
if "section" in p:
print("")
- print("## " + p['section'])
+ print(p['section'])
+ print("-" * len(p['section']))
+ print("")
print(p['dsc'])
return
@@ -575,20 +577,26 @@ def docs(p):
e = "No"
if p["ext_draw"]: e = "Yes"
- li_style = "style='display:inline; margin-right: 20px; margin-left: 0px"
+ li_style = "style='display:inline-block; margin-right: 20px; margin-left: 0px"
dsc = p['dsc']
print("")
- print("### " + p["name"].lower())
+ print(p["name"].lower())
+ print("~" * len(p["name"].lower()))
+ print("")
print(dsc)
- print("<ul>")
- print("<li " + li_style + "'><strong>Default</strong> " + d + "</li>")
- print("<li " + li_style + "'><strong>Inherited</strong> " + i + "</li>")
- print("<li " + li_style + "'><strong>Layout</strong> " + l + "</li>")
- print("<li " + li_style + "'><strong>Ext. draw</strong> " + e + "</li>")
- print("</ul>")
+
+ print("")
+ print(".. raw:: html")
+ print("")
+ print(" <ul>")
+ print(" <li " + li_style + "'><strong>Default</strong> " + d + "</li>")
+ print(" <li " + li_style + "'><strong>Inherited</strong> " + i + "</li>")
+ print(" <li " + li_style + "'><strong>Layout</strong> " + l + "</li>")
+ print(" <li " + li_style + "'><strong>Ext. draw</strong> " + e + "</li>")
+ print(" </ul>")
def guard_proc(p):
global guard
@@ -597,7 +605,7 @@ def guard_proc(p):
guard_close()
if 'guard' in p:
guard = p['guard']
- print(f"#if {guard}\n")
+ print(f"#if {guard}")
def guard_close():
global guard
@@ -684,8 +692,11 @@ guard_close()
print()
print('#endif /* LV_STYLE_GEN_H */')
-sys.stdout = open(base_dir + '/../docs/overview/style-props.md', 'w')
+sys.stdout = open(base_dir + '/../docs/overview/style-props.rst', 'w')
+
+print('================')
+print('Style properties')
+print('================')
-print('# Style properties')
for p in props:
docs(p)