Unified · Split
| @@ -0,0 +1,6 @@ | ||
| 1 | +#= require views/pages/base | |
| 2 | + | |
| 3 | +class app.views.CodeigniterPage extends app.views.BasePage | |
| 4 | + prepare: -> | |
| 5 | + @highlightCode @findAllByTag('pre'), 'php' | |
| 6 | + return | |
| @@ -36,6 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | 'pages/cakephp', |
| 37 | 37 | 'pages/chai', |
| 38 | 38 | 'pages/clojure', |
| 39 | + 'pages/codeigniter', | |
| 39 | 40 | 'pages/coffeescript', |
| 40 | 41 | 'pages/d3', |
| 41 | 42 | 'pages/dojo', |
| @@ -36,6 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | 'pages/cakephp', |
| 37 | 37 | 'pages/chai', |
| 38 | 38 | 'pages/clojure', |
| 39 | + 'pages/codeigniter', | |
| 39 | 40 | 'pages/coffeescript', |
| 40 | 41 | 'pages/d3', |
| 41 | 42 | 'pages/dojo', |
| @@ -0,0 +1,6 @@ | ||
| 1 | +._codeigniter { | |
| 2 | + @extend %sphinx; | |
| 3 | + | |
| 4 | + .important { @extend %note-orange; } | |
| 5 | + .warning { @extend %note-red; } | |
| 6 | +} | |
| @@ -1,4 +1,4 @@ | ||
| 1 | −._sphinx { | |
| 1 | +%sphinx { | |
| 2 | 2 | h2, h3 { @extend %block-heading; } |
| 3 | 3 | dl:not(.docutils) > dt { @extend %block-label, %label-blue; } |
| 4 | 4 | dt + dt { margin-top: -.5em; } |
| @@ -24,3 +24,7 @@ · 19 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | ul.simple { margin: 1em 0; } |
| 26 | 26 | } |
| 27 | + | |
| 28 | +._sphinx { | |
| 29 | + @extend %sphinx | |
| 30 | +} | |
| @@ -0,0 +1,24 @@ | ||
| 1 | +module Docs | |
| 2 | + class Codeigniter | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + css('.headerlink').remove | |
| 6 | + | |
| 7 | + css('h1', 'h2', 'h3', 'h4', 'h5', 'pre').each do |node| | |
| 8 | + node.content = node.content | |
| 9 | + end | |
| 10 | + | |
| 11 | + css('table').each do |node| | |
| 12 | + node.remove_attribute 'border' | |
| 13 | + end | |
| 14 | + | |
| 15 | + css('.section > h2', '.section > h3', '.section > h4', '.section > h5').each do |node| | |
| 16 | + node['id'] = node.parent['id'] | |
| 17 | + node.parent.remove_attribute 'id' | |
| 18 | + end | |
| 19 | + | |
| 20 | + doc.children | |
| 21 | + end | |
| 22 | + end | |
| 23 | + end | |
| 24 | +end | |
| @@ -0,0 +1,42 @@ | ||
| 1 | +module Docs | |
| 2 | + class Codeigniter | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def include_default_entry? | |
| 5 | + not slug.ends_with? 'index' | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_name | |
| 9 | + at_css('h1').content.strip | |
| 10 | + end | |
| 11 | + | |
| 12 | + def get_type | |
| 13 | + slug.split('/')[0].capitalize | |
| 14 | + end | |
| 15 | + | |
| 16 | + def additional_entries | |
| 17 | + entries = [] | |
| 18 | + | |
| 19 | + css('.class').each do |c_node| | |
| 20 | + c_name = c_node.at_css('dt > .descname').content | |
| 21 | + c_id = c_node.at_css('dt')['id'] | |
| 22 | + entries << [c_name, c_id, get_type] | |
| 23 | + | |
| 24 | + c_node.css('.method').each do |node| | |
| 25 | + m_name = node.at_css('.descname').content | |
| 26 | + name = c_name + '::' + m_name + '()' | |
| 27 | + id = node.at_css('dt')['id'] | |
| 28 | + entries << [name, id, get_type] | |
| 29 | + end | |
| 30 | + end | |
| 31 | + | |
| 32 | + css('.function').each do |node| | |
| 33 | + name = node.at_css('.descname').content + '()' | |
| 34 | + id = node.at_css('dt')['id'] | |
| 35 | + entries << [name, id, get_type] | |
| 36 | + end | |
| 37 | + | |
| 38 | + entries | |
| 39 | + end | |
| 40 | + end | |
| 41 | + end | |
| 42 | +end | |
| @@ -0,0 +1,35 @@ | ||
| 1 | +module Docs | |
| 2 | + class Codeigniter < UrlScraper | |
| 3 | + self.name = 'CodeIgniter' | |
| 4 | + self.type = 'codeigniter' | |
| 5 | + self.release = '3.0' | |
| 6 | + self.base_url = 'http://www.codeigniter.com/user_guide/' | |
| 7 | + self.root_path = 'index.html' | |
| 8 | + self.links = { | |
| 9 | + home: 'http://codeigniter.com/', | |
| 10 | + code: 'https://github.com/bcit-ci/CodeIgniter' | |
| 11 | + } | |
| 12 | + | |
| 13 | + html_filters.push 'codeigniter/clean_html', 'codeigniter/entries' | |
| 14 | + | |
| 15 | + options[:container] = '.document' | |
| 16 | + | |
| 17 | + options[:only_patterns] = [ | |
| 18 | + /\Ageneral/, | |
| 19 | + /\Alibraries/, | |
| 20 | + /\Adatabase/, | |
| 21 | + /\Ahelpers/ | |
| 22 | + ] | |
| 23 | + | |
| 24 | + options[:skip] = %w( | |
| 25 | + general/welcome.html | |
| 26 | + general/requirements.html | |
| 27 | + general/credits.html | |
| 28 | + ) | |
| 29 | + | |
| 30 | + options[:attribution] = <<-HTML | |
| 31 | + © British Columbia Institute of Technology<br> | |
| 32 | + Licensed under the MIT License. | |
| 33 | + HTML | |
| 34 | + end | |
| 35 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +http://www.codeigniter.com/assets/data/ci-logo.zip | |