Closes #157.
Unified · Split
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ "2015-02-15", |
| 3 | − "New <a href=\"/iojs/\">io.js</a> documentation" | |
| 3 | + "New <a href=\"/iojs/\">io.js</a> and <a href=\"/yii1/\">Yii 1.1</a> documentations" | |
| 4 | 4 | ], [ |
| 5 | 5 | "2015-02-08", |
| 6 | 6 | "New dark theme\nClick the icon in the bottom left corner to activate.\n<a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\">Feedback</a> welcome :)" |
| @@ -52,6 +52,7 @@ · 51 unmodified lines | ||
| 52 | 52 | ._icon-c:before { background-position: -2rem -7rem; } |
| 53 | 53 | %icon-path { background-position: -3rem -7rem; } |
| 54 | 54 | ._icon-yii:before { background-position: -4rem -7rem; } |
| 55 | +._icon-yii1:before { background-position: -4rem -7rem; } | |
| 55 | 56 | ._icon-cpp:before { background-position: 0 -8rem; } |
| 56 | 57 | ._icon-go:before { background-position: -1rem -8rem; } |
| 57 | 58 | ._icon-express:before { background-position: -2rem -8rem; } |
| @@ -0,0 +1,33 @@ | ||
| 1 | +module Docs | |
| 2 | + class Yii1 | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + at_css('h1').content = 'Yii PHP Framework' if root_page? | |
| 6 | + | |
| 7 | + css('.api-suggest', '.google-ad', '.g-plusone', '#nav', '#comments').remove | |
| 8 | + | |
| 9 | + css('.summary > p > .toggle').each do |node| | |
| 10 | + node.parent.remove | |
| 11 | + end | |
| 12 | + | |
| 13 | + css('.signature', '.signature2').each do |node| | |
| 14 | + node.name = 'pre' | |
| 15 | + node.inner_html = node.inner_html.strip | |
| 16 | + end | |
| 17 | + | |
| 18 | + css('div.detailHeader').each do |node| | |
| 19 | + node.name = 'h3' | |
| 20 | + end | |
| 21 | + | |
| 22 | + css('.sourceCode > .code > code').each do |node| | |
| 23 | + parent = node.parent | |
| 24 | + parent.name = 'pre' | |
| 25 | + node.remove | |
| 26 | + parent.inner_html = node.first_element_child.inner_html.strip | |
| 27 | + end | |
| 28 | + | |
| 29 | + doc | |
| 30 | + end | |
| 31 | + end | |
| 32 | + end | |
| 33 | +end | |
| @@ -0,0 +1,21 @@ | ||
| 1 | +module Docs | |
| 2 | + class Yii1 | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content.strip | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + css('.summaryTable td').first.content | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + css('.detailHeader').inject [] do |entries, node| | |
| 14 | + name = node.child.content.strip | |
| 15 | + name.prepend self.name + (node.next_element.content.include?('public static') ? '::' : '->') | |
| 16 | + entries << [name, node['id']] | |
| 17 | + end | |
| 18 | + end | |
| 19 | + end | |
| 20 | + end | |
| 21 | +end | |
| @@ -0,0 +1,17 @@ | ||
| 1 | +module Docs | |
| 2 | + class Yii1 < UrlScraper | |
| 3 | + self.name = 'Yii 1' | |
| 4 | + self.slug = 'yii1' | |
| 5 | + self.type = 'yii' | |
| 6 | + self.version = '1.1.16' | |
| 7 | + self.base_url = 'http://www.yiiframework.com/doc/api/1.1/' | |
| 8 | + | |
| 9 | + html_filters.push 'yii1/clean_html', 'yii1/entries' | |
| 10 | + | |
| 11 | + options[:container] = '.grid_9' | |
| 12 | + options[:attribution] = <<-HTML | |
| 13 | + © 2008–2015 by Yii Software LLC<br> | |
| 14 | + Licensed under the three clause BSD license. | |
| 15 | + HTML | |
| 16 | + end | |
| 17 | +end | |