Unified · Split
| @@ -728,6 +728,12 @@ credits = [ · 727 unmodified lines | |||
| 728 | 'CC BY', | 728 | 'CC BY', |
| 729 | 'https://creativecommons.org/licenses/by/4.0/' | 729 | 'https://creativecommons.org/licenses/by/4.0/' |
| 730 | ], [ | 730 | ], [ |
| 731 | 'Wordpress', | ||
| 732 | '2003-2019 WordPress Foundation', | ||
| 733 | 'GPLv2+', | ||
| 734 | 'https://wordpress.org/about/license/' | ||
| 735 | ], | ||
| 736 | [ | ||
| 731 | 'Yarn', | 737 | 'Yarn', |
| 732 | '2016-present Yarn Contributors', | 738 | '2016-present Yarn Contributors', |
| 733 | 'BSD', | 739 | 'BSD', |
| @@ -7,12 +7,19 @@ module Docs · 6 unmodified lines | |||
| 7 | return doc | 7 | return doc |
| 8 | end | 8 | end |
| 9 | 9 | ||
| 10 | article = at_css('article[id^="post-"]') | ||
| 11 | @doc = at_css('article[id^="post-"]') unless article.nil? | ||
| 12 | |||
| 10 | css('hr', '.screen-reader-text', '.table-of-contents', | 13 | css('hr', '.screen-reader-text', '.table-of-contents', |
| 11 | '.anchor', '.toc-jump', '.source-code-links', '.user-notes', | 14 | '.anchor', '.toc-jump', '.source-code-links', '.user-notes', |
| 12 | '.show-more', '.hide-more').remove | 15 | '.show-more', '.hide-more').remove |
| 13 | 16 | ||
| 14 | br = /<br\s?\/?>/i | 17 | br = /<br\s?\/?>/i |
| 15 | 18 | ||
| 19 | header = at_css('h1') | ||
| 20 | header.content = header.content.strip | ||
| 21 | doc.prepend_child header | ||
| 22 | |||
| 16 | # Add PHP code highlighting | 23 | # Add PHP code highlighting |
| 17 | css('pre').each do |node| | 24 | css('pre').each do |node| |
| 18 | node['data-language'] = 'php' | 25 | node['data-language'] = 'php' |
| @@ -29,4 +36,4 @@ module Docs · 10 unmodified lines | |||
| 29 | end | 36 | end |
| 30 | end | 37 | end |
| 31 | end | 38 | end |
| 32 | end | 39 | end |
| @@ -1,12 +1,6 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class Wordpress | 2 | class Wordpress |
| 3 | class EntriesFilter < Docs::EntriesFilter | 3 | class EntriesFilter < Docs::EntriesFilter |
| 4 | def breadcrumbs | ||
| 5 | @breadcrumbs ||= css('.breadcrumbs .trail-inner a') | ||
| 6 | .map(&:content) | ||
| 7 | .map(&:strip) | ||
| 8 | end | ||
| 9 | |||
| 10 | def get_name | 4 | def get_name |
| 11 | at_css('.breadcrumbs .trail-end').content | 5 | at_css('.breadcrumbs .trail-end').content |
| 12 | end | 6 | end |
| @@ -18,12 +12,8 @@ module Docs · 5 unmodified lines | |||
| 18 | 'Hooks' | 12 | 'Hooks' |
| 19 | elsif subpath.starts_with?('functions') | 13 | elsif subpath.starts_with?('functions') |
| 20 | 'Functions' | 14 | 'Functions' |
| 21 | elsif breadcrumbs.size > 1 | ||
| 22 | breadcrumbs.drop(1).join(': ') | ||
| 23 | else | ||
| 24 | at_css('.breadcrumbs .trail-end').content | ||
| 25 | end | 15 | end |
| 26 | end | 16 | end |
| 27 | end | 17 | end |
| 28 | end | 18 | end |
| 29 | end | 19 | end |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | |||
| 2 | class Wordpress < UrlScraper | 2 | class Wordpress < UrlScraper |
| 3 | self.name = 'WordPress' | 3 | self.name = 'WordPress' |
| 4 | self.type = 'wordpress' | 4 | self.type = 'wordpress' |
| 5 | self.release = '4.9.4' | 5 | self.release = '5.2.2' |
| 6 | self.base_url = 'https://developer.wordpress.org/reference/' | 6 | self.base_url = 'https://developer.wordpress.org/reference/' |
| 7 | self.initial_paths = %w( | 7 | self.initial_paths = %w( |
| 8 | functions/ | 8 | functions/ |
| @@ -15,10 +15,10 @@ module Docs · 6 unmodified lines | |||
| 15 | code: 'https://github.com/WordPress/WordPress' | 15 | code: 'https://github.com/WordPress/WordPress' |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | html_filters.push 'wordpress/clean_html', 'wordpress/entries' | 18 | html_filters.push 'wordpress/entries', 'wordpress/clean_html' |
| 19 | 19 | ||
| 20 | options[:container] = '#content-area' | 20 | options[:container] = '#content-area' |
| 21 | options[:trailing_slash] = true | 21 | options[:trailing_slash] = false |
| 22 | options[:only_patterns] = [ | 22 | options[:only_patterns] = [ |
| 23 | /\Afunctions\//, | 23 | /\Afunctions\//, |
| 24 | /\Ahooks\//, | 24 | /\Ahooks\//, |
| @@ -32,8 +32,8 @@ module Docs · 7 unmodified lines | |||
| 32 | ] | 32 | ] |
| 33 | 33 | ||
| 34 | options[:attribution] = <<-HTML | 34 | options[:attribution] = <<-HTML |
| 35 | © 2003–2018 WordPress Foundation<br> | 35 | © 2003–2019 WordPress Foundation<br> |
| 36 | Licensed under the GNU GPLv2+ License. | 36 | Licensed under the GNU GPLv2+ License. |
| 37 | HTML | 37 | HTML |
| 38 | end | 38 | end |
| 39 | end | 39 | end |
Binary file not shown.
Binary file not shown.