diff --git a/assets/images/icons.png b/assets/images/icons.png
index 01e9dda8..a9977a65 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 483e2bd2..d9051667 100644
Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ
diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee
index 807646f4..8e4a50df 100644
--- a/assets/javascripts/templates/pages/about_tmpl.coffee
+++ b/assets/javascripts/templates/pages/about_tmpl.coffee
@@ -210,6 +210,11 @@ credits = [
'2009-2014 Salvatore Sanfilippo',
'CC BY-SA',
'http://creativecommons.org/licenses/by-sa/4.0/'
+ ], [
+ 'RequireJS',
+ '2010-2014 The Dojo Foundation',
+ 'MIT',
+ 'https://raw.githubusercontent.com/jrburke/requirejs/master/LICENSE'
], [
'Ruby',
'1993-2014 Yukihiro Matsumoto',
diff --git a/assets/javascripts/templates/pages/news_tmpl.coffee b/assets/javascripts/templates/pages/news_tmpl.coffee
index ec995de1..5dcede7c 100644
--- a/assets/javascripts/templates/pages/news_tmpl.coffee
+++ b/assets/javascripts/templates/pages/news_tmpl.coffee
@@ -24,7 +24,10 @@ newsItem = (date, news) ->
result
app.news = [
- [ 1402704000000, # June 14, 2014
+ [ 1402790400000, # June 15, 2014
+ """ New RequireJS documentation """,
+ ], [
+ 1402704000000, # June 14, 2014
""" New Haskell documentation """,
], [
1400976000000, # May 25, 2014
diff --git a/assets/javascripts/views/pages/requirejs.coffee b/assets/javascripts/views/pages/requirejs.coffee
new file mode 100644
index 00000000..26b448a2
--- /dev/null
+++ b/assets/javascripts/views/pages/requirejs.coffee
@@ -0,0 +1,11 @@
+#= require views/pages/base
+
+class app.views.RequirejsPage extends app.views.BasePage
+ afterRender: ->
+ for el in @findAllByTag 'pre'
+ language = if el.textContent.match(/^\s*)
+ 'markup'
+ else
+ 'javascript'
+ @highlightCode el, language
+ return
diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss
index 2e83da64..937cdd6f 100644
--- a/assets/stylesheets/application.css.scss
+++ b/assets/stylesheets/application.css.scss
@@ -51,6 +51,7 @@
'pages/postgres',
'pages/rdoc',
'pages/redis',
+ 'pages/requirejs',
'pages/rfc',
'pages/sphinx',
'pages/underscore',
diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss
index ef0df71e..76e56a18 100644
--- a/assets/stylesheets/global/_icons.scss
+++ b/assets/stylesheets/global/_icons.scss
@@ -58,3 +58,4 @@
._icon-maxcdn:before { background-position: -4rem -8rem; }
._icon-laravel:before { background-position: 0 -9rem; }
._icon-haskell:before { background-position: -1rem -9rem; }
+._icon-requirejs:before { background-position: -2rem -9rem; }
diff --git a/assets/stylesheets/pages/_requirejs.scss b/assets/stylesheets/pages/_requirejs.scss
new file mode 100644
index 00000000..d186cca4
--- /dev/null
+++ b/assets/stylesheets/pages/_requirejs.scss
@@ -0,0 +1,10 @@
+._requirejs {
+ padding-left: 1rem;
+
+ h1, h2, h3, ul.index { margin-left: -1rem; }
+ h2 { @extend %block-heading; }
+ h3 { @extend %block-label, %label-blue; }
+ h4 { font-size: 1em; }
+
+ ul.index ul { margin: .5em 0; }
+}
diff --git a/lib/docs/filters/requirejs/clean_html.rb b/lib/docs/filters/requirejs/clean_html.rb
new file mode 100644
index 00000000..56d55121
--- /dev/null
+++ b/lib/docs/filters/requirejs/clean_html.rb
@@ -0,0 +1,22 @@
+module Docs
+ class Requirejs
+ class CleanHtmlFilter < Filter
+ def call
+ css('.sectionMark', '.hbox > .sect').remove
+ css('h1 + .note').remove if root_page?
+
+ css('.section', 'pre > code').each do |node|
+ node.before(node.children).remove
+ end
+
+ css('h2', 'h3', 'h4').each do |node|
+ next unless link = node.at_css('a[name]')
+ node['id'] = link['name']
+ link.before(link.children).remove
+ end
+
+ doc
+ end
+ end
+ end
+end
diff --git a/lib/docs/filters/requirejs/entries.rb b/lib/docs/filters/requirejs/entries.rb
new file mode 100644
index 00000000..f2e95d5f
--- /dev/null
+++ b/lib/docs/filters/requirejs/entries.rb
@@ -0,0 +1,35 @@
+module Docs
+ class Requirejs
+ class EntriesFilter < Docs::EntriesFilter
+ def get_name
+ at_css('h1').content
+ end
+
+ def get_type
+ 'Guides'
+ end
+
+ def additional_entries
+ return [] unless root_page?
+
+ entries = []
+ type = nil
+
+ css('*').each do |node|
+ if node.name == 'h2'
+ type = node.content
+ elsif node.name == 'h3' || node.name == 'h4'
+ entries << [node.content, node['id'], type]
+ end
+ end
+
+ css('p[id^="config-"]').each do |node|
+ next if node['id'].include?('note')
+ entries << [node.at_css('strong').content, node['id'], 'Configuration Options']
+ end
+
+ entries
+ end
+ end
+ end
+end
diff --git a/lib/docs/scrapers/requirejs.rb b/lib/docs/scrapers/requirejs.rb
new file mode 100644
index 00000000..a35f36d0
--- /dev/null
+++ b/lib/docs/scrapers/requirejs.rb
@@ -0,0 +1,29 @@
+module Docs
+ class Requirejs < UrlScraper
+ self.name = 'RequireJS'
+ self.type = 'requirejs'
+ self.version = '2.1.4'
+ self.base_url = 'http://requirejs.org/docs/'
+ self.root_path = 'api.html'
+ self.initial_paths = %w(
+ optimization.html
+ jquery.html
+ node.html
+ dojo.html
+ commonjs.html
+ plugins.html
+ why.html
+ whyamd.html)
+
+ html_filters.push 'requirejs/clean_html', 'requirejs/entries'
+
+ options[:container] = '#content'
+ options[:follow_links] = false
+ options[:only] = self.initial_paths
+
+ options[:attribution] = <<-HTML
+ © 2010–2014 The Dojo Foundation
+ Licensed under the MIT License.
+ HTML
+ end
+end
diff --git a/public/icons/docs/requirejs/16.png b/public/icons/docs/requirejs/16.png
new file mode 100644
index 00000000..b516defd
Binary files /dev/null and b/public/icons/docs/requirejs/16.png differ
diff --git a/public/icons/docs/requirejs/16@2x.png b/public/icons/docs/requirejs/16@2x.png
new file mode 100644
index 00000000..ba6706e7
Binary files /dev/null and b/public/icons/docs/requirejs/16@2x.png differ
diff --git a/public/icons/docs/requirejs/SOURCE b/public/icons/docs/requirejs/SOURCE
new file mode 100644
index 00000000..3ebf1b6e
--- /dev/null
+++ b/public/icons/docs/requirejs/SOURCE
@@ -0,0 +1 @@
+http://requirejs.org/