Update CoffeeScript documentation (1.7.1)

pull/62/merge
Thibaut 11 years ago
parent 948e267fe4
commit 722a045475

@ -85,7 +85,7 @@ credits = [
'https://raw.github.com/jashkenas/backbone/master/LICENSE' 'https://raw.github.com/jashkenas/backbone/master/LICENSE'
], [ ], [
'CoffeeScript', 'CoffeeScript',
'2009-2013 Jeremy Ashkenas', '2009-2014 Jeremy Ashkenas',
'MIT', 'MIT',
'https://raw.github.com/jashkenas/coffee-script/master/LICENSE' 'https://raw.github.com/jashkenas/coffee-script/master/LICENSE'
], [ ], [

@ -13,12 +13,14 @@ module Docs
['... splats', 'splats', 'Language'], ['... splats', 'splats', 'Language'],
['for...in', 'loops', 'Statements'], ['for...in', 'loops', 'Statements'],
['for...in...by', 'loops', 'Statements'], ['for...in...by', 'loops', 'Statements'],
['for...in...when', 'loops', 'Statements'],
['for...of', 'loops', 'Statements'], ['for...of', 'loops', 'Statements'],
['while', 'loops', 'Statements'], ['while', 'loops', 'Statements'],
['until', 'loops', 'Statements'], ['until', 'loops', 'Statements'],
['loop', 'loops', 'Statements'], ['loop', 'loops', 'Statements'],
['do', 'loops', 'Statements'], ['do', 'loops', 'Statements'],
['Array slicing and splicing', 'slices', 'Language'], ['Array slicing and splicing', 'slices', 'Language'],
['Ranges', 'slices', 'Language'],
['Expressions', 'expressions', 'Language'], ['Expressions', 'expressions', 'Language'],
['?', 'the-existential-operator', 'Operators'], ['?', 'the-existential-operator', 'Operators'],
['?=', 'the-existential-operator', 'Operators'], ['?=', 'the-existential-operator', 'Operators'],
@ -35,8 +37,10 @@ module Docs
['Chained comparisons', 'comparisons', 'Language'], ['Chained comparisons', 'comparisons', 'Language'],
['#{} interpolation', 'strings', 'Language'], ['#{} interpolation', 'strings', 'Language'],
['Block strings', 'strings', 'Language'], ['Block strings', 'strings', 'Language'],
['"""', 'strings', 'Language'],
['Block comments', 'strings', 'Language'], ['Block comments', 'strings', 'Language'],
['Block regular expressions', 'regexes', 'Language'], ['###', 'strings', 'Language'],
['Block regexes', 'regexes', 'Language'],
['cake command', 'cake', 'Miscellaneous'], ['cake command', 'cake', 'Miscellaneous'],
['Cakefile', 'cake', 'Miscellaneous'], ['Cakefile', 'cake', 'Miscellaneous'],
['Source maps', 'source-maps', 'Miscellaneous'] ['Source maps', 'source-maps', 'Miscellaneous']
@ -49,7 +53,8 @@ module Docs
css('.definitions td:first-child > code').each do |node| css('.definitions td:first-child > code').each do |node|
node.content.split(', ').each do |name| node.content.split(', ').each do |name|
next if %w(true false yes no on off this).include?(name) next if %w(true false yes no on off this).include?(name)
id = name.parameterize name.sub! %r{\Aa (.+) b\z}, '\1'
id = name_to_id(name)
node['id'] = id node['id'] = id
entries << [name, id, 'Operators'] entries << [name, id, 'Operators']
end end
@ -57,6 +62,15 @@ module Docs
entries entries
end end
def name_to_id(name)
case name
when '**' then 'pow'
when '//' then 'floor'
when '%%' then 'mod'
else name.parameterize
end
end
end end
end end
end end

@ -2,7 +2,7 @@ module Docs
class Coffeescript < UrlScraper class Coffeescript < UrlScraper
self.name = 'CoffeeScript' self.name = 'CoffeeScript'
self.type = 'coffeescript' self.type = 'coffeescript'
self.version = '1.6.3' self.version = '1.7.1'
self.base_url = 'http://coffeescript.org' self.base_url = 'http://coffeescript.org'
html_filters.push 'coffeescript/clean_html', 'coffeescript/entries', 'title' html_filters.push 'coffeescript/clean_html', 'coffeescript/entries', 'title'
@ -12,7 +12,7 @@ module Docs
options[:skip_links] = true options[:skip_links] = true
options[:attribution] = <<-HTML options[:attribution] = <<-HTML
&copy; 2009&ndash;2013 Jeremy Ashkenas<br> &copy; 2009&ndash;2014 Jeremy Ashkenas<br>
Licensed under the MIT License. Licensed under the MIT License.
HTML HTML
end end

Loading…
Cancel
Save