Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 96 KiB |
@ -1,14 +1,8 @@
|
|||||||
.REFBODY {
|
._erlang {
|
||||||
margin-bottom: 20px;
|
@extend %simple;
|
||||||
}
|
|
||||||
.REFBODY+p {
|
h3.code { @extend %code; }
|
||||||
margin-top: 30px;
|
.note { @extend %note; }
|
||||||
margin-bottom: 5px;
|
.warning { @extend %note, %note-red; }
|
||||||
}
|
.note .label, .warning .label { font-weight: bold; }
|
||||||
.function-name {
|
|
||||||
font-family: $monoFont;
|
|
||||||
display: block;
|
|
||||||
margin: 0;
|
|
||||||
min-height: none;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
}
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
module Docs
|
|
||||||
class Erlang
|
|
||||||
class AttributionFilter < Docs::AttributionFilter
|
|
||||||
def attribution_link
|
|
||||||
%(<a href="#{base_url}" class="_attribution-link">#{base_url}</a>)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,43 +1,35 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Erlang
|
class Erlang
|
||||||
class EntriesFilter < Docs::EntriesFilter
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
|
||||||
def get_name
|
def get_name
|
||||||
at_css('h1').try(:content).try(:strip)
|
name = at_css('h1').content.strip
|
||||||
|
name.prepend 'Guide: ' if doc.inner_html.include?('<strong>User\'s Guide</strong>')
|
||||||
|
name
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_type
|
def get_type
|
||||||
return nil if 'STDLIB Reference Manual' == name
|
type = subpath[/lib\/(.+?)[\-\/]/, 1]
|
||||||
name
|
type << "/#{name}" if type == 'stdlib' && entry_nodes.length >= 10
|
||||||
|
type
|
||||||
end
|
end
|
||||||
|
|
||||||
def additional_entries
|
def include_default_entry?
|
||||||
css('div.REFBODY+p > a').map do |node|
|
!at_css('.frontpage')
|
||||||
|
end
|
||||||
id = node.attribute('name').value
|
|
||||||
|
|
||||||
# Here, "node" represents an empty <a> tag. It will later be removed
|
|
||||||
# by CleanTextFilter.
|
|
||||||
# We need to pass its id attribute to another element in order to
|
|
||||||
# make the function anchors in the sidebar work properly.
|
|
||||||
node.next_sibling['id'] = id
|
|
||||||
node.next_sibling['class'] = 'function-name'
|
|
||||||
|
|
||||||
if id == name
|
|
||||||
# Module index page
|
|
||||||
[name, id, name]
|
|
||||||
else
|
|
||||||
# Erlang functions are identified
|
|
||||||
# by name + arity (no. of parameters).
|
|
||||||
# The notation is func_name/arity
|
|
||||||
|
|
||||||
# Replaces the last hyphen with a slash.
|
def additional_entries
|
||||||
# E.g: to_string-3 becomes to_string/3
|
entry_nodes.map do |node|
|
||||||
function_name = id.gsub(/\-(?<arity>.*)$/, '/\k<arity>')
|
id = node['name']
|
||||||
["#{name}:" + function_name, id, name]
|
name = id.gsub %r{\-(?<arity>.*)\z}, '/\k<arity>'
|
||||||
end
|
name.remove! 'Module:'
|
||||||
|
name.prepend "#{self.name}:"
|
||||||
|
[name, id]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def entry_nodes
|
||||||
|
@entry_nodes ||= css('div.REFBODY + p > a')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
module Docs
|
||||||
|
class Erlang
|
||||||
|
class PreCleanHtmlFilter < Filter
|
||||||
|
def call
|
||||||
|
css('.flipMenu li[title] > a').remove
|
||||||
|
doc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -1,40 +1,43 @@
|
|||||||
module Docs
|
module Docs
|
||||||
class Erlang < FileScraper
|
class Erlang < FileScraper
|
||||||
self.version = '18.1'
|
|
||||||
self.type = 'erlang'
|
self.type = 'erlang'
|
||||||
self.dir = File.expand_path('~/devdocs/erlang')
|
|
||||||
self.base_url = 'http://www.erlang.org/doc/'
|
|
||||||
self.root_path = 'doc/index.html'
|
self.root_path = 'doc/index.html'
|
||||||
self.links = {
|
self.links = {
|
||||||
home: 'http://erlang.org/'
|
home: 'https://www.erlang.org/',
|
||||||
|
code: 'https://github.com/erlang/otp'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html_filters.insert_after 'container', 'erlang/pre_clean_html'
|
||||||
html_filters.push 'erlang/entries', 'erlang/clean_html'
|
html_filters.push 'erlang/entries', 'erlang/clean_html'
|
||||||
|
|
||||||
# The folder structure of the offline documentation
|
options[:only_patterns] = [/\Alib/]
|
||||||
# differs from the online structure. We need
|
|
||||||
# to replace the attribution filter to generate the
|
|
||||||
# right attribution_link
|
|
||||||
text_filters.replace 'attribution', 'erlang/attribution'
|
|
||||||
|
|
||||||
# Do not scrape these unnecessary links
|
|
||||||
options[:skip_patterns] = [
|
options[:skip_patterns] = [
|
||||||
/\.pdf$/,
|
/pdf/,
|
||||||
/users_guide\.html$/,
|
/release_notes/,
|
||||||
/release_notes\.html$/,
|
/result/,
|
||||||
/\/html\/.*_app\.html$/,
|
/java/,
|
||||||
/\/html\/unicode_usage\.html$/,
|
/\/html\/.*_app\.html\z/,
|
||||||
/\/html\/io_protocol\.html$/
|
/_examples\.html\z/,
|
||||||
|
/\Alib\/edoc/,
|
||||||
|
/\Alib\/erl_docgen/,
|
||||||
|
/\Alib\/hipe/,
|
||||||
|
/\Alib\/ose/,
|
||||||
|
/\Alib\/test_server/,
|
||||||
|
/\Alib\/jinterface/,
|
||||||
|
/\Alib\/wx/,
|
||||||
|
/\Alib\/ic/,
|
||||||
|
/\Alib\/Cos/i
|
||||||
]
|
]
|
||||||
|
|
||||||
options[:title] = false
|
|
||||||
|
|
||||||
# Scrape stdlib documentation only
|
|
||||||
options[:only_patterns] = [/stdlib/]
|
|
||||||
|
|
||||||
options[:attribution] = <<-HTML
|
options[:attribution] = <<-HTML
|
||||||
Copyright © 1999-2015 Ericsson AB<br>
|
© 1999–2015 Ericsson AB<br>
|
||||||
Licensed under the Apache License, Version 2.0.
|
Licensed under the Apache License, Version 2.0.
|
||||||
HTML
|
HTML
|
||||||
|
|
||||||
|
version '18' do
|
||||||
|
self.release = '18.2'
|
||||||
|
self.dir = '/Users/Thibaut/DevDocs/Docs/Erlang18'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 407 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 725 B |
@ -1,2 +1 @@
|
|||||||
http://www.pixelstech.net/images/icons/article_type/Erlang_logo.png
|
https://github.com/Kapeli/Dash-X-Platform-Resources
|
||||||
https://s3.amazonaws.com/cloud.ohloh.net/attachments/1364/erlang2_small.png
|
|