Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -210,6 +210,11 @@ credits = [ · 209 unmodified lines | ||
| 210 | 210 | '2009-2014 Salvatore Sanfilippo', |
| 211 | 211 | 'CC BY-SA', |
| 212 | 212 | 'http://creativecommons.org/licenses/by-sa/4.0/' |
| 213 | + ], [ | |
| 214 | + 'RequireJS', | |
| 215 | + '2010-2014 The Dojo Foundation', | |
| 216 | + 'MIT', | |
| 217 | + 'https://raw.githubusercontent.com/jrburke/requirejs/master/LICENSE' | |
| 213 | 218 | ], [ |
| 214 | 219 | 'Ruby', |
| 215 | 220 | '1993-2014 Yukihiro Matsumoto', |
| @@ -24,7 +24,10 @@ newsItem = (date, news) -> · 23 unmodified lines | ||
| 24 | 24 | result |
| 25 | 25 | |
| 26 | 26 | app.news = [ |
| 27 | − [ 1402704000000, # June 14, 2014 | |
| 27 | + [ 1402790400000, # June 15, 2014 | |
| 28 | + """ New <a href="/requirejs/">RequireJS</a> documentation """, | |
| 29 | + ], [ | |
| 30 | + 1402704000000, # June 14, 2014 | |
| 28 | 31 | """ New <a href="/haskell/">Haskell</a> documentation """, |
| 29 | 32 | ], [ |
| 30 | 33 | 1400976000000, # May 25, 2014 |
| @@ -0,0 +1,11 @@ | ||
| 1 | +#= require views/pages/base | |
| 2 | + | |
| 3 | +class app.views.RequirejsPage extends app.views.BasePage | |
| 4 | + afterRender: -> | |
| 5 | + for el in @findAllByTag 'pre' | |
| 6 | + language = if el.textContent.match(/^\s*</) | |
| 7 | + 'markup' | |
| 8 | + else | |
| 9 | + 'javascript' | |
| 10 | + @highlightCode el, language | |
| 11 | + return | |
| @@ -51,6 +51,7 @@ · 50 unmodified lines | ||
| 51 | 51 | 'pages/postgres', |
| 52 | 52 | 'pages/rdoc', |
| 53 | 53 | 'pages/redis', |
| 54 | + 'pages/requirejs', | |
| 54 | 55 | 'pages/rfc', |
| 55 | 56 | 'pages/sphinx', |
| 56 | 57 | 'pages/underscore', |
| @@ -58,3 +58,4 @@ · 57 unmodified lines | ||
| 58 | 58 | ._icon-maxcdn:before { background-position: -4rem -8rem; } |
| 59 | 59 | ._icon-laravel:before { background-position: 0 -9rem; } |
| 60 | 60 | ._icon-haskell:before { background-position: -1rem -9rem; } |
| 61 | +._icon-requirejs:before { background-position: -2rem -9rem; } | |
| @@ -0,0 +1,10 @@ | ||
| 1 | +._requirejs { | |
| 2 | + padding-left: 1rem; | |
| 3 | + | |
| 4 | + h1, h2, h3, ul.index { margin-left: -1rem; } | |
| 5 | + h2 { @extend %block-heading; } | |
| 6 | + h3 { @extend %block-label, %label-blue; } | |
| 7 | + h4 { font-size: 1em; } | |
| 8 | + | |
| 9 | + ul.index ul { margin: .5em 0; } | |
| 10 | +} | |
| @@ -0,0 +1,22 @@ | ||
| 1 | +module Docs | |
| 2 | + class Requirejs | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + css('.sectionMark', '.hbox > .sect').remove | |
| 6 | + css('h1 + .note').remove if root_page? | |
| 7 | + | |
| 8 | + css('.section', 'pre > code').each do |node| | |
| 9 | + node.before(node.children).remove | |
| 10 | + end | |
| 11 | + | |
| 12 | + css('h2', 'h3', 'h4').each do |node| | |
| 13 | + next unless link = node.at_css('a[name]') | |
| 14 | + node['id'] = link['name'] | |
| 15 | + link.before(link.children).remove | |
| 16 | + end | |
| 17 | + | |
| 18 | + doc | |
| 19 | + end | |
| 20 | + end | |
| 21 | + end | |
| 22 | +end | |
| @@ -0,0 +1,35 @@ | ||
| 1 | +module Docs | |
| 2 | + class Requirejs | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + 'Guides' | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + return [] unless root_page? | |
| 14 | + | |
| 15 | + entries = [] | |
| 16 | + type = nil | |
| 17 | + | |
| 18 | + css('*').each do |node| | |
| 19 | + if node.name == 'h2' | |
| 20 | + type = node.content | |
| 21 | + elsif node.name == 'h3' || node.name == 'h4' | |
| 22 | + entries << [node.content, node['id'], type] | |
| 23 | + end | |
| 24 | + end | |
| 25 | + | |
| 26 | + css('p[id^="config-"]').each do |node| | |
| 27 | + next if node['id'].include?('note') | |
| 28 | + entries << [node.at_css('strong').content, node['id'], 'Configuration Options'] | |
| 29 | + end | |
| 30 | + | |
| 31 | + entries | |
| 32 | + end | |
| 33 | + end | |
| 34 | + end | |
| 35 | +end | |
| @@ -0,0 +1,29 @@ | ||
| 1 | +module Docs | |
| 2 | + class Requirejs < UrlScraper | |
| 3 | + self.name = 'RequireJS' | |
| 4 | + self.type = 'requirejs' | |
| 5 | + self.version = '2.1.4' | |
| 6 | + self.base_url = 'http://requirejs.org/docs/' | |
| 7 | + self.root_path = 'api.html' | |
| 8 | + self.initial_paths = %w( | |
| 9 | + optimization.html | |
| 10 | + jquery.html | |
| 11 | + node.html | |
| 12 | + dojo.html | |
| 13 | + commonjs.html | |
| 14 | + plugins.html | |
| 15 | + why.html | |
| 16 | + whyamd.html) | |
| 17 | + | |
| 18 | + html_filters.push 'requirejs/clean_html', 'requirejs/entries' | |
| 19 | + | |
| 20 | + options[:container] = '#content' | |
| 21 | + options[:follow_links] = false | |
| 22 | + options[:only] = self.initial_paths | |
| 23 | + | |
| 24 | + options[:attribution] = <<-HTML | |
| 25 | + © 2010–2014 The Dojo Foundation<br> | |
| 26 | + Licensed under the MIT License. | |
| 27 | + HTML | |
| 28 | + end | |
| 29 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +http://requirejs.org/ | |