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