Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -200,5 +200,10 @@ credits = [ · 199 unmodified lines | ||
| 200 | 200 | '2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors', |
| 201 | 201 | 'MIT', |
| 202 | 202 | 'https://raw.github.com/jashkenas/underscore/master/LICENSE' |
| 203 | + ], [ | |
| 204 | + 'Yii', | |
| 205 | + '2008-2014 by Yii Software LLC', | |
| 206 | + 'BSD', | |
| 207 | + 'https://raw.github.com/yiisoft/yii/master/LICENSE' | |
| 203 | 208 | ] |
| 204 | 209 | ] |
| @@ -24,7 +24,10 @@ newsItem = (date, news) -> · 23 unmodified lines | ||
| 24 | 24 | result |
| 25 | 25 | |
| 26 | 26 | app.news = [ |
| 27 | − [ 1394236800000, # March 8, 2014 | |
| 27 | + [ 1394928000000, # March 16, 2013 | |
| 28 | + """ New <a href="/yii/">Yii</a> documentation """, | |
| 29 | + ], [ | |
| 30 | + 1394236800000, # March 8, 2014 | |
| 28 | 31 | """ Added path bar. """, |
| 29 | 32 | ], [ |
| 30 | 33 | 1393027200000, # February 22, 2014 |
| @@ -0,0 +1,15 @@ | ||
| 1 | +#= require views/pages/base | |
| 2 | + | |
| 3 | +class app.views.YiiPage extends app.views.BasePage | |
| 4 | + @events: | |
| 5 | + click: 'onClick' | |
| 6 | + | |
| 7 | + onClick: (event) -> | |
| 8 | + return unless event.target.classList.contains 'show' | |
| 9 | + $.stopEvent(event) | |
| 10 | + | |
| 11 | + source = $ '.code', event.target.parentNode.parentNode | |
| 12 | + isShown = source.style.display is 'block' | |
| 13 | + | |
| 14 | + source.style.display = if isShown then 'none' else 'block' | |
| 15 | + event.target.textContent = if isShown then 'show' else 'hide' | |
| @@ -48,4 +48,5 @@ · 47 unmodified lines | ||
| 48 | 48 | 'pages/rfc', |
| 49 | 49 | 'pages/sphinx', |
| 50 | 50 | 'pages/underscore', |
| 51 | − 'pages/yard'; | |
| 51 | + 'pages/yard', | |
| 52 | + 'pages/yii'; | |
| @@ -50,3 +50,4 @@ · 49 unmodified lines | ||
| 50 | 50 | ._icon-moment:before { background-position: -1rem -7rem; } |
| 51 | 51 | ._icon-c:before { background-position: -2rem -7rem; } |
| 52 | 52 | %icon-path { background-position: -3rem -7rem; } |
| 53 | +._icon-yii:before { background-position: -4rem -7rem; } | |
| @@ -0,0 +1,24 @@ | ||
| 1 | +._yii { | |
| 2 | + h2 { @extend %block-heading; } | |
| 3 | + > h3 { @extend %block-label, %label-blue; } | |
| 4 | + | |
| 5 | + .paramNameCol { font-weight: bold; } | |
| 6 | + .signature2 { margin: .4em 0; } | |
| 7 | + .sourceCode { margin-bottom: 1em; } | |
| 8 | + .sourceCode > .code { display: none; } | |
| 9 | + | |
| 10 | + .SeeAlso { | |
| 11 | + > h4 { | |
| 12 | + margin-bottom: 1em; | |
| 13 | + font-size: inherit; | |
| 14 | + } | |
| 15 | + | |
| 16 | + > ul { margin-top: 0; } | |
| 17 | + } | |
| 18 | + | |
| 19 | + .summaryTable td:first-child[rowspan] { | |
| 20 | + border-right: 1px solid #e5e5e5; | |
| 21 | + | |
| 22 | + + td { border-left: 0; } | |
| 23 | + } | |
| 24 | +} | |
| @@ -2,47 +2,32 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Yii |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | + at_css('h1').content = 'Yii PHP Framework' if root_page? | |
| 5 | 6 | |
| 6 | − #remove irrelevant content | |
| 7 | − css('div').each do |node| | |
| 8 | − if node['class'] == "layout-main-header" | |
| 9 | − node.remove | |
| 10 | − elsif node['class'] == "layout-main-submenu" | |
| 11 | − node.remove | |
| 12 | − elsif node['class'] == "layout-main-shortcuts" | |
| 13 | − node.remove | |
| 14 | − elsif node['class'] == "layout-main-footer" | |
| 15 | − node.remove | |
| 16 | − elsif node['class'] == "grid_3 alpha" | |
| 17 | − node.remove | |
| 18 | − elsif node['class'] == "comments" | |
| 19 | − node.remove | |
| 20 | − elsif node['class'] == "api-suggest clearfix" | |
| 21 | − node.remove | |
| 22 | − elsif node['id'] == "comments" | |
| 23 | − node.remove | |
| 24 | − elsif node['id'] == "nav" | |
| 25 | − node.remove | |
| 26 | − else | |
| 27 | − end | |
| 28 | − end | |
| 7 | + css('.api-suggest', '.google-ad', '.g-plusone', '#nav', '#comments').remove | |
| 29 | 8 | |
| 30 | − # Put code blocks in <pre> tags | |
| 31 | − css('.code').each do |node| | |
| 9 | + css('.summary > p > .toggle').each do |node| | |
| 10 | + node.parent.remove | |
| 11 | + end | |
| 12 | + | |
| 13 | + css('.signature', '.signature2').each do |node| | |
| 32 | 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' | |
| 33 | 20 | end |
| 34 | 21 | |
| 35 | − #remove Hide inherited methods / properties and show links | |
| 36 | − css('a').each do |node| | |
| 37 | − if node['class'] == 'toggle' | |
| 38 | − node.remove | |
| 39 | − elsif node['class'] == 'show' | |
| 40 | − node.remove | |
| 41 | − end | |
| 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 | |
| 42 | 27 | end |
| 43 | 28 | |
| 44 | 29 | doc |
| 45 | 30 | end |
| 46 | 31 | end |
| 47 | 32 | end |
| 48 | −end | |
| 33 | +end | |
| @@ -1,30 +1,21 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Yii |
| 3 | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | − | |
| 5 | 4 | def get_name |
| 6 | − #class names exist in the <h1> content. | |
| 7 | − name = at_css('h1').content.strip | |
| 5 | + at_css('h1').content.strip | |
| 8 | 6 | end |
| 9 | 7 | |
| 10 | 8 | def get_type |
| 11 | − #need to get the table with a class of summaryTable. Then we need the content of the first td in the first tr. | |
| 12 | − type = css('table.summaryTable td')[0].content | |
| 13 | − type | |
| 9 | + css('.summaryTable td').first.content | |
| 14 | 10 | end |
| 15 | 11 | |
| 16 | 12 | def additional_entries |
| 17 | − css('table.summaryTable tr[id]').inject [] do |entries,node| | |
| 18 | − #need to ignore inherited methods and properties | |
| 19 | − if (node['class'] != 'inherited' and node.parent().parent()['class'] == "summary docMethod") | |
| 20 | − #name should be Class.method() id will take you to the link in the summary block. | |
| 21 | − name = slug + "." + node['id'] + "()" | |
| 22 | − entries << [name, node['id']] | |
| 23 | − end | |
| 24 | − 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']] | |
| 25 | 17 | end |
| 26 | 18 | end |
| 27 | − | |
| 28 | 19 | end |
| 29 | 20 | end |
| 30 | −end | |
| 21 | +end | |
| @@ -1,12 +1,15 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Yii < UrlScraper |
| 3 | − self.name = 'Yii' | |
| 4 | − self.slug = 'yii' | |
| 5 | 3 | self.type = 'yii' |
| 6 | 4 | self.version = '1.1.14' |
| 7 | 5 | self.base_url = 'http://www.yiiframework.com/doc/api/1.1/' |
| 8 | 6 | |
| 9 | 7 | html_filters.push 'yii/clean_html', 'yii/entries' |
| 10 | 8 | |
| 9 | + options[:container] = '.grid_9' | |
| 10 | + options[:attribution] = <<-HTML | |
| 11 | + © 2008–2014 by Yii Software LLC<br> | |
| 12 | + Licensed under the three clause BSD license. | |
| 13 | + HTML | |
| 11 | 14 | end |
| 12 | 15 | end |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +http://www.yiiframework.com/logo/ | |