Преглед на файлове

Update Redis documentation (up to 3.2.0)

Thibaut Courouble преди 9 години
родител
ревизия
4586dfa543
променени са 3 файла, в които са добавени 9 реда и са изтрити 3 реда
  1. 1 1
      assets/stylesheets/pages/_redis.scss
  2. 7 1
      lib/docs/filters/redis/clean_html.rb
  3. 1 1
      lib/docs/scrapers/redis.rb

+ 1 - 1
assets/stylesheets/pages/_redis.scss

@@ -19,7 +19,7 @@
 
   // Others
 
-  > h1, > h2, > .metadata, > h1 ~ p { margin-left: -1rem; }
+  > h1, > h2, > .metadata, > h1 ~ p, > h1 + pre { margin-left: -1rem; }
   > h2 ~ p { margin-left: 0; }
 
   > h2 { @extend %block-heading; }

+ 7 - 1
lib/docs/filters/redis/clean_html.rb

@@ -2,7 +2,13 @@ module Docs
   class Redis
     class CleanHtmlFilter < Filter
       def call
-        at_css('ul')['class'] = 'commands' if root_page?
+        if root_page?
+          at_css('ul')['class'] = 'commands'
+        else
+          title = at_css('h1')
+          title.after("<pre>#{title.content.strip}</pre>")
+          title.content = title.content.split(' ').first
+        end
 
         css('nav', 'aside', 'form', '.anchor-link').remove
 

+ 1 - 1
lib/docs/scrapers/redis.rb

@@ -1,7 +1,7 @@
 module Docs
   class Redis < UrlScraper
     self.type = 'redis'
-    self.release = 'up to 3.0.7'
+    self.release = 'up to 3.2.0'
     self.base_url = 'http://redis.io/commands'
     self.links = {
       home: 'http://redis.io/',