diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index f34f861f44..118e68cbfb 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -626,6 +626,11 @@ credits = [ '2005-2022 NumPy Developers', 'BSD', 'https://raw.githubusercontent.com/numpy/numpy/master/LICENSE.txt' + ], [ + 'NuxtJS', + '2016-present Nuxt Team', + 'MIT', + 'https://raw.githubusercontent.com/nuxt/nuxt.js/dev/LICENSE' ], [ 'OCaml', '1995-2022 INRIA', diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index 8a6221b68a..7ae0159f6a 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -90,6 +90,7 @@ 'pages/nginx', 'pages/node', 'pages/npm', + 'pages/nuxtjs', 'pages/octave', 'pages/openjdk', 'pages/perl', diff --git a/assets/stylesheets/pages/_nuxtjs.scss b/assets/stylesheets/pages/_nuxtjs.scss new file mode 100644 index 0000000000..50add0cf1c --- /dev/null +++ b/assets/stylesheets/pages/_nuxtjs.scss @@ -0,0 +1,7 @@ +._nuxtjs { + > h2 { @extend %block-heading; } + > h3 { @extend %block-label, %label-blue; } + + .alert { @extend %note; } + code, .filename { @extend %label; } +} diff --git a/lib/docs/filters/nuxtjs/clean_html.rb b/lib/docs/filters/nuxtjs/clean_html.rb new file mode 100644 index 0000000000..fe03a142d2 --- /dev/null +++ b/lib/docs/filters/nuxtjs/clean_html.rb @@ -0,0 +1,19 @@ +module Docs + class Nuxtjs + class CleanHtmlFilter < Filter + def call + + # Remove option selectors (e.g. Yarn / NPX / NPM) since we show each section + css('.d-code-group-header-bg').remove + + # Remove a in headers + css('h2 > a', 'h3 > a').each do |node| + node.parent.content = node.content + node.remove + end + + doc + end + end + end +end diff --git a/lib/docs/filters/nuxtjs/container.rb b/lib/docs/filters/nuxtjs/container.rb new file mode 100644 index 0000000000..4ccc3558ee --- /dev/null +++ b/lib/docs/filters/nuxtjs/container.rb @@ -0,0 +1,9 @@ +module Docs + class Nuxtjs + class ContainerFilter < Filter + def call + at_css '.docus-content' + end + end + end +end diff --git a/lib/docs/filters/nuxtjs/entries.rb b/lib/docs/filters/nuxtjs/entries.rb new file mode 100644 index 0000000000..b1fd663dc9 --- /dev/null +++ b/lib/docs/filters/nuxtjs/entries.rb @@ -0,0 +1,18 @@ +module Docs + class Nuxtjs + class EntriesFilter < Docs::EntriesFilter + def get_name + header = at_css('h1') + if header + header.content + else + path.split("/").last.titleize + end + end + + def get_type + path.split("/").first.titleize + end + end + end +end diff --git a/lib/docs/scrapers/nuxtjs.rb b/lib/docs/scrapers/nuxtjs.rb new file mode 100644 index 0000000000..f0e902652d --- /dev/null +++ b/lib/docs/scrapers/nuxtjs.rb @@ -0,0 +1,31 @@ +module Docs + class Nuxtjs < UrlScraper + self.name = 'NuxtJS' + self.name = 'nuxtjs' + self.type = 'nuxtjs' + self.release = '2.15.8' + self.base_url = 'https://nuxtjs.org/docs/' + self.root_path = 'get-started/installation' + + self.links = { + home: 'https://nuxtjs.org/', + code: 'https://github.com/nuxt/nuxt.js' + } + + html_filters.push 'nuxtjs/container', 'nuxtjs/entries', 'nuxtjs/clean_html' + + options[:only_patterns] = [ + /\Aget-started\//, /\Aconcepts\//, /\Afeatures\//, + /\Adirectory-structure\//, /\Aconfiguration-glossary\//, /\Ainternals-glossary\// + ] + options[:trailing_slash] = false + + options[:attribution] = <<-HTML + © This project is licensed under the terms of the MIT license. + HTML + + def get_latest_version(opts) + get_latest_github_release('nuxt', 'nuxt.js', opts) + end + end +end diff --git a/public/icons/docs/nuxtjs/16.png b/public/icons/docs/nuxtjs/16.png new file mode 100644 index 0000000000..5818581ae2 Binary files /dev/null and b/public/icons/docs/nuxtjs/16.png differ diff --git a/public/icons/docs/nuxtjs/16@2x.png b/public/icons/docs/nuxtjs/16@2x.png new file mode 100644 index 0000000000..1452406718 Binary files /dev/null and b/public/icons/docs/nuxtjs/16@2x.png differ diff --git a/public/icons/docs/nuxtjs/SOURCE b/public/icons/docs/nuxtjs/SOURCE new file mode 100644 index 0000000000..1f8afb465f --- /dev/null +++ b/public/icons/docs/nuxtjs/SOURCE @@ -0,0 +1 @@ +https://nuxtjs.org/_nuxt/icons/icon_64x64.a3b4ce.png