diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index bfc6225c..c394c7e3 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,4 +1,8 @@ [ + [ + "2022-01-09", + "New documentation: Deno" + ], [ "2021-12-29", "New documentation: PointCloudLibrary" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 1079e3f8..399eb00c 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -232,6 +232,11 @@ credits = [ '2012 the Dart project authors', 'CC BY-SA', 'https://creativecommons.org/licenses/by-sa/4.0/' + ], [ + 'Deno', + '2018–2021 the Deno authors', + 'MIT', + 'https://raw.githubusercontent.com/denoland/manual/main/LICENSE' ], [ 'Django', 'Django Software Foundation and individual contributors', diff --git a/lib/docs/filters/deno/clean_html.rb b/lib/docs/filters/deno/clean_html.rb new file mode 100644 index 00000000..1084963d --- /dev/null +++ b/lib/docs/filters/deno/clean_html.rb @@ -0,0 +1,22 @@ +module Docs + class Deno + class CleanHtmlFilter < Filter + def call + if root_page? + @doc = at_css('h2[id]').parent.parent + else + @doc = at_css('article') + end + + css('*[aria-label="Anchor"]').remove + css('*[class]').remove_attribute('class') + css('pre').each do |node| + node['data-language'] = 'typescript' + end + xpath('//a[text()="[src]"]').remove + + doc + end + end + end +end diff --git a/lib/docs/filters/deno/entries.rb b/lib/docs/filters/deno/entries.rb new file mode 100644 index 00000000..f088a838 --- /dev/null +++ b/lib/docs/filters/deno/entries.rb @@ -0,0 +1,15 @@ +module Docs + class Deno + class EntriesFilter < Docs::EntriesFilter + + def get_name + at_css('h1').content + end + + def get_type + 'Deno CLI APIs' + end + + end + end +end diff --git a/lib/docs/scrapers/deno.rb b/lib/docs/scrapers/deno.rb new file mode 100644 index 00000000..efa90750 --- /dev/null +++ b/lib/docs/scrapers/deno.rb @@ -0,0 +1,23 @@ +module Docs + class Deno < UrlScraper + self.name = 'Deno' + self.type = 'simple' + self.release = '1.17.2' + self.base_url = 'https://doc.deno.land/deno/stable/' + self.links = { + home: 'https://deno.land/', + code: 'https://github.com/denoland/deno' + } + + html_filters.push 'deno/entries', 'deno/clean_html' + + # https://github.com/denoland/manual/blob/main/LICENSE + options[:attribution] = <<-HTML + © 2018–2021 the Deno authors + HTML + + def get_latest_version(opts) + get_latest_github_release('denoland', 'deno', opts) + end + end +end diff --git a/public/icons/docs/deno/16.png b/public/icons/docs/deno/16.png new file mode 100644 index 00000000..f10dba2d Binary files /dev/null and b/public/icons/docs/deno/16.png differ diff --git a/public/icons/docs/deno/16@2x.png b/public/icons/docs/deno/16@2x.png new file mode 100644 index 00000000..3dd1dc52 Binary files /dev/null and b/public/icons/docs/deno/16@2x.png differ diff --git a/public/icons/docs/deno/SOURCE b/public/icons/docs/deno/SOURCE new file mode 100644 index 00000000..d9cc68bf --- /dev/null +++ b/public/icons/docs/deno/SOURCE @@ -0,0 +1 @@ +https://doc.deno.land/static/apple-touch-icon.png