diff --git a/lib/docs/filters/yii/clean_html.rb b/lib/docs/filters/yii/clean_html.rb index 5adebcc6..2596b26e 100644 --- a/lib/docs/filters/yii/clean_html.rb +++ b/lib/docs/filters/yii/clean_html.rb @@ -2,6 +2,7 @@ module Docs class Yii class CleanHtmlFilter < Filter def call +<<<<<<< HEAD #remove irrelevant content css('div').each do |node| @@ -41,6 +42,52 @@ module Docs end end +======= + + #remove meaningless 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 + + #remove javascript show links + css('b').each do |node| + if node['class'] == "show" + node.remove + end + end + + # Put code blocks in
tags + css('.code').each do |node| + node.name = 'pre' + end + + #remove "Hide inherited methods / properties + css('a').each do |node| + if node['class'] == 'toggle' + node.remove + end + end + +>>>>>>> 9150005... Initial addition of the filters,scraper, and icons. doc end end diff --git a/lib/docs/filters/yii/clean_html.rb.orig b/lib/docs/filters/yii/clean_html.rb.orig new file mode 100644 index 00000000..b64d341f --- /dev/null +++ b/lib/docs/filters/yii/clean_html.rb.orig @@ -0,0 +1,95 @@ +module Docs + class Yii + class CleanHtmlFilter < Filter + def call +<<<<<<< HEAD + + #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 intags + 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 + +======= + + #remove meaningless 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 + + #remove javascript show links + css('b').each do |node| + if node['class'] == "show" + node.remove + end + end + + # Put code blocks intags + css('.code').each do |node| + node.name = 'pre' + end + + #remove "Hide inherited methods / properties + css('a').each do |node| + if node['class'] == 'toggle' + node.remove + end + end + +>>>>>>> 9150005... Initial addition of the filters,scraper, and icons. + doc + end + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/yii/entries.rb.BACKUP.16566.rb b/lib/docs/filters/yii/entries.rb.BACKUP.16566.rb new file mode 100644 index 00000000..3c450a23 --- /dev/null +++ b/lib/docs/filters/yii/entries.rb.BACKUP.16566.rb @@ -0,0 +1,56 @@ +module Docs + class Yii + class EntriesFilter < Docs::EntriesFilter +<<<<<<< HEAD + +======= + +>>>>>>> 9150005... Initial addition of the filters,scraper, and icons. + def get_name + #class names exist in thecontent. + name = at_css('h1').content.strip + end +<<<<<<< HEAD + + 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 + +======= + + 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 + +>>>>>>> 9150005... Initial addition of the filters,scraper, and icons. + end + end +end \ No newline at end of file diff --git a/lib/docs/filters/yii/entries.rb.BASE.16566.rb b/lib/docs/filters/yii/entries.rb.BASE.16566.rb new file mode 100644 index 00000000..e69de29b diff --git a/lib/docs/filters/yii/entries.rb.LOCAL.16566.rb b/lib/docs/filters/yii/entries.rb.LOCAL.16566.rb new file mode 100644 index 00000000..803d32be --- /dev/null +++ b/lib/docs/filters/yii/entries.rb.LOCAL.16566.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/filters/yii/entries.rb.REMOTE.16566.rb b/lib/docs/filters/yii/entries.rb.REMOTE.16566.rb new file mode 100644 index 00000000..5e6056bf --- /dev/null +++ b/lib/docs/filters/yii/entries.rb.REMOTE.16566.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