Skip to content

Commit afc9e53

Browse files
committed
Update Express documentation (5.1.0)
1 parent 786a238 commit afc9e53

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lib/docs/filters/express/clean_html.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ def call
77
i += 1 while n && n = n.previous_element
88
at_css('h1')['data-level'] = i
99

10-
@doc = at_css('#api-doc, .content')
10+
@doc = at_css('#api-doc, main, .content')
11+
12+
css('nav').remove # aria-labelledby="sidebar-heading"
1113

1214
css('section', 'div.highlighter-rouge').each do |node|
1315
node.before(node.children).remove
1416
end
1517

16-
@doc = at_css('#page-doc') unless root_page?
17-
1818
if root_page?
1919
at_css('h1').remove
2020
css('> header', '#menu').remove

lib/docs/scrapers/express.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ module Docs
22
class Express < UrlScraper
33
self.name = 'Express'
44
self.type = 'express'
5-
self.release = '4.21.2'
65
self.base_url = 'https://expressjs.com/en/'
7-
self.root_path = '4x/api.html'
86
self.initial_paths = %w(
97
starter/installing.html
108
guide/routing.html
@@ -29,6 +27,16 @@ class Express < UrlScraper
2927
Licensed under the Creative Commons Attribution-ShareAlike License v3.0.
3028
HTML
3129

30+
version do
31+
self.release = '5.1.0'
32+
self.root_path = '5x/api.html'
33+
end
34+
35+
version '4' do
36+
self.release = '4.21.2'
37+
self.root_path = '4x/api.html'
38+
end
39+
3240
def get_latest_version(opts)
3341
get_npm_version('express', opts)
3442
end

0 commit comments

Comments
 (0)