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