-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathcommand-page.html
151 lines (131 loc) · 5.07 KB
/
command-page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
{% extends "right-aside.html" %}
{% import "macros/command.html" as commands %}
{%- block head -%}
{% set upper_slug = page.slug | upper %}
{% set command_description = load_data(path=config.extra.command_description_path ~ page.slug ~ ".md", required= false) %}
{% set command_sources = [
load_data(path= commands::command_json_path(slug= page.slug), required= false),
load_data(path= commands::command_bloom_json_path(slug= page.slug), required= false),
load_data(path= commands::command_json_json_path(slug= page.slug), required= false)
] %}
{% set command_data = command_sources | filter(attribute="") | first %}
{% if command_data %}
{% set command_obj_name = commands::command_obj_name(command_data= command_data) %}
{% set command_data_obj = command_data[command_obj_name] %}
{% if command_data_obj.container %}
{% set command_title = command_data_obj.container ~ " " ~ command_obj_name %}
{% else %}
{% set command_title = command_obj_name %}
{% endif %}
{% set command_title = command_title | upper %}
{% if command_data_obj.deprecated_since %}
{% set deprecated = "Deprecated" %}
{% endif %}
{% else %}
{% set command_data_error = "ERROR. Command JSON Not loaded." %}
{% endif %}
{%- endblock -%}
{% block subhead_content%}
{% if command_title%}<h1 class="page-title">{{ command_title }} {% if deprecated %}<small> {{ deprecated }}</small>{% endif %}</h1>{% endif %}
{% endblock subhead_content%}
{% block main_content %}
{% if command_data_obj %}
<dl>
<dt>Usage:</dt>
<dd>
<code>
{% if command_data_obj.container %}{{ command_data_obj.container }}{% endif %} {{command_obj_name}}
{% if command_data_obj.arguments %}
{{ commands::arguments_parse(argument_array=command_data_obj.arguments) }}
{% endif %}
</code>
</dd>
</dl>
{% if command_data_obj.complexity %}
<dl>
<dt>Complexity:</dt>
<dd>{{ command_data_obj.complexity }}</dd>
<dl>
{% endif %}
{% if command_data_obj.module_since %}
<dl>
{% if "bf." in page.slug %}
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
<dt>Module:</dt>
<dd><a href={{module_reply.valkey_bloom.repo}}>{{module_reply.valkey_bloom.name}}</a></dd>
{% elif "json." in page.slug %}
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
<dt>Module:</dt>
<dd><a href={{module_reply.valkey_json.repo}}>{{module_reply.valkey_json.name}}</a></dd>
{% endif %}
<dl>
<dl>
<dt>Since module version:</dt>
<dd>{{ command_data_obj.module_since }}</dd>
<dl>
{% endif %}
{% if command_data_obj.since %}
<dl>
<dt>Since:</dt>
<dd>{{ command_data_obj.since }}</dd>
<dl>
{% endif %}
</dl>
{% else %}
<code>{{ command_data_error }}</code>
{% endif %}
{% if command_description %}
{%- set command_description_with_fixed_links = commands::fix_links(content= command_description) -%}
{{ command_description_with_fixed_links | markdown | safe }}
{% else %}
<code>ERROR. Command description not loaded</code><br />
{% endif %}
{% set_global resp2_replies = load_data(path="../_data/resp2_replies.json", required=false) -%}
{% set_global resp3_replies = load_data(path="../_data/resp3_replies.json", required=false) -%}
{% if resp2_replies and resp3_replies -%}
{% set resp2_reply = resp2_replies | get(key=command_title, default="") -%}
{% set resp3_reply = resp3_replies | get(key=command_title, default="") -%}
{% if resp2_reply and resp2_reply != "" and resp3_reply and resp3_reply != "" -%}
{% set resp2_reply = resp2_reply | join(sep="\n\n") -%}
{% set resp3_reply = resp3_reply | join(sep="\n\n") -%}
{% if resp2_reply == resp3_reply -%}
<h3>RESP2/RESP3 Reply</h3>
{{ commands::fix_links(content=resp2_reply) | markdown | safe }}
{% else %}
{% if resp2_reply -%}
<h3>RESP2 Reply</h3>
{{ commands::fix_links(content=resp2_reply) | markdown | safe }}
{% endif -%}
{% if resp3_reply -%}
<h3>RESP3 Reply</h3>
{{ commands::fix_links(content=resp3_reply) | markdown | safe }}
{% endif -%}
{% endif -%}
{% endif -%}
{% endif -%}
{% if command_data_obj and command_data_obj.history %}
<h3>History</h3>
<table>
<thead>
<tr>
<th>Version</th>
<th>Change</th>
</tr>
</thead>
<tbody></tbody>
{% for entry in command_data_obj.history%}
<tr>
<td>{{ entry[0] }}</td>
<td>{{ entry[1] | markdown | safe}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endblock main_content %}
{% block related_content %}
<div class="edit_box">
See an error?
<a href="https://github.com/valkey-io/valkey-doc/edit/main/commands/{{ page.slug }}.md">Update this Page on Github!</a>
</div>
{% endblock related_content %}