Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/actions/build-site/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,22 @@ runs:
repository: valkey-io/valkey-search
path: valkey-search

- name: Checkout valkey-large-object
if: inputs.checkout-content == 'true'
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
repository: valkey-io/valkey-large-object
path: valkey-large-object

- name: Init commands and topics
shell: bash
working-directory: ${{ inputs.path }}
run: |
./build/init-topics.sh ../valkey-doc/topics
./build/init-commands.sh ../valkey-doc/commands \
../valkey/src/commands ../valkey-bloom/src/commands \
../valkey-json/src/commands ../valkey-search/src/commands
../valkey-json/src/commands ../valkey-search/src/commands \
../valkey-large-object/src/commands

- name: Build only
uses: shalzz/zola-deploy-action@1be083648a1db2853ce4970e381740c0e2fd06de # v0.23.6
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ build-command-docs
build-command-json
build-json-command-json
build-search-command-json
build-large-object-command-json
build-topics
content/commands/*
!content/commands/_index.md
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Commit your changes to your local copy of `valkey-io/valkey-doc`.
### Building the command reference

The command reference (i.e. `/commands/set/`, `/commands/get/`, `/commands/lolwut/`) sources information from `valkey-io/valkey`, `valkey-io/valkey-bloom`, and `valkey-io/valkey-doc`.
`valkey-io/valkey`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json` and `valkey-io/valkey-search` provides the command metadata (items like computational complexity, version history, arguments, etc)
`valkey-io/valkey`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json`, `valkey-io/valkey-search` and `valkey-io/valkey-large-object` provides the command metadata (items like computational complexity, version history, arguments, etc)
whilst `valkey-io/valkey-doc` provides the command description and the command reply.

```mermaid
Expand All @@ -91,8 +91,8 @@ flowchart TD
H --> J[Files: /resp2_replies.json,<br/>/resp3_replies.json] --> Z[Command Reply]
```

Let's say that this repo and your local copy of `valkey-io/valkey-doc`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json`, `valkey-io/valkey-search`
and `valkey-io/valkey` reside in the same directories.
Let's say that this repo and your local copy of `valkey-io/valkey-doc`, `valkey-io/valkey-bloom`, `valkey-io/valkey-json`, `valkey-io/valkey-search`,
`valkey-io/valkey-large-object` and `valkey-io/valkey` reside in the same directories.

First, stop the `zola serve` process if you're running it.
From the root directory of this repo run:
Expand All @@ -101,7 +101,8 @@ From the root directory of this repo run:
# You should only need to run this once or when you add a new command,
# or when a command's group or container changes.
./build/init-commands.sh ../valkey-doc/commands ../valkey/src/commands \
../valkey-bloom/src/commands ../valkey-json/src/commands ../valkey-search/src/commands
../valkey-bloom/src/commands ../valkey-json/src/commands ../valkey-search/src/commands \
../valkey-large-object/src/commands
```

The script uses [jq](https://jqlang.org/), if installed, to store each command's group and container for the documentation menu.
Expand Down
9 changes: 9 additions & 0 deletions build/init-commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ if [ ! -d "$5" ]; then
exit 1
fi

if [ ! -d "$6" ]; then
echo "The Large Object module command JSON directory must exist and be a valid path"
exit 1
fi

# Uppercase aliases (/commands/GET/) collide with the lowercase pages
# (/commands/get/) on case-insensitive filesystems (macOS default). Since
# Zola 0.23, `zola build` may then write the alias redirect over the real
Expand All @@ -62,6 +67,7 @@ ln -sfn $2 ./build-command-json
ln -sfn $3 ./build-bloom-command-json
ln -sfn $4 ./build-json-command-json
ln -sfn $5 ./build-search-command-json
ln -sfn $6 ./build-large-object-command-json

# The documentation menu needs each command's full name, container and group.
# They're written to the stub files below (using jq), so that the templates
Expand Down Expand Up @@ -93,6 +99,9 @@ do
elif [ -f "$5/$command.json" ]; then
metadata_path="/commands/$command.json in the 'valkey-search' repo"
json_file="$5/$command.json"
elif [ -f "$6/$command.json" ]; then
metadata_path="/commands/$command.json in the 'valkey-large-object' repo"
json_file="$6/$command.json"
fi
# TOML lines with the command's name, container and group, for the menu.
menu_data=""
Expand Down
4 changes: 3 additions & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ command_json_path = "../build-command-json/"
command_bloom_json_path = "../build-bloom-command-json/"
command_json_json_path = "../build-json-command-json/"
command_search_json_path = "../build-search-command-json/"
command_large_object_json_path = "../build-large-object-command-json/"
doc_topic_path = "../build-topics/"

# Documentation menu. The core menu is nav.yml in the valkey docs, next to
Expand All @@ -39,7 +40,7 @@ doc_topic_path = "../build-topics/"
# menu only has the command reference.
nav_path = "../build-topics/../nav.yml"
nav_sources_path = "../build-topics/../modules-nav/"
nav_sources = ["valkey-bloom", "valkey-json", "valkey-search", "valkey-ldap", "valkey-bundle"]
nav_sources = ["valkey-bloom", "valkey-json", "valkey-search", "valkey-ldap", "valkey-bundle", "valkey-large-object"]

# Topics with known problems, shown with a "This page is under review" note.
review_list = [
Expand All @@ -53,3 +54,4 @@ review_list = [
"valkey-json" = "module"
"valkey-search" = "module"
"valkey-ldap" = "module"
"valkey-large-object" = "module"
18 changes: 17 additions & 1 deletion templates/command-page.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
load_data(path= config.extra.command_json_path ~ page.slug ~ ".json", required= false),
load_data(path= config.extra.command_bloom_json_path ~ page.slug ~ ".json", required= false),
load_data(path= config.extra.command_json_json_path ~ page.slug ~ ".json", required= false),
load_data(path= config.extra.command_search_json_path ~ page.slug ~ ".json", required= false)
load_data(path= config.extra.command_search_json_path ~ page.slug ~ ".json", required= false),
load_data(path= config.extra.command_large_object_json_path ~ page.slug ~ ".json", required= false)
] %}

{% set command_data = [s for s in command_sources if s] | first %}
Expand Down Expand Up @@ -85,6 +86,17 @@
<h1 class="docs-page-title">{{ command_title }} {% if deprecated %}<small> {{ deprecated }}</small>{% endif %}</h1>
{% endif %}
{% if command_data_obj %}
{% set notice_modules = load_data(path="../_data/modules.json", required=false) -%}
{% if notice_modules %}
{% for notice_key, notice_module in notice_modules %}
{% if notice_module.version_notice and notice_module.command_prefix and page.slug is starting_with(pat=notice_module.command_prefix) %}
{% set notice_url = get_url(path="/topics/" ~ notice_module.topic, trailing_slash=true) %}
<blockquote>
<p><strong>Note:</strong> {% for part in notice_module.version_notice | split(pat=notice_module.name) %}{% if not loop.first %}<a href="{{ notice_url }}">{{ notice_module.name }}</a>{% endif %}{{ part }}{% endfor %}</p>
</blockquote>
{% endif %}
{% endfor %}
{% endif %}
<dl>
<dt>Usage:</dt>
<dd>
Expand Down Expand Up @@ -117,6 +129,10 @@ <h1 class="docs-page-title">{{ command_title }} {% if deprecated %}<small> {{ de
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
<dt>Module:</dt>
<dd><a href={{module_reply.valkey_search.repo}}>{{module_reply.valkey_search.name}}</a></dd>
{% elif "blob." in page.slug %}
{% set module_reply = load_data(path="../_data/modules.json", required=false) -%}
<dt>Module:</dt>
<dd><a href={{module_reply.valkey_large_object.repo}}>{{module_reply.valkey_large_object.name}}</a></dd>
{% endif %}
</dl>
<dl>
Expand Down
3 changes: 2 additions & 1 deletion templates/commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ <h4>We couldn't find any results matching your search</h4>
config.extra.command_json_path ~ page.slug ~ ".json",
config.extra.command_bloom_json_path ~ page.slug ~ ".json",
config.extra.command_json_json_path ~ page.slug ~ ".json",
config.extra.command_search_json_path ~ page.slug ~ ".json"
config.extra.command_search_json_path ~ page.slug ~ ".json",
config.extra.command_large_object_json_path ~ page.slug ~ ".json"
] %}
{% set command_data = load_data(path= json_path, required= false) %}
{% if command_data %}
Expand Down
2 changes: 1 addition & 1 deletion templates/macros/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
{%- if page.extra?.command_name -%}
{%- set_global index = [...index, {"name": page.extra.command_name, "container": page.extra.command_container, "group": page.extra.command_group, "slug": page.slug}] -%}
{%- else -%}
{%- for json_path in [extra.command_json_path, extra.command_bloom_json_path, extra.command_json_json_path, extra.command_search_json_path] -%}
{%- for json_path in [extra.command_json_path, extra.command_bloom_json_path, extra.command_json_json_path, extra.command_search_json_path, extra.command_large_object_json_path] -%}
{%- set data = load_data(path=json_path ~ page.slug ~ ".json", required=false) -%}
{%- if data -%}
{%- set key = data | keys | first -%}
Expand Down