mirror of https://github.com/freeCodeCamp/devdocs
parent
a5ed27165a
commit
9b4f4c2ef4
@ -1,22 +0,0 @@
|
||||
module Docs
|
||||
class Xpath
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = super
|
||||
name.remove!('Axes.')
|
||||
name << '()' if name.gsub!('Functions.', '')
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
if slug.start_with?('Axes')
|
||||
'Axes'
|
||||
elsif slug.start_with?('Functions')
|
||||
'Functions'
|
||||
else
|
||||
'Miscellaneous'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,8 +1,8 @@
|
||||
module Docs
|
||||
class Xpath
|
||||
class XsltXpath
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
root_page? ? root : other
|
||||
initial_page? ? root : other
|
||||
doc
|
||||
end
|
||||
|
@ -0,0 +1,27 @@
|
||||
module Docs
|
||||
class XsltXpath
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = super
|
||||
name.remove! 'XPath.'
|
||||
name.remove! 'XSLT.'
|
||||
name.remove! 'Axes.'
|
||||
name.prepend 'xsl:' if slug =~ /\AXSLT\/[a-z]/
|
||||
name << '()' if name.gsub!('Functions.', '')
|
||||
name
|
||||
end
|
||||
|
||||
def get_type
|
||||
if slug =~ /\AXSLT\/[a-z]/
|
||||
'XSLT Elements'
|
||||
elsif slug.start_with?('XPath/Axes')
|
||||
'XPath Axes'
|
||||
elsif slug.start_with?('XPath/Functions')
|
||||
'XPath Functions'
|
||||
else
|
||||
'Miscellaneous'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -1,16 +0,0 @@
|
||||
module Docs
|
||||
class Xpath < Mdn
|
||||
self.name = 'XPath'
|
||||
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/XPath'
|
||||
|
||||
html_filters.push 'xpath/clean_html', 'xpath/entries', 'title'
|
||||
|
||||
options[:root_title] = 'XPath'
|
||||
|
||||
options[:fix_urls] = ->(url) do
|
||||
url.sub! 'https://developer.mozilla.org/en/XPath', Xpath.base_url
|
||||
url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', Xpath.base_url
|
||||
url
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
module Docs
|
||||
class XsltXpath < Mdn
|
||||
self.name = 'XSLT & XPath'
|
||||
self.slug = 'xslt_xpath'
|
||||
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web'
|
||||
self.root_path = '/XSLT'
|
||||
self.initial_paths = %w(/XPath)
|
||||
|
||||
html_filters.push 'xslt_xpath/clean_html', 'xslt_xpath/entries', 'title'
|
||||
|
||||
options[:only_patterns] = [/\A\/XSLT/, /\A\/XPath/]
|
||||
|
||||
options[:fix_urls] = ->(url) do
|
||||
url.sub! 'https://developer.mozilla.org/en/XPath', "#{XsltXpath.base_url}/XPath"
|
||||
url.sub! 'https://developer.mozilla.org/en/XSLT', "#{XsltXpath.base_url}/XSLT"
|
||||
url.sub! 'https://developer.mozilla.org/en-US/docs/XPath', "#{XsltXpath.base_url}/XPath"
|
||||
url.sub! 'https://developer.mozilla.org/en-US/docs/XSLT', "#{XsltXpath.base_url}/XSLT"
|
||||
url
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in new issue