mirror of https://github.com/freeCodeCamp/devdocs
parent
578bba1807
commit
a9843261b9
@ -0,0 +1,19 @@
|
||||
module Docs
|
||||
class Esbuild
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('figure.bench').remove
|
||||
css('.permalink').remove
|
||||
css('.switcher').remove
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
node['data-language'] = 'javascript'
|
||||
node['data-language'] = 'sh' if node['class'] && node['class'].include?('cli')
|
||||
node['data-language'] = 'go' if node['class'] && node['class'].include?('go')
|
||||
node['class'] = nil
|
||||
end
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,21 @@
|
||||
module Docs
|
||||
class Esbuild
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def name
|
||||
at_css('h1').content
|
||||
end
|
||||
def type
|
||||
at_css('h1').content
|
||||
end
|
||||
|
||||
def additional_entries
|
||||
entries = []
|
||||
type = at_css('h1').content
|
||||
css('h2[id], h3[id]').each do |node|
|
||||
entries << [node.content.gsub(/^#/, ''), node['id'], type]
|
||||
end
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
module Docs
|
||||
class Esbuild < UrlScraper
|
||||
self.name = 'esbuild'
|
||||
self.slug = 'esbuild'
|
||||
self.type = 'simple'
|
||||
self.links = {
|
||||
home: 'https://esbuild.github.io/',
|
||||
code: 'https://github.com/evanw/esbuild'
|
||||
}
|
||||
|
||||
options[:container] = 'main'
|
||||
options[:root_title] = 'esbuild'
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2020 Evan Wallace<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
|
||||
version do
|
||||
self.release = '0.14.2'
|
||||
self.base_url = 'https://esbuild.github.io/'
|
||||
html_filters.push 'esbuild/clean_html', 'esbuild/entries'
|
||||
end
|
||||
|
||||
def get_latest_version(opts)
|
||||
get_npm_version('esbuild', opts)
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 460 B |
After Width: | Height: | Size: 756 B |
@ -0,0 +1 @@
|
||||
https://esbuild.github.io/favicon.svg
|
Loading…
Reference in new issue