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
598 'https://octave.org/doc/interpreter/'598 'https://octave.org/doc/interpreter/'
599 ], [599 ], [
600 'OpenJDK',600 '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.',
602 'GPLv2',602 'GPLv2',
603 'http://openjdk.java.net/legal/gplv2+ce.html'603 'http://openjdk.java.net/legal/gplv2+ce.html'
604 ], [604 ], [
assets/stylesheets/pages/_openjdk.scss+1−0
@@ -1,5 +1,6 @@
1._openjdk {1._openjdk {
2 @extend %simple;2 @extend %simple;
3 > .inheritance { @extend %note; }
3 4
4 ul.inheritance { list-style: none; }5 ul.inheritance { list-style: none; }
5 > ul.inheritance { @extend %note, %note-blue; }6 > 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
7 at_css('h1').content = "OpenJDK #{release} Documentation"7 at_css('h1').content = "OpenJDK #{release} Documentation"
8 end8 end
9 9
10 css('.header > h1').each do |node|
11 node.parent.before(node).remove
12 end
13
10 css('.header .sub-title', 'hr', '.table-tabs').remove14 css('.header .sub-title', 'hr', '.table-tabs').remove
11 15
12 # fix ul section that contains summaries or tables16 # fix ul section that contains summaries or tables
@@ -30,7 +34,7 @@ module Docs · 17 unmodified lines
30 end34 end
31 35
32 # add syntax highlight to each method36 # add syntax highlight to each method
33 css('.member-signature').each do |node|37 css('.type-signature, .member-signature').each do |node|
34 node.content = node.content.sub(/\u200B/, '') # fix zero width space characters38 node.content = node.content.sub(/\u200B/, '') # fix zero width space characters
35 39
36 node.name = 'pre'40 node.name = 'pre'
@@ -40,8 +44,25 @@ module Docs · 3 unmodified lines
40 node.css('span').each do |subnode|44 node.css('span').each do |subnode|
41 subnode.name = 'code'45 subnode.name = 'code'
42 end46 end
47 end
43 48
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
45 end66 end
46 67
47 doc68 doc
lib/docs/scrapers/openjdk.rb+4−4
@@ -28,7 +28,7 @@ module Docs · 27 unmodified lines
28 ]28 ]
29 29
30 options[:attribution] = <<-HTML30 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>
32 Documentation extracted from Debian's OpenJDK Development Kit package.<br>32 Documentation extracted from Debian's OpenJDK Development Kit package.<br>
33 Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>33 Licensed under the GNU General Public License, version 2, with the Classpath Exception.<br>
34 Various third party code in OpenJDK is licensed under different licenses (see Debian package).<br>34 Various third party code in OpenJDK is licensed under different licenses (see Debian package).<br>
@@ -37,10 +37,10 @@ module Docs · 2 unmodified lines
37 37
38 NEWFILTERS = ['openjdk/entries_new', 'openjdk/clean_html_new']38 NEWFILTERS = ['openjdk/entries_new', 'openjdk/clean_html_new']
39 39
40 version '15' do40 version '17' do
41 self.release = '15.0.3'41 self.release = '17'
42 self.root_path = 'index.html'42 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/'
44 44
45 html_filters.push NEWFILTERS45 html_filters.push NEWFILTERS
46 46