-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parsing the valkey command JSON files (draft only) (#8)
Initial work to parse the command json files from Valkey. * Add submodules for valkey-io/valkey and valkey-io/valkey-doc * Adds a bash script to generate stub files for all the commands * Adds recursive argument template * Adds a command layout (e.g. template for each command) * Two tweaks to SCSS to make it look readable and consistent * Adds a file to render the command listing * Adds all command stubs (generated by the bash script) Signed-off-by: Kyle J. Davis <[email protected]>
- Loading branch information
1 parent
a6a43bd
commit 53318a5
Showing
402 changed files
with
2,114 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,5 @@ _site | |
.jekyll-metadata | ||
vendor | ||
.DS_Store | ||
/_data/commands/ | ||
/_includes/commands/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[submodule "_submodules/valkey"] | ||
path = _submodules/valkey | ||
url = https://github.com/valkey-io/valkey | ||
[submodule "_submodules/valkey-doc"] | ||
path = _submodules/valkey-doc | ||
url = https://github.com/valkey-io/valkey-doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# this bash script generates stubs directories/index files based on the command JSONs | ||
|
||
COMMANDS="./_data/commands/latest/*.json" | ||
for f in $COMMANDS | ||
do | ||
COMMAND=$(basename -- "$f") | ||
COMMAND_FNAME=${COMMAND%.*} | ||
DESCRIPTION_FNAME="./_includes/commands/latest/${COMMAND_FNAME}.md" | ||
echo $DESCRIPTION_FNAME | ||
mkdir ./commands/$COMMAND_FNAME | ||
if [ -f "$DESCRIPTION_FNAME" ]; then | ||
echo "Exists, ${DESCRIPTION_FNAME}" | ||
DESCRIPTION_FRONTMATTER="description: ${COMMAND_FNAME}.md" | ||
else | ||
DESCRIPTION_FRONTMATTER="" | ||
fi | ||
|
||
cat << EOF > ./commands/$COMMAND_FNAME/index.html | ||
--- | ||
layout: command | ||
title: $COMMAND_FNAME | ||
$DESCRIPTION_FRONTMATTER | ||
--- | ||
EOF | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{% for arguments in include.arguments_array %} | ||
|
||
{% capture arguments_str %} | ||
{% if arguments.optional == true %}[{% elsif arguments.type == "oneof"%}〈{%endif%} | ||
{% if arguments.type != "pure-token" and arguments.token %} | ||
{{ arguments.token }} | ||
{% endif %} | ||
{% if arguments.type != "block" and arguments.type != "oneof" %} | ||
{{ arguments.name }} | ||
{% endif %} | ||
|
||
{% if arguments.type == "oneof" %} | ||
{% include command/arguments.html arguments_array=arguments.arguments separator="|" %} | ||
{% else %} | ||
{% include command/arguments.html arguments_array=arguments.arguments %} | ||
{% endif %} | ||
{% if include.separator == "|" and forloop.last == false %} | {% endif %} | ||
|
||
{% if arguments.optional == true %}]{% elsif arguments.type == "oneof"%}〉{%endif%} | ||
{% endcapture %} | ||
{{ arguments_str }} | ||
|
||
{% if arguments.multiple %} | ||
[ {{ arguments_str }} ...] | ||
{% endif %} | ||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
--- | ||
layout: default | ||
--- | ||
|
||
{% for command in site.data.commands.latest[page.title] %} | ||
{% assign command_name = command[0] %} | ||
{% assign command_lower = command[0] | downcase %} | ||
{% assign command_details = command[1] %} | ||
{% capture usage %}{{command_details.container }} {{ command_name }} {% include command/arguments.html arguments_array=command_details.arguments %}{% endcapture %} | ||
<h1 class="page-title">{{command_details.container }} {{ command_name }} | ||
{% if command_details.doc_flags contains "DEPRECATED" %} | ||
<small>Deprecated</small> | ||
{% endif %} | ||
</h1> | ||
<div class="width-limiter"> | ||
<main class="container"> | ||
|
||
<dl> | ||
<dt>Usage:</dt> | ||
<dd><code>{{usage}}</code></dd> | ||
</dl> | ||
<dl> | ||
<dt>Complexity:</dt> | ||
<dd>{{ command_details.complexity }}</dd> | ||
</dl> | ||
<dl> | ||
<dt>Since:</dt> | ||
<dd>{{ command_details.since }}</dd> | ||
</dl> | ||
{% if page.description %} | ||
{% assign command_description_file = "commands/latest/FILE" | replace: "FILE", page.description %} | ||
{% capture description %}{% include {{ command_description_file }} %}{% endcapture %} | ||
{{ description | replace: "@examples", "## Examples" | markdownify }} | ||
{% endif %} | ||
{% if command_details.history %} | ||
<h3>History</h3> | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>Version</th> | ||
<th>Change</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
{% for history_line in command_details.history %} | ||
<tr> | ||
<td>{{history_line[0]}}</td> | ||
<td>{{history_line[1]}}</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
|
||
</table> | ||
{% endif %} | ||
</main> | ||
</div> | ||
|
||
{% endfor %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule valkey-doc
added at
a26a6c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-cat | ||
description: acl-cat.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-deluser | ||
description: acl-deluser.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-dryrun | ||
description: acl-dryrun.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-genpass | ||
description: acl-genpass.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-getuser | ||
description: acl-getuser.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-help | ||
description: acl-help.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-list | ||
description: acl-list.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-load | ||
description: acl-load.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-log | ||
description: acl-log.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-save | ||
description: acl-save.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-setuser | ||
description: acl-setuser.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-users | ||
description: acl-users.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl-whoami | ||
description: acl-whoami.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: acl | ||
description: acl.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: append | ||
description: append.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: asking | ||
description: asking.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: auth | ||
description: auth.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bgrewriteaof | ||
description: bgrewriteaof.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bgsave | ||
description: bgsave.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bitcount | ||
description: bitcount.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bitfield | ||
description: bitfield.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bitfield_ro | ||
description: bitfield_ro.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bitop | ||
description: bitop.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bitpos | ||
description: bitpos.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: blmove | ||
description: blmove.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: blmpop | ||
description: blmpop.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: blpop | ||
description: blpop.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: brpop | ||
description: brpop.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: brpoplpush | ||
description: brpoplpush.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bzmpop | ||
description: bzmpop.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bzpopmax | ||
description: bzpopmax.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: bzpopmin | ||
description: bzpopmin.md | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
layout: command | ||
title: client-caching | ||
description: client-caching.md | ||
--- |
Oops, something went wrong.