diff --git a/assets/images/icons.png b/assets/images/icons.png index ee772616..078c7a04 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 e4ec763a..f5b7694a 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 0ff676c6..dacac194 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,6 +1,6 @@ [ [ "2015-02-15", - "New io.js, Lua and Yii 1.1 documentations" + "New io.js, Clojure, Lua and Yii 1.1 documentations" ], [ "2015-02-08", "New dark theme\nClick the icon in the bottom left corner to activate.\nFeedback welcome :)" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 89aeb866..88fb8a11 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -100,6 +100,11 @@ credits = [ '2011-2015 Jake Luer', 'MIT', 'https://github.com/chaijs/chai/blob/master/README.md#license' + ], [ + 'Clojure', + 'Rich Hickey', + 'EPL', + 'https://github.com/clojure/clojure/blob/master/epl-v10.html' ], [ 'CoffeeScript', '2009-2015 Jeremy Ashkenas', diff --git a/assets/stylesheets/application-dark.css.scss b/assets/stylesheets/application-dark.css.scss index b7818aee..5a8bf467 100644 --- a/assets/stylesheets/application-dark.css.scss +++ b/assets/stylesheets/application-dark.css.scss @@ -32,6 +32,7 @@ 'pages/bower', 'pages/c', 'pages/chai', + 'pages/clojure', 'pages/coffeescript', 'pages/cordova', 'pages/d3', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 5ae93479..acedcc4e 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -32,6 +32,7 @@ 'pages/bower', 'pages/c', 'pages/chai', + 'pages/clojure', 'pages/coffeescript', 'pages/cordova', 'pages/d3', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 171fa2e4..33e73e77 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -87,3 +87,4 @@ %icon-light-white { background-position: -1rem -14rem; } ._icon-iojs:before { background-position: -2rem -14rem; } ._icon-lua:before { background-position: -3rem -14rem; } +._icon-clojure:before { background-position: -4rem -14rem; } diff --git a/assets/stylesheets/pages/_clojure.scss b/assets/stylesheets/pages/_clojure.scss new file mode 100644 index 00000000..9f5e5db4 --- /dev/null +++ b/assets/stylesheets/pages/_clojure.scss @@ -0,0 +1,10 @@ +._clojure { + h2:not([id]) { @extend %block-heading; } + h2[id], h3 { @extend %block-label, %label-blue; } + + .type { + float: right; + font-size: .9em; + color: $textColorLight; + } +} diff --git a/lib/docs/filters/clojure/clean_html.rb b/lib/docs/filters/clojure/clean_html.rb new file mode 100644 index 00000000..1d4b7dc9 --- /dev/null +++ b/lib/docs/filters/clojure/clean_html.rb @@ -0,0 +1,44 @@ +module Docs + class Clojure + class CleanHtmlFilter < Filter + def call + if root_page? + doc.inner_html = '

Clojure

' + return doc + end + + @doc = at_css('#content-tag') + + at_css('h1').content = slug.remove('-api') + + css('> div').each do |node| + node.before(node.children).remove + end + + css('div > h2', 'div > h3').each do |node| + node.parent.before(node.parent.children).remove + end + + css('#proto-type', '#var-type', '#type-type').each do |node| + node.previous_element << node + node['class'] = 'type' + end + + css('.proto-added', '.var-added', '.proto-deprecated', '.var-deprecated').each do |node| + node.content = node.content + node.name = 'p' + end + + css('.proto-added', '.var-added').each do |node| + if node.content == node.next_element.try(:content) + node.remove + end + end + + css('hr', 'br:first-child', 'pre + br', 'h1 + br', 'h2 + br', 'h3 + br', 'p + br', 'br + br').remove + + doc + end + end + end +end diff --git a/lib/docs/filters/clojure/entries.rb b/lib/docs/filters/clojure/entries.rb new file mode 100644 index 00000000..4e2ac0dc --- /dev/null +++ b/lib/docs/filters/clojure/entries.rb @@ -0,0 +1,22 @@ +module Docs + class Clojure + class EntriesFilter < Docs::EntriesFilter + def get_name + slug.remove('-api') + end + + def get_type + 'Namespaces' + end + + def additional_entries + css(".toc-entry-anchor[href^='##{self.name}']").map do |node| + name = node.content + id = node['href'].remove('#') + type = name == 'clojure.core' ? id.split('/').first : self.name + [name, id, type] + end + end + end + end +end diff --git a/lib/docs/scrapers/clojure.rb b/lib/docs/scrapers/clojure.rb new file mode 100644 index 00000000..dbba96bc --- /dev/null +++ b/lib/docs/scrapers/clojure.rb @@ -0,0 +1,18 @@ +module Docs + class Clojure < UrlScraper + self.type = 'clojure' + self.version = '1.6' + self.base_url = 'http://clojure.github.io/clojure/' + self.root_path = 'api-index.html' + + html_filters.push 'clojure/entries', 'clojure/clean_html' + + options[:container] = '#content_view' + options[:only_patterns] = [/\Aclojure\./] + + options[:attribution] = <<-HTML + © Rich Hickey
+ Licensed under the Eclipse Public License 1.0. + HTML + end +end diff --git a/public/icons/docs/clojure/16.png b/public/icons/docs/clojure/16.png new file mode 100644 index 00000000..30e1932a Binary files /dev/null and b/public/icons/docs/clojure/16.png differ diff --git a/public/icons/docs/clojure/16@2x.png b/public/icons/docs/clojure/16@2x.png new file mode 100644 index 00000000..b1936522 Binary files /dev/null and b/public/icons/docs/clojure/16@2x.png differ diff --git a/public/icons/docs/clojure/SOURCE b/public/icons/docs/clojure/SOURCE new file mode 100644 index 00000000..2e1bba85 --- /dev/null +++ b/public/icons/docs/clojure/SOURCE @@ -0,0 +1 @@ +http://en.wikipedia.org/wiki/File:Clojure_logo.gif