Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NuxtJS documentation (2.15.8) #1832

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions assets/javascripts/templates/pages/about_tmpl.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'https://raw.githubusercontent.com/nuxt/nuxt.js/dev/LICENSE'
'https://raw.githubusercontent.com/nuxt/nuxtjs.org/main/LICENSE.md'

Here, we display the license of the docs not the source code.

This one uses https://creativecommons.org/licenses/by-nd/4.0/ "Creative Commons Attribution-NoDerivatives 4.0" – is devdocs.io a derivative? Rather yes? https://creativecommons.org/faq/#what-is-an-adaptation

Here's how we dealt with it in the past #1752 (comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will try reach out to them to get some clarification. But yeah seems this would be a blocker

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made some updates to the mc-stan issue regarding the no derivatives clause of the CC license.

], [
'OCaml',
'1995-2022 INRIA',
Expand Down
1 change: 1 addition & 0 deletions assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
'pages/nginx',
'pages/node',
'pages/npm',
'pages/nuxtjs',
'pages/octave',
'pages/openjdk',
'pages/perl',
Expand Down
7 changes: 7 additions & 0 deletions assets/stylesheets/pages/_nuxtjs.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
._nuxtjs {
> h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }

.alert { @extend %note; }
code, .filename { @extend %label; }
}
19 changes: 19 additions & 0 deletions lib/docs/filters/nuxtjs/clean_html.rb
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions lib/docs/filters/nuxtjs/container.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Docs
class Nuxtjs
class ContainerFilter < Filter
def call
at_css '.docus-content'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simply use options[:container] = '.docus-content' in lib/docs/scrapers/nuxtjs.rb

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe I tried that but it didn't end up following links and thus didn't do a full scrape. But I guess will have to tackle the license issue first 😅

end
end
end
end
18 changes: 18 additions & 0 deletions lib/docs/filters/nuxtjs/entries.rb
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions lib/docs/scrapers/nuxtjs.rb
Original file line number Diff line number Diff line change
@@ -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
&copy; 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
Binary file added public/icons/docs/nuxtjs/16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/docs/nuxtjs/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions public/icons/docs/nuxtjs/SOURCE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
https://nuxtjs.org/_nuxt/icons/icon_64x64.a3b4ce.png