mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1020 B
36 lines
1020 B
module Docs
|
|
class Svg < Mdn
|
|
prepend FixInternalUrlsBehavior
|
|
prepend FixRedirectionsBehavior
|
|
|
|
# release = '2023-04-24'
|
|
self.name = 'SVG'
|
|
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/SVG'
|
|
self.links = {
|
|
home: 'https://developer.mozilla.org/en-US/docs/Web/SVG',
|
|
code: 'https://github.com/mdn/content/tree/main/files/en-us/web/svg'
|
|
}
|
|
|
|
html_filters.push 'svg/clean_html', 'svg/entries'
|
|
|
|
options[:root_title] = 'SVG'
|
|
|
|
options[:title] = ->(filter) do
|
|
if filter.slug.starts_with?('Element/')
|
|
"<#{filter.default_title}>"
|
|
elsif filter.slug != 'Attribute' && filter.slug != 'Element'
|
|
filter.default_title
|
|
else
|
|
false
|
|
end
|
|
end
|
|
|
|
options[:fix_urls] = ->(url) do
|
|
url.sub! 'https://developer.mozilla.org/en-US/Web/SVG', Svg.base_url
|
|
url.sub! 'https://developer.mozilla.org/en-US/docs/SVG', Svg.base_url
|
|
url.sub! 'https://developer.mozilla.org/en/SVG', Svg.base_url
|
|
url
|
|
end
|
|
end
|
|
end
|