Add Fortran documentation

pull/384/head
Phil Scherer 9 years ago committed by Thibaut Courouble
parent f7a381c534
commit 56d9398148

@ -17,6 +17,7 @@
}
._cordova,
._fortran,
._grunt,
._haxe,
._influxdata,

@ -0,0 +1,18 @@
module Docs
class Fortran
class CleanHtmlFilter < Filter
def call
css('h2', 'h3', 'h4').each do |node|
node.name = 'h1'
end
# Move page anchor to page title
at_css('h1')['id'] = at_css('.node > a')['name']
css('.node', 'br').remove
doc
end
end
end
end

@ -0,0 +1,34 @@
module Docs
class Fortran
class EntriesFilter < Docs::EntriesFilter
REPLACE_TYPES = {
1 => 'Introduction',
2 => 'GNU Fortran Command Options',
3 => 'Runtime Environment Variables',
4 => 'Fortran 2003 and 2008 Status',
5 => 'Compiler Characteristics',
6 => 'Extensions',
7 => 'Mixed Language Programming',
8 => 'Coarray Programming',
9 => 'Intrinsic Procedures',
10 => 'Intrinsic Modules' }
def chapter_number
at_css('h1').content.to_i
end
def include_default_entry?
REPLACE_TYPES[chapter_number] and not at_css('ul.menu')
end
def get_name
at_css('h1').content.split(' ').drop(1).join(' ').split('—').first
end
def get_type
REPLACE_TYPES[chapter_number]
end
end
end
end

@ -0,0 +1,32 @@
module Docs
class Fortran < FileScraper
self.name = 'GNU Fortran'
self.slug = 'fortran'
self.type = 'fortran'
self.release = '5.3.0'
self.base_url = "https://gcc.gnu.org/onlinedocs/gcc-#{release}/gfortran/"
self.dir = ''
self.root_path = 'index.html'
self.links = {
home: 'https://gcc.gnu.org/fortran/'
}
html_filters.push 'fortran/clean_html', 'fortran/entries'
options[:skip_patterns] = [
/Funding/,
/Projects/,
/Copying/,
/License/,
/Proposed/,
/Contribut/,
/Index/
]
options[:attribution] = <<-HTML
&copy; Free Software Foundation<br>
Licensed under the GNU Free Documentation License version 1.3.
HTML
end
end

@ -0,0 +1 @@
https://commons.wikimedia.org/wiki/File:Fortran.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Loading…
Cancel
Save