History

fix: 🐛 babel document duplicate and do not display

ChandlerVer5 committed 3 years ago

Commit 18a84c71 parent b1981dd2 files · +8 −4Browse files

Unified · Split

2 files
  1. lib/docs/filters/babel/entries.rb +4 −4
  2. lib/docs/scrapers/babel.rb +4 −0
lib/docs/filters/babel/entries.rb+4−4
@@ -3,13 +3,13 @@ module Docs · 2 unmodified lines
3 class EntriesFilter < Docs::EntriesFilter3 class EntriesFilter < Docs::EntriesFilter
4 4
5 ENTRIES = {5 ENTRIES = {
6 'Usage' => ['Options', 'Config Files', '@babel/cli', '@babel/polyfill',6 'Usage' => ['Options', 'Plugins', 'Config Files', 'Compiler assumptions', '@babel/cli', '@babel/polyfill',
7 '@babel/plugin-transform-runtime', '@babel/register'],7 '@babel/plugin-transform-runtime', '@babel/register'],
8 8
9 'Presets' => ['@babel/preset-env', '@babel/preset-flow', '@babel/preset-react', '@babel/preset-typescript'],9 'Presets' => ['@babel/preset'],
10 10
11 'Tooling' => ['@babel/parser', '@babel/core', '@babel/generator', '@babel/code-frame',11 'Tooling' => ['@babel/parser', '@babel/core', '@babel/generator', '@babel/code-frame',
12 '@babel/helpers', '@babel/runtime', '@babel/template', '@babel/traverse', '@babel/types']12 '@babel/helper', '@babel/runtime', '@babel/template', '@babel/traverse', '@babel/types', '@babel/standalone']
13 }13 }
14 14
15 def get_name15 def get_name
@@ -18,7 +18,7 @@ module Docs · 2 unmodified lines
18 18
19 def get_type19 def get_type
20 ENTRIES.each do |key, value|20 ENTRIES.each do |key, value|
21 return key if value.include?(name)21 return key if value.any? { |val| name.start_with?(val) }
22 return 'Other Plugins' if subpath.include?('babel-plugin')22 return 'Other Plugins' if subpath.include?('babel-plugin')
23 end23 end
24 end24 end
lib/docs/scrapers/babel.rb+4−0
@@ -24,6 +24,10 @@ module Docs · 23 unmodified lines
24 /roadmap/24 /roadmap/
25 ]25 ]
26 26
27 options[:skip_link] = ->(link) {
28 link['href'].include?('https://babeljs.io/docs/en/')
29 }
30
27 options[:attribution] = <<-HTML31 options[:attribution] = <<-HTML
28 &copy; 2014-present Sebastian McKenzie<br>32 &copy; 2014-present Sebastian McKenzie<br>
29 Licensed under the MIT License.33 Licensed under the MIT License.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t