From f19a61aa1b877702f8ca859c90538eddeae29e8b Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sun, 9 Jan 2022 10:06:58 +0100 Subject: [PATCH] Add Deno documentation (1.17.2) --- assets/javascripts/news.json | 4 +++ .../templates/pages/about_tmpl.coffee | 5 ++++ lib/docs/filters/deno/clean_html.rb | 22 +++++++++++++++++ lib/docs/filters/deno/entries.rb | 15 ++++++++++++ lib/docs/scrapers/deno.rb | 23 ++++++++++++++++++ public/icons/docs/deno/16.png | Bin 0 -> 987 bytes public/icons/docs/deno/16@2x.png | Bin 0 -> 1408 bytes public/icons/docs/deno/SOURCE | 1 + 8 files changed, 70 insertions(+) create mode 100644 lib/docs/filters/deno/clean_html.rb create mode 100644 lib/docs/filters/deno/entries.rb create mode 100644 lib/docs/scrapers/deno.rb create mode 100644 public/icons/docs/deno/16.png create mode 100644 public/icons/docs/deno/16@2x.png create mode 100644 public/icons/docs/deno/SOURCE 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 0000000000000000000000000000000000000000..f10dba2dbd62b9945ded02619af2cba82186df3a GIT binary patch literal 987 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UA#7kTwN-A;-tO7DCQgb3*GILY& ziZk=`7)%X~4E03Rfl64?9eo`c7&i8E|4C#8@)eRjf_xbms?-=58d?|_egTCVUNA6} z8Za=tN&p!QG__#Pu0R{01ZROqWHAE+w-5+3UbBkcg6?#Bzm#qWrYXoK%I9%7Rn{pt~3tG$!^2N0+r4aQsOZjdfyin)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( z{LCcVd(w|6D>IkVx*TloJ~|Qx{i%p!%Qv zQq)^TB*uPp`z(~nV0U$mTNKK=-f0&v4JKbnTcw>9Ac|{icRz>BY6;ex*2f7*aoqkE zUDQT_vi9*XCG%jUKsIIO7bcgMYm2zB#=1 nDS0Mv@?pifd%u1fj9=bTY;?n9@NDbirGJ~`;7)vCPfhq2TQWi9 literal 0 HcmV?d00001 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