Add esbuild documentation

pull/1670/head
Simon Legner 3 years ago
parent 578bba1807
commit a9843261b9

@ -1,4 +1,8 @@
[
[
"2021-12-05",
"New documentation: <a href=\"/esbuild/\">esbuild</a>"
],
[
"2021-12-04",
"New documentation: <a href=\"/vite/\">Vite</a>"

@ -291,6 +291,11 @@ credits = [
'2010-2021 Ericsson AB',
'Apache',
'https://raw.githubusercontent.com/erlang/otp/maint/LICENSE.txt'
], [
'esbulid',
'2020 Evan Wallace',
'MIT',
'https://raw.githubusercontent.com/evanw/esbuild/blob/master/LICENSE.md'
], [
'ESLint',
'OpenJS Foundation and other contributors',

@ -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
&copy; 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 460 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 756 B

@ -0,0 +1 @@
https://esbuild.github.io/favicon.svg
Loading…
Cancel
Save