Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -108,7 +108,7 @@ credits = [ · 107 unmodified lines | ||
| 108 | 108 | 'Apache', |
| 109 | 109 | 'https://raw.githubusercontent.com/apache/cordova-docs/master/LICENSE' |
| 110 | 110 | ], [ |
| 111 | − 'CSS<br>DOM<br>HTML<br>JavaScript', | |
| 111 | + 'CSS<br>DOM<br>HTML<br>JavaScript<br>XPath', | |
| 112 | 112 | '2005-2014 Mozilla Developer Network and individual contributors', |
| 113 | 113 | 'CC BY-SA', |
| 114 | 114 | 'http://creativecommons.org/licenses/by-sa/2.5/' |
| @@ -32,7 +32,10 @@ newsItem = (date, news) -> · 31 unmodified lines | ||
| 32 | 32 | result |
| 33 | 33 | |
| 34 | 34 | app.news = [ |
| 35 | − [ 1410048000000, # September 7, 2014 | |
| 35 | + [ 1413158400000, # October 13, 2014 | |
| 36 | + """ New <a href="/xpath/">XPath</a> documentation """, | |
| 37 | + ], [ | |
| 38 | + 1410048000000, # September 7, 2014 | |
| 36 | 39 | """ Updated the HTML, CSS, JavaScript, and DOM documentations with additional content. """, |
| 37 | 40 | ], [ |
| 38 | 41 | 1407110400000, # August 4, 2014 |
| @@ -64,3 +64,4 @@ · 63 unmodified lines | ||
| 64 | 64 | ._icon-cordova:before { background-position: 0 -10rem; } |
| 65 | 65 | ._icon-markdown:before { background-position: -1rem -10rem; } |
| 66 | 66 | ._icon-django:before { background-position: -2rem -10rem; } |
| 67 | +._icon-xpath:before { background-position: -3rem -10rem; } | |
| @@ -0,0 +1,30 @@ | ||
| 1 | +module Docs | |
| 2 | + class Xpath | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + root_page? ? root : other | |
| 6 | + doc | |
| 7 | + end | |
| 8 | + | |
| 9 | + def root | |
| 10 | + if table = at_css('.topicpage-table') | |
| 11 | + table.after(table.css('td').children).remove | |
| 12 | + end | |
| 13 | + end | |
| 14 | + | |
| 15 | + def other | |
| 16 | + css('div[style*="background: #f5f5f5;"]').remove | |
| 17 | + | |
| 18 | + css('h3[id]').each do |node| | |
| 19 | + node.name = 'h2' | |
| 20 | + end | |
| 21 | + | |
| 22 | + css('p').each do |node| | |
| 23 | + child = node.child | |
| 24 | + child = child.next while child && child.text? && child.content.blank? | |
| 25 | + child.remove if child.try(:name) == 'br' | |
| 26 | + end | |
| 27 | + end | |
| 28 | + end | |
| 29 | + end | |
| 30 | +end | |
| @@ -0,0 +1,22 @@ | ||
| 1 | +module Docs | |
| 2 | + class Xpath | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + name = super | |
| 6 | + name.remove!('Axes.') | |
| 7 | + name << '()' if name.remove!('Functions.') | |
| 8 | + name | |
| 9 | + end | |
| 10 | + | |
| 11 | + def get_type | |
| 12 | + if slug.start_with?('Axes') | |
| 13 | + 'Axes' | |
| 14 | + elsif slug.start_with?('Functions') | |
| 15 | + 'Functions' | |
| 16 | + else | |
| 17 | + 'Miscellaneous' | |
| 18 | + end | |
| 19 | + end | |
| 20 | + end | |
| 21 | + end | |
| 22 | +end | |
| @@ -0,0 +1,16 @@ | ||
| 1 | +module Docs | |
| 2 | + class Xpath < Mdn | |
| 3 | + self.name = 'XPath' | |
| 4 | + self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/XPath' | |
| 5 | + | |
| 6 | + html_filters.push 'xpath/clean_html', 'xpath/entries', 'title' | |
| 7 | + | |
| 8 | + options[:root_title] = 'XPath' | |
| 9 | + | |
| 10 | + options[:fix_urls] = ->(url) do | |
| 11 | + url.sub! 'https://developer.mozilla.org/en/XPath', Xpath.base_url | |
| 12 | + url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', Xpath.base_url | |
| 13 | + url | |
| 14 | + end | |
| 15 | + end | |
| 16 | +end | |
Binary file not shown.
Binary file not shown.