Skip to content

Commit faaff85

Browse files
committed
Update Nokogiri documentation (1.19.4)
1 parent 5ced92b commit faaff85

4 files changed

Lines changed: 37 additions & 11 deletions

File tree

docs/file-scrapers.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ done
116116

117117
## RDoc
118118

119-
### Nokogiri
120119
### Ruby / Minitest
121120

122121
```sh
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Docs
2+
class Nokogiri2
3+
class CleanHtmlFilter < Docs::Rdoc::CleanHtmlFilter
4+
def root
5+
# Turn the collapsible navigation section into a plain list
6+
css('.nav-section-header').remove
7+
css('svg').remove
8+
css('details', 'summary').each do |node|
9+
node.before(node.children).remove
10+
end
11+
end
12+
end
13+
end
14+
end
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module Docs
2+
class Nokogiri2
3+
class ContainerFilter < Docs::Rdoc::ContainerFilter
4+
def call
5+
return super unless root_page?
6+
7+
# RDoc no longer generates a table of contents page, and lists the
8+
# classes in the sidebar navigation instead. Use that list as the root
9+
# page, both to serve as an index and to make the pages reachable.
10+
at_css('#classindex-section')
11+
end
12+
end
13+
end
14+
end

lib/docs/scrapers/nokogiri2.rb

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
module Docs
2-
class Nokogiri2 < Rdoc
3-
# Instructions:
4-
# 1. Download the latest release at https://github.com/sparklemotion/nokogiri/releases
5-
# 2. Run "bundle install && bundle exec rake docs" (in the Nokogiri directory)
6-
# 4. Copy the "doc" directory to "docs/nokogiri"
7-
2+
class Nokogiri2 < UrlScraper
83
self.name = 'Nokogiri'
94
self.slug = 'nokogiri'
10-
self.release = '1.14.2'
11-
self.base_url = "https://nokogiri.org/rdoc/"
5+
self.type = 'rdoc'
6+
self.release = '1.19.4'
7+
self.base_url = 'https://nokogiri.org/rdoc/'
8+
self.root_path = 'index.html'
129

13-
html_filters.replace 'rdoc/entries', 'nokogiri2/entries'
10+
html_filters.replace 'container', 'nokogiri2/container'
11+
html_filters.push 'nokogiri2/entries', 'nokogiri2/clean_html', 'title'
1412

13+
options[:title] = false
1514
options[:root_title] = 'Nokogiri'
1615
options[:only_patterns] = [/\ANokogiri/, /\AXSD/]
1716

1817
options[:attribution] = <<-HTML
19-
&copy; 2008&ndash;2023 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid,<br>
18+
&copy; 2008&ndash;2026 by Mike Dalessio, Aaron Patterson, Yoko Harada, Akinori MUSHA, John Shahid,<br>
2019
Karol Bucek, Sam Ruby, Craig Barnes, Stephen Checkoway, Lars Kanis, Sergio Arbeo,<br>
2120
Timothy Elliott, Nobuyoshi Nakada, Charles Nutter, Patrick Mahoney
2221
Licensed under the MIT License.

0 commit comments

Comments
 (0)