History

Update Sass documentation (3.3.0)

Thibaut committed 12 years ago

Commit 2f17c051 parent 2e4a38f5 files · +25 −20Browse files

Unified · Split

5 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. assets/stylesheets/pages/_yard.scss +2 −0
  3. lib/docs/filters/sass/clean_html.rb +14 −9
  4. lib/docs/filters/sass/entries.rb +3 −3
  5. lib/docs/scrapers/sass.rb +5 −7
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -192,7 +192,7 @@ credits = [ · 191 unmodified lines
192 'https://raw.github.com/rails/rails/master/activerecord/MIT-LICENSE'192 'https://raw.github.com/rails/rails/master/activerecord/MIT-LICENSE'
193 ], [193 ], [
194 'Sass',194 'Sass',
195 '2006-2013 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein',195 '2006-2014 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein',
196 'MIT',196 'MIT',
197 'https://raw.github.com/nex3/sass/master/MIT-LICENSE'197 'https://raw.github.com/nex3/sass/master/MIT-LICENSE'
198 ], [198 ], [
assets/stylesheets/pages/_yard.scss+2−0
@@ -11,4 +11,6 @@ · 10 unmodified lines
11 h3 { font-size: inherit; }11 h3 { font-size: inherit; }
12 ul, pre { margin: 1em 0; }12 ul, pre { margin: 1em 0; }
13 }13 }
14
15 .tag_title { font-weight: bold; }
14}16}
lib/docs/filters/sass/clean_html.rb+14−9
@@ -20,26 +20,31 @@ module Docs · 19 unmodified lines
20 20
21 css('.showSource', '.source_code').remove21 css('.showSource', '.source_code').remove
22 22
23 css('div.docstring', 'div.discussion').each do |node|
24 node.before(node.children).remove
25 end
26
23 # Remove "See Also"27 # Remove "See Also"
24 css('.see').each do |node|28 css('.see').each do |node|
25 node.previous_element.remove29 node.previous_element.remove
26 node.remove30 node.remove
27 end31 end
28 32
29 # Un-indent code blocks33 # Remove "- ([...])" before method names
30 css('pre.example').each do |node|34 css('.signature', 'span.overload', 'span.signature').each do |node|
31 node.inner_html = node.inner_html.strip_heredoc35 next if node.at_css('.overload')
36 node.child.remove while node.child.name != 'strong'
32 end37 end
33 38
34 # Remove "- " before method names39 # Clean up .inline divs
35 css('.signature', 'span.overload').each do |node|40 css('div.inline').each do |node|
36 node.child.content = node.child.content.sub(/\A\s*-\s*/, '')41 node.content = node.content
42 node.name = 'span'
37 end43 end
38 44
39 # Remove links to type classes (e.g. Number)45 # Remove links to type classes (e.g. Number)
40 css('.type > code > a, .signature > code > a, span.overload > code > a').each do |node|46 css('.type > code').each do |node|
41 node.before(node.content)47 node.before(node.content.sub('Sass::Script::Value::', '').sub('Sass::Script::', '')).remove
42 node.remove
43 end48 end
44 end49 end
45 end50 end
lib/docs/filters/sass/entries.rb+3−3
@@ -11,7 +11,7 @@ module Docs · 10 unmodified lines
11 '%foo' => '%placeholder selector',11 '%foo' => '%placeholder selector',
12 '&' => '& parent selector',12 '&' => '& parent selector',
13 '$' => '$ variables',13 '$' => '$ variables',
14 '#{}' => '#{} interpolation',14 '`' => '#{} interpolation',
15 'The !optional Flag' => '!optional'15 'The !optional Flag' => '!optional'
16 }16 }
17 17
@@ -35,7 +35,7 @@ module Docs · 17 unmodified lines
35 entries << ['@function', node['id'], '@-Rules and Directives']35 entries << ['@function', node['id'], '@-Rules and Directives']
36 end36 end
37 37
38 if type.end_with? 'Directives'38 if type.include? 'Directives'
39 type = '@-Rules and Directives'39 type = '@-Rules and Directives'
40 elsif type == 'Output Style'40 elsif type == 'Output Style'
41 type = 'Output Styles'41 type = 'Output Styles'
@@ -55,7 +55,7 @@ module Docs · 13 unmodified lines
55 name.gsub!(/ [A-Z]/) { |str| str.downcase! }55 name.gsub!(/ [A-Z]/) { |str| str.downcase! }
56 56
57 if type == '@-Rules and Directives'57 if type == '@-Rules and Directives'
58 next unless name =~ /\A@\w+\z/ || name == '!optional'58 next unless name =~ /\A@[\w\-]+\z/ || name == '!optional'
59 end59 end
60 60
61 entries << [name, node['id'], type]61 entries << [name, node['id'], type]
lib/docs/scrapers/sass.rb+5−7
@@ -1,24 +1,22 @@
1module Docs1module Docs
2 class Sass < UrlScraper2 class Sass < UrlScraper
3 self.type = 'yard'3 self.type = 'yard'
4 self.version = '3.2.12'4 self.version = '3.3.0'
5 self.base_url = 'http://sass-lang.com/docs/yardoc/'5 self.base_url = 'http://sass-lang.com/documentation/'
6 self.root_path = 'file.SASS_REFERENCE.html'6 self.root_path = 'file.SASS_REFERENCE.html'
7 7
8 html_filters.push 'sass/clean_html', 'sass/entries', 'title'8 html_filters.push 'sass/clean_html', 'sass/entries', 'title'
9 9
10 options[:only] = %w(Sass/Script/Functions.html)10 options[:only] = %w(Sass/Script/Functions.html)
11 options[:root_title] = false
12 options[:title] = 'Sass Functions'
11 13
12 options[:container] = ->(filter) do14 options[:container] = ->(filter) do
13 filter.root_page? ? '#filecontents' : '#instance_method_details'15 filter.root_page? ? '#filecontents' : '#instance_method_details'
14 end16 end
15 17
16 options[:title] = ->(filter) do
17 'Sass Functions' if filter.slug == 'Sass/Script/Functions'
18 end
19
20 options[:attribution] = <<-HTML18 options[:attribution] = <<-HTML
21 &copy; 2006&ndash;2013 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein<br>19 &copy; 2006&ndash;2014 Hampton Catlin, Nathan Weizenbaum, and Chris Eppstein<br>
22 Licensed under the MIT License.20 Licensed under the MIT License.
23 HTML21 HTML
24 end22 end

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t