diff --git a/assets/images/icons.png b/assets/images/icons.png index 213a9dc7..5db18471 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index d104bed8..496ccf13 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index ca9705d8..795a5fd8 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2016-04-10", - "New documentations: Support tables (caniuse.com) and GNU Fortran" + "New documentations: Support tables (caniuse.com), GCC and GNU Fortran" ], [ "2016-03-27", "New documentation: TypeScript" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index c493c04e..cc670c77 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -194,16 +194,16 @@ credits = [ '2009-2015 TJ Holowaychuk', 'MIT', 'https://raw.githubusercontent.com/visionmedia/express/master/LICENSE' + ], [ + 'GCC
GNU Fortran', + 'Free Software Foundation', + 'GFDL', + 'https://www.gnu.org/licenses/fdl-1.3.en.html' ], [ 'Git', '2005-2016 Linus Torvalds and others', 'GPLv2', 'https://raw.githubusercontent.com/git/git/master/COPYING' - ], [ - 'GNU Fortran', - 'Free Software Foundation', - 'GFDL', - 'https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gfortran/GNU-Free-Documentation-License.html' ], [ 'Go', 'Google, Inc.', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 2445cd1b..f76391cd 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -135,3 +135,4 @@ ._icon-typescript:before { background-position: -9rem -10rem; } ._icon-browser_support_tables:before { background-position: 0rem -11rem; } ._icon-gnu_fortran:before { background-position: -1rem -11rem; } +._icon-gcc:before { background-position: -2rem -11rem; } diff --git a/assets/stylesheets/pages/_simple.scss b/assets/stylesheets/pages/_simple.scss index bf2f4bc8..77745293 100644 --- a/assets/stylesheets/pages/_simple.scss +++ b/assets/stylesheets/pages/_simple.scss @@ -17,7 +17,7 @@ } ._cordova, -._gnu_fortran, +._gnu, ._grunt, ._haxe, ._influxdata, diff --git a/lib/docs/filters/gnu_fortran/clean_html.rb b/lib/docs/filters/gnu/clean_html.rb similarity index 88% rename from lib/docs/filters/gnu_fortran/clean_html.rb rename to lib/docs/filters/gnu/clean_html.rb index c14eca21..8a38a49f 100644 --- a/lib/docs/filters/gnu_fortran/clean_html.rb +++ b/lib/docs/filters/gnu/clean_html.rb @@ -1,5 +1,5 @@ module Docs - class GnuFortran + class Gnu class CleanHtmlFilter < Filter def call heading = at_css('h1, h2, h3, h4, h5') @@ -26,11 +26,11 @@ module Docs node.inner_html = node.inner_html.strip_heredoc.strip end - css('dt > em', 'acronym', 'dfn').each do |node| + css('dt > em', 'acronym', 'dfn', 'cite').each do |node| node.before(node.children).remove end - css('.node', 'br').remove + css('.node', 'br', 'hr').remove doc end diff --git a/lib/docs/filters/gnu_fortran/entries.rb b/lib/docs/filters/gnu/entries.rb similarity index 66% rename from lib/docs/filters/gnu_fortran/entries.rb rename to lib/docs/filters/gnu/entries.rb index a5388671..459ea391 100644 --- a/lib/docs/filters/gnu_fortran/entries.rb +++ b/lib/docs/filters/gnu/entries.rb @@ -1,5 +1,5 @@ module Docs - class GnuFortran + class Gnu class EntriesFilter < Docs::EntriesFilter TYPE_BY_CHAPTER = { } @@ -9,32 +9,32 @@ module Docs end def get_name - at_css('h1').content.split(' ').drop(1).join(' ').split('—').first + name = at_css('h1').content + name.remove! %r{\A[\d\.]*} + name.split('—').first.strip end def get_type "#{chapter_number}. #{TYPE_BY_CHAPTER[chapter_number]}" end - def include_default_entry? - !at_css('ul.menu') - end - private def detect_chapters + TYPE_BY_CHAPTER.clear # YOLO css('.contents > ul > li > a').each do |node| index = node.content.strip.to_i next unless index > 0 name = node.content.split(' ').drop(1).join(' ') name.remove! 'GNU Fortran ' - name.remove! %r{:.*} - TYPE_BY_CHAPTER[index] = name # YOLO + name.remove! 'with GCC' + name.remove! %r{[\:\u{2013}\u{2014}].*} + TYPE_BY_CHAPTER[index] = name end end def chapter_number - at_css('h1').content.to_i + [at_css('h1').content.to_i, 1].max end end end diff --git a/lib/docs/scrapers/gnu.rb b/lib/docs/scrapers/gnu.rb new file mode 100644 index 00000000..f920e14e --- /dev/null +++ b/lib/docs/scrapers/gnu.rb @@ -0,0 +1,30 @@ +module Docs + class Gnu < FileScraper + self.type = 'gnu' + self.root_path = 'index.html' + self.abstract = 'true' + + html_filters.push 'gnu/clean_html', 'gnu/entries' + + options[:skip] = %w( + GNU-Project.html + Service.html + ) + + options[:skip_patterns] = [ + /Funding/, + /Projects/, + /Copying/, + /License/, + /Proposed/, + /Contribut/, + /Index/, + /\ABug/ + ] + + options[:attribution] = <<-HTML + © Free Software Foundation
+ Licensed under the GNU Free Documentation License, Version 1.3. + HTML + end +end diff --git a/lib/docs/scrapers/gnu/gcc.rb b/lib/docs/scrapers/gnu/gcc.rb new file mode 100644 index 00000000..00ab483b --- /dev/null +++ b/lib/docs/scrapers/gnu/gcc.rb @@ -0,0 +1,78 @@ +module Docs + class Gcc < Gnu + self.name = 'GCC' + self.slug = 'gcc' + self.links = { + home: 'https://gcc.gnu.org/' + } + + html_filters.push 'title' + + options[:root_title] = 'Using the GNU Compiler Collection (GCC)' + options[:title] = false + + options[:replace_paths] = { + 'AssemblerTemplate.html' => 'Extended-Asm.html', + 'AVR-Named-Address-Spaces.html' => 'Named-Address-Spaces.html', + 'AVR-Variable-Attributes.html' => 'Variable-Attributes.html', + 'Clobbers.html' => 'Extended-Asm.html', + 'dashMF.html' => 'Preprocessor-Options.html', + 'GotoLabels.html' => 'Extended-Asm.html', + 'InputOperands.html' => 'Extended-Asm.html', + 'OutputOperands.html' => 'Extended-Asm.html', + 'PowerPC-Type-Attributes.html' => 'Type-Attributes.html', + 'SPU-Type-Attributes.html' => 'Type-Attributes.html', + 'Type_002dpunning.html' => 'Optimize-Options.html', + 'Volatile.html' => 'Extended-Asm.html', + 'Wtrigraphs.html' => 'Preprocessor-Options.html', + 'x86-Type-Attributes.html' => 'Type-Attributes.html', + 'x86-Variable-Attributes.html' => 'Variable-Attributes.html', + 'x86floatingpointasmoperands.html' => 'Extended-Asm.html', + 'x86Operandmodifiers.html' => 'Extended-Asm.html', + + 'Example-of-asm-with-clobbered-asm-reg.html' => 'Extended-Asm.html', + 'Extended-asm-with-goto.html' => 'Extended-Asm.html', + 'fdollars_002din_002didentifiers.html' => 'Preprocessor-Options.html', + 'i386-Type-Attributes.html' => 'Variable-Attributes.html', + 'i386-Variable-Attributes.html' => 'Variable-Attributes.html' + } + + CPP_PATHS = { + 'dashMF.html' => 'Invocation.html', + 'fdollars_002din_002didentifiers.html' => 'Invocation.html', + 'Identifier-characters.html' => 'Implementation_002ddefined-behavior.html', + 'trigraphs.html' => 'Initial-processing.html', + 'Wtrigraphs.html' => 'Invocation.html' + } + + version '5' do + self.release = '5.3.0' + self.dir = '/Users/Thibaut/DevDocs/Docs/gcc5' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" + end + + version '5 CPP' do + self.release = '5.3.0' + self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp5' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" + + options[:root_title] = false + options[:replace_paths] = CPP_PATHS + end + + version '4' do + self.release = '4.9.3' + self.dir = '/Users/Thibaut/DevDocs/Docs/gcc4' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gcc/" + end + + version '4 CPP' do + self.release = '4.9.3' + self.dir = '/Users/Thibaut/DevDocs/Docs/gcpp4' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/cpp/" + + options[:root_title] = false + options[:replace_paths] = CPP_PATHS + end + end +end diff --git a/lib/docs/scrapers/gnu/gnu_fortran.rb b/lib/docs/scrapers/gnu/gnu_fortran.rb new file mode 100644 index 00000000..67890ae1 --- /dev/null +++ b/lib/docs/scrapers/gnu/gnu_fortran.rb @@ -0,0 +1,21 @@ +module Docs + class GnuFortran < Gnu + self.name = 'GNU Fortran' + self.slug = 'gnu_fortran' + self.links = { + home: 'https://gcc.gnu.org/fortran/' + } + + version '5' do + self.release = '5.3.0' + self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran5' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" + end + + version '4' do + self.release = '4.9.3' + self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran4' + self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" + end + end +end diff --git a/lib/docs/scrapers/gnu_fortran.rb b/lib/docs/scrapers/gnu_fortran.rb deleted file mode 100644 index 90b17077..00000000 --- a/lib/docs/scrapers/gnu_fortran.rb +++ /dev/null @@ -1,40 +0,0 @@ -module Docs - class GnuFortran < FileScraper - self.name = 'GNU Fortran' - self.slug = 'gnu_fortran' - self.type = 'gnu_fortran' - self.dir = '/Users/Thibaut/DevDocs/Docs/gfortran' - self.root_path = 'index.html' - - self.links = { - home: 'https://gcc.gnu.org/fortran/' - } - - html_filters.push 'gnu_fortran/clean_html', 'gnu_fortran/entries' - - options[:skip_patterns] = [ - /Funding/, - /Projects/, - /Copying/, - /License/, - /Proposed/, - /Contribut/, - /Index/ - ] - - options[:attribution] = <<-HTML - © Free Software Foundation
- Licensed under the GNU Free Documentation License, Version 1.3. - HTML - - version '5' do - self.release = '5.3.0' - self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" - end - - version '4' do - self.release = '4.9.3' - self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/" - end - end -end diff --git a/public/icons/docs/gcc/16.png b/public/icons/docs/gcc/16.png new file mode 100644 index 00000000..baf38c1e Binary files /dev/null and b/public/icons/docs/gcc/16.png differ diff --git a/public/icons/docs/gcc/16@2x.png b/public/icons/docs/gcc/16@2x.png new file mode 100644 index 00000000..ffa371b2 Binary files /dev/null and b/public/icons/docs/gcc/16@2x.png differ diff --git a/public/icons/docs/gcc/GCC.png b/public/icons/docs/gcc/GCC.png new file mode 100644 index 00000000..1f72f8a9 Binary files /dev/null and b/public/icons/docs/gcc/GCC.png differ