| @@ -13,12 +13,14 @@ module Docs · 12 unmodified lines |
| 13 | ['... splats', 'splats', 'Language'], | 13 | ['... splats', 'splats', 'Language'], |
| 14 | ['for...in', 'loops', 'Statements'], | 14 | ['for...in', 'loops', 'Statements'], |
| 15 | ['for...in...by', 'loops', 'Statements'], | 15 | ['for...in...by', 'loops', 'Statements'], |
| | 16 | ['for...in...when', 'loops', 'Statements'], |
| 16 | ['for...of', 'loops', 'Statements'], | 17 | ['for...of', 'loops', 'Statements'], |
| 17 | ['while', 'loops', 'Statements'], | 18 | ['while', 'loops', 'Statements'], |
| 18 | ['until', 'loops', 'Statements'], | 19 | ['until', 'loops', 'Statements'], |
| 19 | ['loop', 'loops', 'Statements'], | 20 | ['loop', 'loops', 'Statements'], |
| 20 | ['do', 'loops', 'Statements'], | 21 | ['do', 'loops', 'Statements'], |
| 21 | ['Array slicing and splicing', 'slices', 'Language'], | 22 | ['Array slicing and splicing', 'slices', 'Language'], |
| | 23 | ['Ranges', 'slices', 'Language'], |
| 22 | ['Expressions', 'expressions', 'Language'], | 24 | ['Expressions', 'expressions', 'Language'], |
| 23 | ['?', 'the-existential-operator', 'Operators'], | 25 | ['?', 'the-existential-operator', 'Operators'], |
| 24 | ['?=', 'the-existential-operator', 'Operators'], | 26 | ['?=', 'the-existential-operator', 'Operators'], |
| @@ -35,8 +37,10 @@ module Docs · 10 unmodified lines |
| 35 | ['Chained comparisons', 'comparisons', 'Language'], | 37 | ['Chained comparisons', 'comparisons', 'Language'], |
| 36 | ['#{} interpolation', 'strings', 'Language'], | 38 | ['#{} interpolation', 'strings', 'Language'], |
| 37 | ['Block strings', 'strings', 'Language'], | 39 | ['Block strings', 'strings', 'Language'], |
| | 40 | ['"""', 'strings', 'Language'], |
| 38 | ['Block comments', 'strings', 'Language'], | 41 | ['Block comments', 'strings', 'Language'], |
| 39 | ['Block regular expressions', 'regexes', 'Language'], | 42 | ['###', 'strings', 'Language'], |
| | 43 | ['Block regexes', 'regexes', 'Language'], |
| 40 | ['cake command', 'cake', 'Miscellaneous'], | 44 | ['cake command', 'cake', 'Miscellaneous'], |
| 41 | ['Cakefile', 'cake', 'Miscellaneous'], | 45 | ['Cakefile', 'cake', 'Miscellaneous'], |
| 42 | ['Source maps', 'source-maps', 'Miscellaneous'] | 46 | ['Source maps', 'source-maps', 'Miscellaneous'] |
| @@ -49,7 +53,8 @@ module Docs · 6 unmodified lines |
| 49 | css('.definitions td:first-child > code').each do |node| | 53 | css('.definitions td:first-child > code').each do |node| |
| 50 | node.content.split(', ').each do |name| | 54 | node.content.split(', ').each do |name| |
| 51 | next if %w(true false yes no on off this).include?(name) | 55 | next if %w(true false yes no on off this).include?(name) |
| 52 | id = name.parameterize | 56 | name.sub! %r{\Aa (.+) b\z}, '\1' |
| | 57 | id = name_to_id(name) |
| 53 | node['id'] = id | 58 | node['id'] = id |
| 54 | entries << [name, id, 'Operators'] | 59 | entries << [name, id, 'Operators'] |
| 55 | end | 60 | end |
| @@ -57,6 +62,15 @@ module Docs · 1 unmodified line |
| 57 | | 62 | |
| 58 | entries | 63 | entries |
| 59 | end | 64 | end |
| | 65 | |
| | 66 | def name_to_id(name) |
| | 67 | case name |
| | 68 | when '**' then 'pow' |
| | 69 | when '//' then 'floor' |
| | 70 | when '%%' then 'mod' |
| | 71 | else name.parameterize |
| | 72 | end |
| | 73 | end |
| 60 | end | 74 | end |
| 61 | end | 75 | end |
| 62 | end | 76 | end |