History

Improve GitHub scraper

Thibaut Courouble committed 9 years ago

Commit 85fffdc1 parent 80cc88c4 files · +10 −10Browse files

Showing the changes to lib/docs (2 of 4 files). Show all

Unified · Split

2 files
  1. lib/docs/filters/github/clean_html.rb +5 −1
  2. lib/docs/filters/nginx_lua_module/clean_html.rb +4 −0
lib/docs/filters/github/clean_html.rb+5−1
@@ -8,11 +8,15 @@ module Docs · 7 unmodified lines
8 end8 end
9 9
10 css('.highlight > pre').each do |node|10 css('.highlight > pre').each do |node|
11 node['class'] = node.parent['class']11 node['data-language'] = node.parent['class'][/highlight-source-(\w+)/, 1]
12 node.content = node.content.strip_heredoc.gsub(' ', ' ')12 node.content = node.content.strip_heredoc.gsub(' ', ' ')
13 node.parent.replace(node)13 node.parent.replace(node)
14 end14 end
15 15
16 css('pre > code').each do |node|
17 node.before(node.children).remove
18 end
19
16 doc20 doc
17 end21 end
18 end22 end
lib/docs/filters/nginx_lua_module/clean_html.rb+4−0
@@ -8,6 +8,10 @@ module Docs · 7 unmodified lines
8 node.name = node.name.sub(/\d/) { |i| i.to_i + 1 }8 node.name = node.name.sub(/\d/) { |i| i.to_i + 1 }
9 end9 end
10 10
11 css('a > img').each do |node|
12 node.parent.before(node.parent.children).remove
13 end
14
11 doc15 doc
12 end16 end
13 end17 end

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