mirror of https://github.com/freeCodeCamp/devdocs
parent
0f08f25b42
commit
836a9ea8bf
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 32 KiB |
@ -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
|
||||
© 2006–2013 Salvatore Sanfilippo and others<br>
|
||||
Licensed under the three clause BSD license.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 865 B |
After Width: | Height: | Size: 1.6 KiB |
@ -0,0 +1 @@
|
||||
http://redis.io/documentation
|
Loading…
Reference in new issue