diff --git a/lib/docs/filters/yii/clean_html.rb b/lib/docs/filters/yii/clean_html.rb new file mode 100644 index 00000000..5adebcc6 --- /dev/null +++ b/lib/docs/filters/yii/clean_html.rb @@ -0,0 +1,48 @@ +module Docs + class Yii + class CleanHtmlFilter < Filter + def call + + #remove irrelevant content + css('div').each do |node| + if node['class'] == "layout-main-header" + node.remove + elsif node['class'] == "layout-main-submenu" + node.remove + elsif node['class'] == "layout-main-shortcuts" + node.remove + elsif node['class'] == "layout-main-footer" + node.remove + elsif node['class'] == "grid_3 alpha" + node.remove + elsif node['class'] == "comments" + node.remove + elsif node['class'] == "api-suggest clearfix" + node.remove + elsif node['id'] == "comments" + node.remove + elsif node['id'] == "nav" + node.remove + else + end + end + + # Put code blocks in
 tags
+        css('.code').each do |node|
+          node.name = 'pre'
+        end
+
+        #remove Hide inherited methods / properties and show links
+        css('a').each do |node|
+          if node['class'] == 'toggle'
+            node.remove
+          elsif node['class'] == 'show'
+            node.remove
+          end
+        end
+
+        doc
+      end
+    end
+  end
+end
\ No newline at end of file
diff --git a/lib/docs/filters/yii/entries.rb b/lib/docs/filters/yii/entries.rb
new file mode 100644
index 00000000..803d32be
--- /dev/null
+++ b/lib/docs/filters/yii/entries.rb
@@ -0,0 +1,30 @@
+module Docs
+  class Yii
+    class EntriesFilter < Docs::EntriesFilter
+
+      def get_name
+        #class names exist in the 

content. + name = at_css('h1').content.strip + end + + def get_type + #need to get the table with a class of summaryTable. Then we need the content of the first td in the first tr. + type = css('table.summaryTable td')[0].content + type + end + + def additional_entries + css('table.summaryTable tr[id]').inject [] do |entries,node| + #need to ignore inherited methods and properties + if (node['class'] != 'inherited' and node.parent().parent()['class'] == "summary docMethod") + #name should be Class.method() id will take you to the link in the summary block. + name = slug + "." + node['id'] + "()" + entries << [name, node['id']] + end + entries + end + end + + end + end +end \ No newline at end of file diff --git a/lib/docs/scrapers/yii.rb b/lib/docs/scrapers/yii.rb new file mode 100755 index 00000000..4467319b --- /dev/null +++ b/lib/docs/scrapers/yii.rb @@ -0,0 +1,12 @@ +module Docs + class Yii < UrlScraper + self.name = 'Yii' + self.slug = 'yii' + self.type = 'yii' + self.version = '1.1.14' + self.base_url = 'http://www.yiiframework.com/doc/api/1.1/' + + html_filters.push 'yii/clean_html', 'yii/entries' + + end +end diff --git a/public/icons/docs/yii/16.png b/public/icons/docs/yii/16.png new file mode 100644 index 00000000..85a6ad44 Binary files /dev/null and b/public/icons/docs/yii/16.png differ diff --git a/public/icons/docs/yii/16@2x.png b/public/icons/docs/yii/16@2x.png new file mode 100644 index 00000000..5d613ab4 Binary files /dev/null and b/public/icons/docs/yii/16@2x.png differ