From f18ffa79943e72f3a2c15c3987c3e91fb0293381 Mon Sep 17 00:00:00 2001 From: Tim Lim Date: Sat, 8 Oct 2022 09:22:26 +0800 Subject: [PATCH] Add NuxtJS documentation (2.15.8) --- .../templates/pages/about_tmpl.coffee | 5 +++ assets/stylesheets/application.css.scss | 1 + assets/stylesheets/pages/_nuxtjs.scss | 7 ++++ lib/docs/filters/nuxtjs/clean_html.rb | 19 +++++++++++ lib/docs/filters/nuxtjs/container.rb | 9 +++++ lib/docs/filters/nuxtjs/entries.rb | 18 ++++++++++ lib/docs/scrapers/nuxtjs.rb | 31 ++++++++++++++++++ public/icons/docs/nuxtjs/16.png | Bin 0 -> 1204 bytes public/icons/docs/nuxtjs/16@2x.png | Bin 0 -> 2027 bytes public/icons/docs/nuxtjs/SOURCE | 1 + 10 files changed, 91 insertions(+) create mode 100644 assets/stylesheets/pages/_nuxtjs.scss create mode 100644 lib/docs/filters/nuxtjs/clean_html.rb create mode 100644 lib/docs/filters/nuxtjs/container.rb create mode 100644 lib/docs/filters/nuxtjs/entries.rb create mode 100644 lib/docs/scrapers/nuxtjs.rb create mode 100644 public/icons/docs/nuxtjs/16.png create mode 100644 public/icons/docs/nuxtjs/16@2x.png create mode 100644 public/icons/docs/nuxtjs/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index f34f861f..118e68cb 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 8a6221b6..7ae0159f 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 00000000..50add0cf --- /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 00000000..fe03a142 --- /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 00000000..4ccc3558 --- /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 00000000..b1fd663d --- /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 00000000..f0e90265 --- /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 0000000000000000000000000000000000000000..5818581ae22ef5975a60d4a81f6420b46c55135c GIT binary patch literal 1204 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|T2doC(|mmy zw18|523AHP24;{FAY@>aVqgWc85q16rQz%#Mh&PMCI*J~Oa>OHnkXO*0v4nJa0`PlBg3pY5xV%QuQiw3qZOUY$~jP%-qzHM1_jnoV;SI3R@+x3M(KRB&@Hb09I0xZL1XF8=&Bv zUzDm~re~mMpk&9TprBw=l#*r@P?Wt5Z@Sn2DRmzV368|&p4rRy77T3YHG z80i}s=>k>g7FXt#Bv$C=6)QswftllyTAW;zSx}OhpQivaH!&%{w8U0P31kr*K-^i9 znTD__uNdkrpa=CqGWv#k2KsQbfm&@qqE`MznW;dVLFU^T+JIG}h(YbK(Fa+MWXh=pKluy2O2qe$KEn}62a^zF$^l3K#v+7dBk z)mOEti^MN44m;Y+<+aqqb%NGbr)>$&3JuQby1U2T-6Fu){RH!JN>o1(Y#IN ztGe%PmD%s|%4#+%zEo1#mzb7*ulm0E{n;~FSERQXe0A#m%aY~L>5=pJ3ERbM@A4Yk zvQ?(Msb8gba!G4bo}QiWT~B|}>iE8Q%U{piIb~`c@8nl2CM{cTIqQP??*~8b9?G7i zB7fqo{P}b(4Vn30+7kCHKN&H5%9X4sR@SCcC9KSz(;hF_F>7+HW4-(T_KVE*bPDDwbUdxLEh|$pncHRj0c)Wfp(hcIVTn8k;MoY5gw8KUpzJo(Vmr^+u%m z!?&f9x;A^ax9=2ZmtA;wWze<-i{$f}mKxuf zV$}Hk^zR3EUNmjot$$@w!4B3Ip_>oIbX%vs`SD?5@O;vj6Pcu(^1yY z`bBcxnpNF9mws_y6UZ>_sYv8G754T26a9J8w&w3Q;)r1vn|+f*>*PrrvCWxf%BmMu zKV03<_1x^u7tw#WSMGP}O4&M}eQtEv`TbKJ`&$f~&wkE2nl@iDYVPFye+(X%Iwx`f Q(;EYWr>mdKI;Vst0D9@Z6951J literal 0 HcmV?d00001 diff --git a/public/icons/docs/nuxtjs/16@2x.png b/public/icons/docs/nuxtjs/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..1452406718eba39494228b1789d3a53281de6878 GIT binary patch literal 2027 zcmY*adpwiv8-HeV?BkGAGwPj9B8S;5huN0HVq}UCQ%=ia<*>G8YrVo=I+2&C(3*9S z=_F^BrCzGH6qRbqTSS=%uMQ3ozfFGn{qE;;J=gcXp6~a2-Pirkb9l3#m!<|x0{{R` zZ!#%Bp5cm6Q<1+}JlEYnj22q+Oi*qPy^w?jWl30sl$p=I!zM#;ycBmz9xfHLc;x;kqG4jp|eJpnS@kzu9Waubv>3QpojJJhxml8+B4IY;$kmljebgsE8j>dIMAAT>eD01WK+jD~ z2TD`=?%N!8b4RG*QNzb^$i(N9Dzv_{En%3a0OuZK{g6Y8hKJ`p*{0pWg4D{Y&ks+g z8pIjjS{ov{y}{R%7ZO?P7(Q^EEW2m_tx{TD8nQ8#In}P;Ea83`$FQs2{uR3d z1`tDsc;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