History

Update OpenJDK documentation (17)

Simon Legner committed 5 years ago

Commit a50f11f1 parent b67cf414 files · +29 −7Browse files

Unified · Split

4 files
  1. assets/javascripts/templates/pages/about_tmpl.coffee +1 −1
  2. assets/stylesheets/pages/_openjdk.scss +1 −0
  3. lib/docs/filters/openjdk/clean_html_new.rb +23 −2
  4. lib/docs/scrapers/openjdk.rb +4 −4
assets/javascripts/templates/pages/about_tmpl.coffee+1−1
@@ -598,7 +598,7 @@ credits = [ · 597 unmodified lines
598598 'https://octave.org/doc/interpreter/'
599599 ], [
600600 'OpenJDK',
601− '1993, 2020, Oracle and/or its affiliates. All rights reserved.<br>Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>Various third party code in OpenJDK is licensed under different licenses.<br>Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.',
601+ '1993, 2021, Oracle and/or its affiliates. All rights reserved.<br>Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>Various third party code in OpenJDK is licensed under different licenses.<br>Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.',
602602 'GPLv2',
603603 'http://openjdk.java.net/legal/gplv2+ce.html'
604604 ], [
assets/stylesheets/pages/_openjdk.scss+1−0
@@ -1,5 +1,6 @@
11 ._openjdk {
22 @extend %simple;
3+ > .inheritance { @extend %note; }
34
45 ul.inheritance { list-style: none; }
56 > ul.inheritance { @extend %note, %note-blue; }
lib/docs/filters/openjdk/clean_html_new.rb+23−2
@@ -7,6 +7,10 @@ module Docs · 6 unmodified lines
77 at_css('h1').content = "OpenJDK #{release} Documentation"
88 end
99
10+ css('.header > h1').each do |node|
11+ node.parent.before(node).remove
12+ end
13+
1014 css('.header .sub-title', 'hr', '.table-tabs').remove
1115
1216 # fix ul section that contains summaries or tables
@@ -30,7 +34,7 @@ module Docs · 17 unmodified lines
3034 end
3135
3236 # add syntax highlight to each method
33− css('.member-signature').each do |node|
37+ css('.type-signature, .member-signature').each do |node|
3438 node.content = node.content.sub(/\u200B/, '') # fix zero width space characters
3539
3640 node.name = 'pre'
@@ -40,8 +44,25 @@ module Docs · 3 unmodified lines
4044 node.css('span').each do |subnode|
4145 subnode.name = 'code'
4246 end
47+ end
4348
44−
49+ # convert pseudo tables (made from div) to real tables
50+ css('div.caption').remove
51+ css('.two-column-summary > .col-constructor-name').add_class('col-first')
52+ css('.two-column-summary, .three-column-summary').each do |table|
53+ # table.previous_element.remove if table.previous_element?.classes?.include?('caption')
54+ table.name = 'table'
55+ tr = nil
56+ table.css('div.col-first, div.col-second, div.col-last').each do |td|
57+ if td.classes.include?('col-first')
58+ table.add_child('<tr>')
59+ tr = table.last_element_child
60+ end
61+ td.name = 'td'
62+ td.name = 'th' if td.classes.include?('table-header')
63+ td.remove_attribute('class')
64+ tr.add_child(td.remove)
65+ end
4566 end
4667
4768 doc
lib/docs/scrapers/openjdk.rb+4−4
@@ -28,7 +28,7 @@ module Docs · 27 unmodified lines
2828 ]
2929
3030 options[:attribution] = <<-HTML
31− &copy; 1993, 2020, Oracle and/or its affiliates. All rights reserved.<br>
31+ &copy; 1993, 2021, Oracle and/or its affiliates. All rights reserved.<br>
3232 Documentation extracted from Debian's OpenJDK Development Kit package.<br>
3333 Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>
3434 Various third party code in OpenJDK is licensed under different licenses (see Debian package).<br>
@@ -37,10 +37,10 @@ module Docs · 2 unmodified lines
3737
3838 NEWFILTERS = ['openjdk/entries_new', 'openjdk/clean_html_new']
3939
40− version '15' do
41− self.release = '15.0.3'
40+ version '17' do
41+ self.release = '17'
4242 self.root_path = 'index.html'
43− self.base_url = 'https://docs.oracle.com/en/java/javase/15/docs/api/'
43+ self.base_url = 'https://docs.oracle.com/en/java/javase/17/docs/api/'
4444
4545 html_filters.push NEWFILTERS
4646