From 88bc82cd50a0ee234026b652190dfa9d78e55f59 Mon Sep 17 00:00:00 2001 From: 3w36zj6 <52315048+3w36zj6@users.noreply.github.com> Date: Sun, 30 Mar 2025 17:31:30 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=96=A2=E6=95=B0=E3=81=AE=E5=AE=9A?= =?UTF-8?q?=E7=BE=A9=E3=81=AE=E3=83=A1=E3=82=BD=E3=83=83=E3=83=89=E3=81=AE?= =?UTF-8?q?=E8=A6=8B=E5=87=BA=E3=81=97=E3=81=AB=E3=83=84=E3=83=BC=E3=83=AB?= =?UTF-8?q?=E3=83=81=E3=83=83=E3=83=97=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/assets/icons/16-warn.svg | 7 ++++++ static/styles/docs.css | 9 +++++++ templates/func_template.html.j2 | 42 ++++++++++++++++++++++++++++++--- templates/type_template.html.j2 | 12 +++++++++- 4 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 static/assets/icons/16-warn.svg diff --git a/static/assets/icons/16-warn.svg b/static/assets/icons/16-warn.svg new file mode 100644 index 0000000000..91931ce222 --- /dev/null +++ b/static/assets/icons/16-warn.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/static/styles/docs.css b/static/styles/docs.css index b25cd430ab..830843b0d4 100644 --- a/static/styles/docs.css +++ b/static/styles/docs.css @@ -528,6 +528,15 @@ h1 .pill { margin-bottom: -3px } +.deprecation { + align-items: baseline; +} + +.deprecation svg { + margin-bottom: -4px; + padding: 0; +} + .tooltip-context { position: relative } diff --git a/templates/func_template.html.j2 b/templates/func_template.html.j2 index 1d3b95710e..2e1b3e7571 100644 --- a/templates/func_template.html.j2 +++ b/templates/func_template.html.j2 @@ -3,8 +3,17 @@ {% extends "base_template.html.j2" %} {% block content %} -

{{ body['content']['name'] }}{% if body['content']['element'] %}{{ - macros.tooltip_display('Element', 'Element functions can be customized with set and show rules.') }}{% endif %}

+

+ {{ body['content']['name'] }} + + {% if body['content']['element'] %} + {{ macros.tooltip_display('Element', 'Element functions can be customized with set and show rules.') }} + {% endif %} + {% if body['content']['contextual'] %} + {{ macros.tooltip_display('Contextual', 'Contextual functions can only be used when the context is known') }} + {% endif %} + +

{{ body['content']['details'] | safe }}

{{ macros.tooltip_display('引数', 'Parameters are the inputs to a function. They are specified in parentheses after the function name.', prefix='parameters') }} @@ -22,7 +31,34 @@

{% endif %} {% for method in body['content']['scope'] %} -

{{ method['name'] }}

+

+ {{ method['name'] }} + + + {% if method['element'] %} + {{ macros.tooltip_display('Element', 'Element functions can be customized with set and show rules.') }} + {% endif %} + {% if method['contextual'] %} + {{ macros.tooltip_display('Contextual', 'Contextual functions can only be used when the context is known') }} + {% endif %} + + {% if method['deprecation'] %} + +
+ + + Warning + + + +
+ + {{ method['deprecation'] }} + +
+ {% endif %} +

{{ macros.function_display(method, type2href, type2class, gen_path, prefix='definitions-' + method['name']) }} {% endfor %} diff --git a/templates/type_template.html.j2 b/templates/type_template.html.j2 index fc7f9d10c6..f4606ff69b 100644 --- a/templates/type_template.html.j2 +++ b/templates/type_template.html.j2 @@ -20,7 +20,17 @@ {% endif %} {% for method in body['content']['scope'] %} -

{{ method['name'] }}

+

+ {{ method['name'] }} + + {% if method['element'] %} + {{ macros.tooltip_display('Element', 'Element functions can be customized with set and show rules.') }} + {% endif %} + {% if method['contextual'] %} + {{ macros.tooltip_display('Contextual', 'Contextual functions can only be used when the context is known') }} + {% endif %} + +

{{ macros.function_display(method, type2href, type2class, gen_path, prefix='definitions-' + method['name']) }} {% endfor %}