Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.

Revamps clients/tools/modules #230

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,13 @@ def not_found(locals = {path: nil})
@redis_tools = JSON.parse(File.read(documentation_path + "/tools.json"))

@clients_by_language = @clients.group_by { |info| info["language"] }.sort_by { |name, _| name.downcase }

@redis_tools = @redis_tools.sort_by {|t| [ t["active"] ? 0 : 1, t["github"] && t["github"]["stars"] ? -t["github"]["stars"] : 0, t["name"].downcase ]}
custom_render("clients")
end

on get, "modules" do
@modules = JSON.parse(File.read(documentation_path + "/modules.json"))
@modules = @modules.sort_by {|m| -m["stars"]}
@modules = @modules.sort_by {|m| [ m["active"] ? 0 : 1, -m["stars"], m["name"].downcase ]}
custom_render("modules")
end

Expand Down
2 changes: 1 addition & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test:
cutest $(TEST_FILES)

deploy:
cd /srv/redis-doc && git pull
cd /srv/redis-doc && git stash && git pull
cd /srv/redis-io && git stash && git pull
bash --login -c "cd /srv/redis-io && rvm use 2.7.0 && REDIS_DOC=/srv/redis-doc /srv/redis-io/scripts/generate_interactive_commands.rb > /srv/redis-io/lib/interactive/commands.rb"
service redis-io-app restart
Expand Down
2 changes: 2 additions & 0 deletions public/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,12 @@ body { background-color: white; color: #333333; padding: 0; margin: 0; }
#clients h2 { margin: 2em 0 1em 0; text-align: left; }
#clients .icon { color: #333333; font-size: 20px; }
#clients .icon-star { color: #ffe00d; }
#clients .icon-heart { color: #d42e15; }
#clients table { table-layout: fixed; }
#clients table td, #clients table th { padding: 0.8em; border-bottom: 1px solid #efefef; }
#clients table td.description { color: #666666; font-size: 0.9em; }
#clients table td.authors { text-align: right; }
#clients table td.stars { white-space: nowrap; }
#clients col.homepage, #clients col.recommended, #clients col.active, #clients col.repository { width: 1em; }
#clients col.authors { width: 120px; }
#clients .twitter-avatar { width: 36px; height: 36px; }
Expand Down
55 changes: 42 additions & 13 deletions views/clients.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
%h1 Clients

%p
The recommended client(s) for a language are marked with a <i class="fa fa-star icon icon-star"></i>.
The recommended client(s) for a language are marked with a <i class="fa fa-heart icon icon-heart"></i>.

%p
Clients with some activity in the official repository within the latest six months are marked with a <i class="fa fa-smile-o icon"></i>.
Clients with some activity in their GitHub repository within the last six months are marked with a <i class="fa fa-smile-o icon"></i>.

%p
Want
%strong your client listed here?
Expand All @@ -32,25 +33,27 @@
%col(class="recommended")
%col(class="homepage")
%col(class="repository")
%col(class="stars")
%col(class="description")
%col(class="authors")

- @clients_by_language.each do |language, clients|
%tr
%th(colspan="7")
%th(colspan="8")
%h2(id="#{anchorize_language(language)}")= language

- clients.sort_by { |c| c["name"].downcase }.each do |client|
- clients.sort_by { |c| [ c["active"] ? 0 : 1, c["github"] && c["github"]["stars"] ? -c["github"]["stars"] : 0, c["name"].downcase ]}.each do |client|
%tr
%td
= client["name"]

%td
- if client["active"]
%i(class="fa fa-smile-o icon")

%td
- if client["recommended"]
%i(class="fa fa-star icon icon-star")
- if client["recommended"] && client["active"]
%i(class="fa fa-heart icon icon-heart")

%td
- if client["url"]
Expand All @@ -62,6 +65,11 @@
%a(href="#{client["repository"]}" class="icon")
%i(class="fa fa-code-fork")

%td.stars
- if client["github"] && client["github"]["stars"]
#{client["github"]["stars"]}
Comment on lines +69 to +70
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- if client["github"] && client["github"]["stars"]
#{client["github"]["stars"]}
#{client.fetch("github", {}).fetch("stars", 0)}

Will always put something here, and simplifies error handling.

%i(class="fa fa-star icon icon-star")

%td.description
= client["description"]

Expand All @@ -74,26 +82,47 @@
%h1(style="margin-top:80px") Higher level libraries and tools

%p
This is an additional list of libraries that are not direct layers on top of the Redis API, but higher level libraries such as ORMs, messaging libraries, and other misc tools that are designed for Redis.
This is an additional list of libraries that are not direct layers on top of the Redis API, but rather higher level libraries such as ORMs, messaging libraries, and other misc tools that are designed for Redis.

%table
%col(class="name")
%col(class="active")
%col(class="homepage")
%col(class="repository")
%col(class="stars")
%col(class="description")
%col(class="authors")

- @redis_tools.each do |tool|
- tool["description"] += " (#{tool['language']})"
%tr
%td
= tool["name"]

%td
- if tool["repository"]
%a(href="#{tool["repository"]}") Repository
- if tool["active"]
%i(class="fa fa-smile-o icon")

%td
- if tool["url"]
%a(href="#{tool["url"]}") Homepage
%a(href="#{tool["url"]}" class="icon")
%i(class="fa fa-home")

%td
- tool["authors"].each do |author|
%a(href="http://twitter.com/#{author}")= author
- if tool["repository"]
%a(href="#{tool["repository"]}" class="icon")
%i(class="fa fa-code-fork")

%td
%td.stars
- if tool["github"] && tool["github"]["stars"]
#{tool["github"]["stars"]}
%i(class="fa fa-star icon icon-star")

%td.description
= tool["description"]

%td.authors
- if tool["authors"]
- tool["authors"].each do |author|
%a(href="https://twitter.com/#{author}")
%img(src="//twitter-avatars.herokuapp.com/avatar/#{author}" alt="#{author}" class="twitter-avatar")
22 changes: 18 additions & 4 deletions views/modules.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,35 @@
%h1 Redis Modules

%p
This is a list of Redis modules, for Redis v4.0 or greater, ordered by Github stars. This list contains two set of modules: modules under an OSI approved license, and modules that are under some proprietary license. Non OSI modules are clearly flagged as not open source. Also to have the source code hosted at Github is currently mandatory. To add your module here please send a pull request for <a href="https://git.1-hub.cnredis/redis-doc/blob/master/modules.json">the modules.json file</a> in the <a href="https://git.1-hub.cnredis/redis-doc">Redis-doc</a> repository. <a href="https://redislabs.com/community/redis-modules-hub/">More information about Redis modules can be found here</a>.
This is a list of Redis modules, for Redis v4.0 or greater, ordered by activity and Github stars.

%p
Modules with some activity in their GitHub repository within the last six months are marked with a <i class="fa fa-smile-o icon"></i>.

%p
This list contains two types of modules: modules under an OSI approved license, and modules that are under some proprietary license. Non-OSI modules are clearly flagged as not open source. Also to have the source code hosted at Github is currently mandatory.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RSL and pHash modules aren't really "clearly marked", they have the license listed but I would argue that is not un-ambiguous.


%p
To add your module here please send a pull request for <a href="https://git.1-hub.cnredis/redis-doc/blob/master/modules.json">the modules.json file</a> in the <a href="https://git.1-hub.cnredis/redis-doc">Redis-doc</a> repository. <a href="https://redislabs.com/community/redis-modules-hub/">More information about Redis modules can be found here</a>.

%table
%col(class="name")
%col(class="license")
%col(class="stars")
%col(class="active")
%col(class="repository")
%col(class="description")
%col(class="authors")
%col(class="license")
%col(class="stars")

- @modules.each do |mod|
%tr
%td
= mod["name"]

%td
- if mod["active"]
%i(class="fa fa-smile-o icon")

%td
- if mod["repository"]
%a(href="#{mod["repository"]}" class="icon")
Expand All @@ -36,6 +50,6 @@
%td
= mod["license"]

%td
%td.stars
#{mod["stars"]}
%i(class="fa fa-star icon-star")