| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line |
| 2 | class Npm < UrlScraper | 2 | class Npm < UrlScraper |
| 3 | self.name = 'npm' | 3 | self.name = 'npm' |
| 4 | self.type = 'npm' | 4 | self.type = 'npm' |
| 5 | self.release = '6.4.0' | 5 | self.release = '7.1.2' |
| 6 | self.base_url = 'https://docs.npmjs.com/' | 6 | self.base_url = 'https://docs.npmjs.com/' |
| 7 | self.force_gzip = true | 7 | self.force_gzip = true |
| 8 | self.links = { | 8 | self.links = { |
| @@ -10,14 +10,20 @@ module Docs · 1 unmodified line |
| 10 | code: 'https://github.com/npm/npm' | 10 | code: 'https://github.com/npm/npm' |
| 11 | } | 11 | } |
| 12 | | 12 | |
| 13 | html_filters.push 'npm/entries', 'npm/clean_html', 'title' | 13 | html_filters.push 'npm/entries', 'npm/clean_html' |
| 14 | | 14 | |
| 15 | options[:max_image_size] = 130_000 | 15 | options[:max_image_size] = 130_000 |
| 16 | options[:container] = ->(filter) { filter.root_page? ? '.toc' : nil } | | |
| 17 | options[:title] = false | | |
| 18 | options[:root_title] = 'npm' | | |
| 19 | | 16 | |
| 20 | options[:skip] = %w(all misc/index) | 17 | options[:skip] = [ |
| | 18 | 'all', |
| | 19 | 'misc/index', |
| | 20 | 'cli', |
| | 21 | 'orgs/', |
| | 22 | 'removing-members-from-your-org', |
| | 23 | 'adding-members-to-your-org', |
| | 24 | 'downloading-and-installing-packages' |
| | 25 | ] |
| | 26 | |
| 21 | options[:skip_patterns] = [ | 27 | options[:skip_patterns] = [ |
| 22 | /\Aenterprise/, | 28 | /\Aenterprise/, |
| 23 | /\Acompany/, | 29 | /\Acompany/, |
| @@ -30,8 +36,45 @@ module Docs · 6 unmodified lines |
| 30 | npm is a trademark of npm, Inc. | 36 | npm is a trademark of npm, Inc. |
| 31 | HTML | 37 | HTML |
| 32 | | 38 | |
| | 39 | # fix duplicates |
| | 40 | options[:fix_urls] = -> (url) do |
| | 41 | url.sub!('private-modules/intro', 'creating-and-publishing-private-packages') |
| | 42 | url.sub!('cli/audit', 'cli/v6/commands/npm-audit') |
| | 43 | url.sub!('cli/uninstall', 'cli/v6/commands/npm-uninstall') |
| | 44 | url.sub!('cli/npm', 'cli/v6/commands/npm') |
| | 45 | url.sub!('cli-documentation', 'cli/v6') |
| | 46 | url.sub!('misc/registry', 'cli/v6/using-npm/registry') |
| | 47 | url.sub!('cli/adduser', 'cli/v6/commands/npm-adduser') |
| | 48 | url.sub!('cli/profile', 'cli/v6/commands/npm-profile') |
| | 49 | url.sub!('cli/token', 'cli/v6/commands/npm-token') |
| | 50 | url.sub!('cli/publish', 'cli/v6/commands/npm-publish') |
| | 51 | url.sub!('cli/unpublish', 'cli/v6/commands/npm-unpublish') |
| | 52 | url.sub!('cli/deprecate', 'cli/v6/commands/npm-deprecate') |
| | 53 | url.sub!('cli/access', 'cli/v6/commands/npm-access') |
| | 54 | url.sub!('misc/config', 'cli/v6/using-npm/config') |
| | 55 | url.sub!('misc/developers', 'cli/v6/using-npm/developers') |
| | 56 | url.sub!('managing-team-access-to-packages', 'managing-team-access-to-organization-packages') |
| | 57 | url.sub!('accepting-or-rejecting-an-org-invitation', 'accepting-or-rejecting-an-organization-invitation') |
| | 58 | url.sub!('org-roles-and-permissions', 'organization-roles-and-permissions') |
| | 59 | url.sub!('upgrading-to-a-paid-org-plan', 'upgrading-to-a-paid-organization-plan') |
| | 60 | url.sub!('files/package.json', 'cli/v6/configuring-npm/package-json') |
| | 61 | url.sub!('managing-team-access-to-org-packages', 'managing-team-access-to-organization-packages') |
| | 62 | url.sub!('about-package-json-and-package-lock-json-files', 'creating-a-package-json-file') |
| | 63 | url.sub!('cli/team', 'cli/v6/commands/npm-team') |
| | 64 | url.sub!('cli/version', 'cli/v6/commands/npm-version') |
| | 65 | url.sub!('creating-a-packge-json-file', 'cli/v6/configuring-npm/package-json') |
| | 66 | url.sub!('cli/outdated', 'cli/v6/commands/npm-outdated') |
| | 67 | url.sub!('cli/owner', 'cli/v6/commands/npm-owner') |
| | 68 | url.sub!('cli/install', 'cli/v6/commands/npm-install') |
| | 69 | url.sub!('cli/update', 'cli/v6/commands/npm-update') |
| | 70 | url.sub!('cli/config', 'cli/v6/commands/npm-config') |
| | 71 | url.sub!('cli/dist-tag', 'cli/v6/commands/npm-dist-tag') |
| | 72 | url |
| | 73 | end |
| | 74 | |
| 33 | def get_latest_version(opts) | 75 | def get_latest_version(opts) |
| 34 | get_latest_github_release('npm', 'cli', opts) | 76 | get_latest_github_release('npm', 'cli', opts) |
| 35 | end | 77 | end |
| | 78 | |
| 36 | end | 79 | end |
| 37 | end | 80 | end |