diff --git a/assets/images/icons.png b/assets/images/icons.png
index d40465a1..e7a734d8 100644
Binary files a/assets/images/icons.png and b/assets/images/icons.png differ
diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png
index d9608bac..ef9ead26 100644
Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ
diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json
index e7402374..ae65407a 100644
--- a/assets/javascripts/news.json
+++ b/assets/javascripts/news.json
@@ -1,5 +1,8 @@
[
[
+ "2016-02-28",
+ "New documentation: CodeIgniter"
+ ], [
"2016-02-15",
"New documentations: CakePHP, Chef and Ramda"
], [
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index ada7e612..16b27f0c 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -119,6 +119,11 @@ credits = [
'Rich Hickey',
'EPL',
'https://github.com/clojure/clojure/blob/master/epl-v10.html'
+ ], [
+ 'CodeIgniter',
+ '2014-2016 British Columbia Institute of Technology',
+ 'MIT',
+ 'https://raw.githubusercontent.com/bcit-ci/CodeIgniter/develop/license.txt'
], [
'CoffeeScript',
'2009-2015 Jeremy Ashkenas',
diff --git a/assets/javascripts/views/pages/codeigniter.coffee b/assets/javascripts/views/pages/codeigniter.coffee
deleted file mode 100644
index 606ecae4..00000000
--- a/assets/javascripts/views/pages/codeigniter.coffee
+++ /dev/null
@@ -1,6 +0,0 @@
-#= require views/pages/base
-
-class app.views.CodeigniterPage extends app.views.BasePage
- prepare: ->
- @highlightCode @findAllByTag('pre'), 'php'
- return
diff --git a/assets/javascripts/views/pages/sphinx.coffee b/assets/javascripts/views/pages/sphinx.coffee
index 94aa51d7..faecdd71 100644
--- a/assets/javascripts/views/pages/sphinx.coffee
+++ b/assets/javascripts/views/pages/sphinx.coffee
@@ -4,4 +4,5 @@ class app.views.SphinxPage extends app.views.BasePage
prepare: ->
@highlightCode @findAll('pre.python'), 'python'
@highlightCode @findAll('pre.markup'), 'markup'
+ @highlightCode @findAll('pre.php'), 'php'
return
diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss
index 2ba96e28..6e9a310f 100644
--- a/assets/stylesheets/application-dark.css.scss
+++ b/assets/stylesheets/application-dark.css.scss
@@ -36,7 +36,6 @@
'pages/cakephp',
'pages/chai',
'pages/clojure',
- 'pages/codeigniter',
'pages/coffeescript',
'pages/d3',
'pages/dojo',
diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss
index d3bf5c58..35e24aac 100644
--- a/assets/stylesheets/application.css.scss
+++ b/assets/stylesheets/application.css.scss
@@ -36,7 +36,6 @@
'pages/cakephp',
'pages/chai',
'pages/clojure',
- 'pages/codeigniter',
'pages/coffeescript',
'pages/d3',
'pages/dojo',
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index ad8675b5..e049947a 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -126,3 +126,4 @@
._icon-erlang:before { background-position: -1rem -10rem; }
._icon-chef:before { background-position: -2rem -10rem; }
._icon-ramda:before { background-position: -3rem -10rem; @extend %darkIconFix !optional; }
+._icon-codeigniter:before { background-position: -4rem -10rem; @extend %darkIconFix !optional; }
diff --git a/assets/stylesheets/pages/_codeigniter.scss b/assets/stylesheets/pages/_codeigniter.scss
deleted file mode 100644
index 5cda3059..00000000
--- a/assets/stylesheets/pages/_codeigniter.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-._codeigniter {
- @extend %sphinx;
-
- .important { @extend %note-orange; }
- .warning { @extend %note-red; }
-}
diff --git a/assets/stylesheets/pages/_sphinx.scss b/assets/stylesheets/pages/_sphinx.scss
index 35351cf1..bb4293e2 100644
--- a/assets/stylesheets/pages/_sphinx.scss
+++ b/assets/stylesheets/pages/_sphinx.scss
@@ -4,7 +4,8 @@
dt + dt { margin-top: -.5em; }
.note, .admonition, .versionadded, .versionchanged, .deprecated-removed { @extend %note; }
- .deprecated-removed { @extend %note-red; }
+ .important { @extend %note-orange; }
+ .warning, .deprecated-removed { @extend %note-red; }
.versionmodified { font-weight: bold; }
p > code, li > code { @extend %label; }
@@ -26,5 +27,5 @@
}
._sphinx {
- @extend %sphinx
+ @extend %sphinx;
}
diff --git a/lib/docs/filters/codeigniter/clean_html.rb b/lib/docs/filters/codeigniter/clean_html.rb
index 6571f249..9b2da1e8 100644
--- a/lib/docs/filters/codeigniter/clean_html.rb
+++ b/lib/docs/filters/codeigniter/clean_html.rb
@@ -8,16 +8,22 @@ module Docs
node.content = node.content
end
+ css('div[class^="highlight-"]').each do |node|
+ node.content = node.content.strip
+ node.name = 'pre'
+ node['class'] = 'php' if node['class'].include?('highlight-ci')
+ 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'
+ css('.section').each do |node|
+ node.first_element_child['id'] = node['id'] if node['id']
+ node.before(node.children).remove
end
- doc.children
+ doc
end
end
end
diff --git a/lib/docs/filters/codeigniter/entries.rb b/lib/docs/filters/codeigniter/entries.rb
index 06e7dfa0..1f3f1ace 100644
--- a/lib/docs/filters/codeigniter/entries.rb
+++ b/lib/docs/filters/codeigniter/entries.rb
@@ -1,38 +1,43 @@
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
+ type = slug.split('/').first.capitalize
+
+ if type.in? %w(Tutorial Installation Overview General)
+ type.prepend 'User guide: '
+ elsif type.in? %w(Libraries Helpers)
+ type = name.remove %r{\ (?:Helper|Class|Classes|Library|Driver)\z}
+ end
+
+ type
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]
+ css('.class').each do |node|
+ class_name = node.at_css('dt > .descname').content
+ class_id = node.at_css('dt[id]')['id']
+ entries << [class_name, class_id]
- 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]
+ node.css('.method').each do |n|
+ name = n.at_css('.descname').content
+ name = "#{class_name}::#{name}()"
+ id = node.at_css('dt[id]')['id']
+ entries << [name, id]
end
end
css('.function').each do |node|
- name = node.at_css('.descname').content + '()'
- id = node.at_css('dt')['id']
- entries << [name, id, get_type]
+ name = "#{node.at_css('.descname').content}()"
+ id = node.at_css('dt[id]')['id']
+ type = self.type.start_with?('User guide') ? 'Functions' : self.type
+ entries << [name, id, type]
end
entries
diff --git a/lib/docs/scrapers/codeigniter.rb b/lib/docs/scrapers/codeigniter.rb
index 9b8670f4..62b44a01 100644
--- a/lib/docs/scrapers/codeigniter.rb
+++ b/lib/docs/scrapers/codeigniter.rb
@@ -1,12 +1,11 @@
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.type = 'sphinx'
+ self.base_url = 'https://www.codeigniter.com/user_guide/'
self.root_path = 'index.html'
self.links = {
- home: 'http://codeigniter.com/',
+ home: 'https://codeigniter.com/',
code: 'https://github.com/bcit-ci/CodeIgniter'
}
@@ -14,22 +13,30 @@ module Docs
options[:container] = '.document'
- options[:only_patterns] = [
- /\Ageneral/,
- /\Alibraries/,
- /\Adatabase/,
- /\Ahelpers/
- ]
-
options[:skip] = %w(
+ license.html
+ changelog.html
+ DCO.html
general/welcome.html
general/requirements.html
general/credits.html
+ libraries/index.html
+ helpers/index.html
)
+ options[:skip_patterns] = [
+ /\Acontributing/,
+ /\Adocumentation/,
+ /\Ainstallation\/upgrade/
+ ]
+
options[:attribution] = <<-HTML
- © British Columbia Institute of Technology
+ © 2014–2016 British Columbia Institute of Technology
Licensed under the MIT License.
HTML
+
+ version '3.0' do
+ self.release = '3.0.4'
+ end
end
end
diff --git a/public/icons/docs/codeigniter/16.png b/public/icons/docs/codeigniter/16.png
index a49b9f02..2a63e97f 100644
Binary files a/public/icons/docs/codeigniter/16.png and b/public/icons/docs/codeigniter/16.png differ
diff --git a/public/icons/docs/codeigniter/16@2.png b/public/icons/docs/codeigniter/16@2.png
deleted file mode 100644
index a202fc8c..00000000
Binary files a/public/icons/docs/codeigniter/16@2.png and /dev/null differ
diff --git a/public/icons/docs/codeigniter/16@2x.png b/public/icons/docs/codeigniter/16@2x.png
new file mode 100644
index 00000000..ab8f1545
Binary files /dev/null and b/public/icons/docs/codeigniter/16@2x.png differ