Skip to content

Commit 9acea0d

Browse files
Merge pull request #952 from redis/DOC-4623-java-code-tab-issues
DOC-4623 attempted fix for tab issues
2 parents cc7673e + d59601b commit 9acea0d

File tree

7 files changed

+21
-13
lines changed

7 files changed

+21
-13
lines changed

build/components/example.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@
1111
GO_OUTPUT = 'Output:'
1212
TEST_MARKER = {
1313
'java': '@Test',
14+
'java-sync': '@Test',
15+
'java-async': '@Test',
16+
'java-reactive': '@Test',
1417
'c#': '\[Fact\]|\[SkipIfRedis\(.*\)\]'
1518
}
1619
PREFIXES = {
1720
'python': '#',
1821
'node.js': '//',
1922
'java': '//',
23+
'java-sync': '//',
24+
'java-async': '//',
25+
'java-reactive': '//',
2026
'go': '//',
2127
'c#': '//',
2228
'redisvl': '#',

config.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ tagManagerId = "GTM-TKZ6J9R"
4545
gitHubRepo = "https://github.com/redis/docs"
4646

4747
# Display and sort order for client examples
48-
clientsExamples = ["Python", "Node.js", "Java Sync", "Java Async", "Java Reactive", "Go", "C#", "RedisVL"]
48+
clientsExamples = ["Python", "Node.js", "Java-Sync", "Java-Async", "Java-Reactive", "Go", "C#", "RedisVL"]
4949
searchService = "/convai/api/search-service"
5050
ratingsService = "/docusight/api/rate"
5151

@@ -59,9 +59,9 @@ rdi_cli_latest = "latest"
5959
[params.clientsConfig]
6060
"Python"={quickstartSlug="redis-py"}
6161
"Node.js"={quickstartSlug="nodejs"}
62-
"Java sync"={quickstartSlug="jedis"}
63-
"Java async"={quickstartSlug="lettuce"}
64-
"Java reactive"={quickstartSlug="lettuce"}
62+
"Java-sync"={quickstartSlug="jedis"}
63+
"Java-async"={quickstartSlug="lettuce"}
64+
"Java-reactive"={quickstartSlug="lettuce"}
6565
"Go"={quickstartSlug="go"}
6666
"C#"={quickstartSlug="dotnet"}
6767
"RedisVL"={quickstartSlug="redis-vl"}

data/components/jedis.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"id": "jedis",
33
"type": "client",
44
"name": "jedis",
5-
"language": "Java",
6-
"label": "Java Sync",
5+
"language": "Java-Sync",
6+
"label": "Java-Sync",
77
"repository": {
88
"git_uri": "https://github.com/redis/jedis"
99
},

data/components/lettuce_async.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"id": "lettuce_async",
33
"type": "client",
44
"name": "lettuce_async",
5-
"language": "Java",
6-
"label": "Java Async",
5+
"language": "Java-Async",
6+
"label": "Java-Async",
77
"repository": {
88
"git_uri": "https://github.com/redis/lettuce"
99
},

data/components/lettuce_reactive.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"id": "lettuce_reactive",
33
"type": "client",
44
"name": "lettuce_reactive",
5-
"language": "Java",
6-
"label": "Java Reactive",
5+
"language": "Java-Reactive",
6+
"label": "Java-Reactive",
77
"repository": {
88
"git_uri": "https://github.com/redis/lettuce"
99
},

layouts/partials/tabbed-clients-example.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,19 @@
2121
{{ $clientConfig := index $.Site.Params.clientsconfig $client }}
2222
{{ $language := index $example "language" }}
2323
{{ $quickstartSlug := index $clientConfig "quickstartSlug" }}
24-
24+
2525
{{ if and ($example) (or (eq $lang "") (eq $lang $client)) }}
2626
{{ $examplePath := index $example "target" }}
2727
{{ $options := printf "linenos=false" }}
28-
28+
2929
{{ if and (ne $step "") (isset $example "named_steps") (isset $example.named_steps $step) }}
3030
{{ $options = printf "%s,hl_lines=%s" $options (index $example.named_steps $step) }}
3131
{{ else }}
3232
{{ if isset $example "highlight" }}
3333
{{ $options = printf "%s,hl_lines=%s" $options (delimit (index $example "highlight") " ") }}
3434
{{ end }}
3535
{{ end }}
36+
{{ if hasPrefix $language "java" }}{{ $language = "java"}}{{ end }}
3637
{{ $params := dict "language" $language "contentPath" $examplePath "options" $options }}
3738
{{ $content := partial "tabs/source.html" $params }}
3839
{{ $tabs = $tabs | append (dict "title" $client "language" $client "quickstartSlug" $quickstartSlug "content" $content "sourceUrl" (index $example "sourceUrl")) }}

layouts/partials/tabs/wrapper.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
{{ $tid := printf "%s_%s" (replace (replace (index $tab "title") "#" "sharp") "." "") $id }}
1414
{{ $pid := printf "panel_%s" $tid }}
1515
{{ $dataLang := replace (or (index $tab "language") "redis-cli") "C#" "dotnet" }}
16+
{{ $dataLang := replace $dataLang "." "-" }}
1617
<input tabindex="1" type="radio" name="{{ $id }}" id="{{ $tid }}" data-lang="{{ $dataLang }}" class="radiotab w-0 h-0"
1718
{{ if eq $i 0 }}checked{{ end }}
1819
/>
19-
<label class="justify-left label ml-4 pt-3.5 px-3 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900
20+
<label class="justify-left label ml-1.5 pt-3.5 px-1 pb-1 cursor-pointer text-sm text-center bg-redis-ink-900
2021
hover:text-redis-red-600 rounded rounded-mx transition duration-150 ease-in-out"
2122
title="Open example" for="{{ $tid }}">
2223
{{ if eq (index $tab "title") "redis-cli" }}

0 commit comments

Comments
 (0)