Unified · Split
| @@ -163,6 +163,13 @@ · 162 unmodified lines | |||
| 163 | } | 163 | } |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | ._heading-links { | ||
| 167 | float: right; | ||
| 168 | font-weight: normal; | ||
| 169 | |||
| 170 | > a + a { margin-left: .25rem; } | ||
| 171 | } | ||
| 172 | |||
| 166 | // | 173 | // |
| 167 | // Table of contents | 174 | // Table of contents |
| 168 | // | 175 | // |
| @@ -90,6 +90,7 @@ · 89 unmodified lines | |||
| 90 | margin: 2em 0 1em; | 90 | margin: 2em 0 1em; |
| 91 | padding-left: .5em; | 91 | padding-left: .5em; |
| 92 | padding-right: .5em; | 92 | padding-right: .5em; |
| 93 | overflow: hidden; | ||
| 93 | font-size: inherit; | 94 | font-size: inherit; |
| 94 | color: $boxHeaderColor; | 95 | color: $boxHeaderColor; |
| 95 | border: 1px solid $boxBorder; | 96 | border: 1px solid $boxBorder; |
| @@ -2,21 +2,26 @@ module Docs · 1 unmodified line | |||
| 2 | class Lodash | 2 | class Lodash |
| 3 | class CleanHtmlFilter < Filter | 3 | class CleanHtmlFilter < Filter |
| 4 | def call | 4 | def call |
| 5 | @doc = at_css('h1+div+div') | 5 | @doc = at_css('.doc-container') |
| 6 | 6 | ||
| 7 | css('h3 + p', 'hr').remove | 7 | css('> div', '> div > div', '.highlight').each do |node| |
| 8 | 8 | node.before(node.children).remove | |
| 9 | css('h2 a:contains("#")', 'h3 a:contains("#")').remove | 9 | end |
| 10 | 10 | ||
| 11 | # Remove <code> inside headings | 11 | # Remove <code> inside headings |
| 12 | css('h2', 'h3').each do |node| | 12 | css('h2', 'h3').each do |node| |
| 13 | node.content = node.content | 13 | node.content = node.content |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | css('h3 + p > a:first-child').each do |node| | ||
| 17 | node.parent.previous_element << %(<div class="_heading-links">#{node.parent.inner_html}</div>) | ||
| 18 | node.parent.remove | ||
| 19 | end | ||
| 20 | |||
| 16 | # Remove code highlighting | 21 | # Remove code highlighting |
| 17 | css('pre').each do |node| | 22 | css('pre').each do |node| |
| 18 | node.inner_html = node.inner_html.gsub('<br>', "\n").gsub(' ', ' ') | 23 | node.inner_html = node.inner_html.gsub('</div>', "</div>\n").gsub(' ', ' ') |
| 19 | node.content = node.content | 24 | node.content = node.content.strip |
| 20 | node['data-language'] = 'javascript' | 25 | node['data-language'] = 'javascript' |
| 21 | end | 26 | end |
| 22 | 27 | ||
| @@ -9,7 +9,7 @@ module Docs · 8 unmodified lines | |||
| 9 | 9 | ||
| 10 | heading.parent.css('a').each do |link| | 10 | heading.parent.css('a').each do |link| |
| 11 | name = link.content | 11 | name = link.content |
| 12 | name = name.remove(/\u{279C}.*/) | 12 | name.remove! %r{\s.*} |
| 13 | entries << [name, link['href'].remove('#'), type] | 13 | entries << [name, link['href'].remove('#'), type] |
| 14 | end | 14 | end |
| 15 | end | 15 | end |
| @@ -19,13 +19,18 @@ module Docs · 18 unmodified lines | |||
| 19 | HTML | 19 | HTML |
| 20 | 20 | ||
| 21 | version '4' do | 21 | version '4' do |
| 22 | self.release = '4.15.0' | 22 | self.release = '4.16.2' |
| 23 | self.base_url = 'https://lodash.com/docs' | 23 | self.base_url = "https://lodash.com/docs/#{release}" |
| 24 | end | 24 | end |
| 25 | 25 | ||
| 26 | version '3' do | 26 | version '3' do |
| 27 | self.release = '3.10.0' | 27 | self.release = '3.10.1' |
| 28 | self.base_url = 'https://lodash.com/docs' # OUT-OF-DATE | 28 | self.base_url = "https://lodash.com/docs/#{release}" |
| 29 | end | ||
| 30 | |||
| 31 | version '2' do | ||
| 32 | self.release = '2.4.2' | ||
| 33 | self.base_url = "https://lodash.com/docs/#{release}" | ||
| 29 | end | 34 | end |
| 30 | end | 35 | end |
| 31 | end | 36 | end |