Add CodeIgniter Documentation

This commit is contained in:
Phil Scherer 2015-12-08 19:53:20 -05:00 committed by Thibaut Courouble
parent 578ba0acab
commit 8232a0538a
11 changed files with 121 additions and 1 deletions

View file

@ -0,0 +1,6 @@
#= require views/pages/base
class app.views.CodeigniterPage extends app.views.BasePage
prepare: ->
@highlightCode @findAllByTag('pre'), 'php'
return

View file

@ -36,6 +36,7 @@
'pages/cakephp',
'pages/chai',
'pages/clojure',
'pages/codeigniter',
'pages/coffeescript',
'pages/d3',
'pages/dojo',

View file

@ -36,6 +36,7 @@
'pages/cakephp',
'pages/chai',
'pages/clojure',
'pages/codeigniter',
'pages/coffeescript',
'pages/d3',
'pages/dojo',

View file

@ -0,0 +1,6 @@
._codeigniter {
@extend %sphinx;
.important { @extend %note-orange; }
.warning { @extend %note-red; }
}

View file

@ -1,4 +1,4 @@
._sphinx {
%sphinx {
h2, h3 { @extend %block-heading; }
dl:not(.docutils) > dt { @extend %block-label, %label-blue; }
dt + dt { margin-top: -.5em; }
@ -24,3 +24,7 @@
ul.simple { margin: 1em 0; }
}
._sphinx {
@extend %sphinx
}

View file

@ -0,0 +1,24 @@
module Docs
class Codeigniter
class CleanHtmlFilter < Filter
def call
css('.headerlink').remove
css('h1', 'h2', 'h3', 'h4', 'h5', 'pre').each do |node|
node.content = node.content
end
css('table').each do |node|
node.remove_attribute 'border'
end
css('.section > h2', '.section > h3', '.section > h4', '.section > h5').each do |node|
node['id'] = node.parent['id']
node.parent.remove_attribute 'id'
end
doc.children
end
end
end
end

View file

@ -0,0 +1,42 @@
module Docs
class Codeigniter
class EntriesFilter < Docs::EntriesFilter
def include_default_entry?
not slug.ends_with? 'index'
end
def get_name
at_css('h1').content.strip
end
def get_type
slug.split('/')[0].capitalize
end
def additional_entries
entries = []
css('.class').each do |c_node|
c_name = c_node.at_css('dt > .descname').content
c_id = c_node.at_css('dt')['id']
entries << [c_name, c_id, get_type]
c_node.css('.method').each do |node|
m_name = node.at_css('.descname').content
name = c_name + '::' + m_name + '()'
id = node.at_css('dt')['id']
entries << [name, id, get_type]
end
end
css('.function').each do |node|
name = node.at_css('.descname').content + '()'
id = node.at_css('dt')['id']
entries << [name, id, get_type]
end
entries
end
end
end
end

View file

@ -0,0 +1,35 @@
module Docs
class Codeigniter < UrlScraper
self.name = 'CodeIgniter'
self.type = 'codeigniter'
self.release = '3.0'
self.base_url = 'http://www.codeigniter.com/user_guide/'
self.root_path = 'index.html'
self.links = {
home: 'http://codeigniter.com/',
code: 'https://github.com/bcit-ci/CodeIgniter'
}
html_filters.push 'codeigniter/clean_html', 'codeigniter/entries'
options[:container] = '.document'
options[:only_patterns] = [
/\Ageneral/,
/\Alibraries/,
/\Adatabase/,
/\Ahelpers/
]
options[:skip] = %w(
general/welcome.html
general/requirements.html
general/credits.html
)
options[:attribution] = <<-HTML
&copy; British Columbia Institute of Technology<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 882 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -0,0 +1 @@
http://www.codeigniter.com/assets/data/ci-logo.zip