Add Redis documentation

pull/29/head
Thibaut 11 years ago
parent 0f08f25b42
commit 836a9ea8bf

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 32 KiB

@ -148,6 +148,11 @@ credits = [
'1990-2013 Python Software Foundation<br>Python is a trademark of the Python Software Foundation.',
'PSFL',
'http://docs.python.org/3/license.html'
], [
'Redis',
'2006-2013 Salvatore Sanfilippo and others',
'BSD',
'https://raw.github.com/antirez/redis/unstable/COPYING'
], [
'Ruby',
'1993-2013 Yukihiro Matsumoto',

@ -25,7 +25,7 @@ newsItem = (date, news) ->
app.news = [
[ 1386892800000, # December 13, 2013
""" New <a href="/git/">Git</a> documentation """
""" New <a href="/git/">Git</a> and <a href="/git/">Redis</a> documentations """
], [
1385424000000, # November 26, 2013
""" New <a href="/python/">Python</a> documentation """

@ -38,6 +38,7 @@
'pages/node',
'pages/php',
'pages/rdoc',
'pages/redis',
'pages/rfc',
'pages/sphinx',
'pages/underscore',

@ -87,7 +87,7 @@ abbr, acronym, dfn {
border-bottom: 1px dotted $textColor;
}
pre, code, samp {
pre, code, samp, %pre {
font-family: $monoFont;
font-weight: normal;
font-style: normal;
@ -98,7 +98,7 @@ pre, code, samp {
tab-size: 2;
}
pre {
pre, %pre {
margin: 1.5em 0;
padding: .375rem .75rem;
line-height: 1.5;

@ -43,3 +43,4 @@
._icon-rails:before { background-position: -4rem -5rem; }
._icon-python:before { background-position: 0 -6rem; }
._icon-git:before { background-position: -1rem -6rem; }
._icon-redis:before { background-position: -2rem -6rem; }

@ -0,0 +1,44 @@
._redis {
// Index
> .commands {
padding-left: 0;
list-style: none;
> li { margin-bottom: 1em; }
}
.command, .summary { display: block; }
.args {
font-size: .75rem;
color: $textColorLight;
}
// Others
> h2 { @extend %block-heading; }
p > code { @extend %label; }
> .metadata { @extend %note, %note-green; }
> .metadata > p { margin: 0; }
> .example {
white-space: normal;
@extend %pre;
> .prompt {
float: left;
margin-right: .5em;
color: $textColorLight;
}
> code {
display: block;
clear: left;
margin-bottom: .5em;
&:last-child { margin-bottom: 0; }
}
}
}

@ -0,0 +1,21 @@
module Docs
class Redis
class CleanHtmlFilter < Filter
def call
at_css('ul')['class'] = 'commands' if root_page?
css('nav', 'aside', 'form').remove
css('> article', 'pre > code').each do |node|
node.before(node.children).remove
end
css('.example > pre').each do |node|
node.name = 'code'
end
doc
end
end
end
end

@ -0,0 +1,26 @@
module Docs
class Redis
class EntriesFilter < Docs::EntriesFilter
def get_name
slug.gsub('-', ' ')
end
def get_type
case at_css('aside > ul:last-child a').content.strip
when 'DEL' then 'Keys'
when 'APPEND' then 'Strings'
when 'HDEL' then 'Hashes'
when 'BLPOP' then 'Lists'
when 'SADD' then 'Sets'
when 'ZADD' then 'Sorted Sets'
when 'PSUBSCRIBE' then 'Pub/Sub'
when 'DISCARD' then 'Transactions'
when 'EVAL' then 'Scripting'
when 'AUTH' then 'Connection'
when 'BGREWRITEAOF' then 'Server'
else 'Miscellaneous'
end
end
end
end
end

@ -0,0 +1,19 @@
module Docs
class Redis < UrlScraper
self.type = 'redis'
self.version = 'up to 2.8.3'
self.base_url = 'http://redis.io/commands'
html_filters.push 'redis/entries', 'redis/clean_html', 'title'
options[:container] = ->(filter) { filter.root_page? ? '#commands' : '.text' }
options[:title] = false
options[:root_title] = 'Redis'
options[:follow_links] = ->(filter) { filter.root_page? }
options[:attribution] = <<-HTML
&copy; 2006&ndash;2013 Salvatore Sanfilippo and others<br>
Licensed under the three clause BSD license.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 865 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

@ -0,0 +1 @@
http://redis.io/documentation
Loading…
Cancel
Save