mirror of https://github.com/freeCodeCamp/devdocs
parent
4a930ee4eb
commit
81c9bfa874
Before Width: | Height: | Size: 27 KiB After Width: | Height: | Size: 27 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 69 KiB |
@ -0,0 +1,10 @@
|
||||
._lua {
|
||||
padding-left: 1rem;
|
||||
|
||||
h1, h2 { margin-left: -1rem; }
|
||||
h2 { @extend %block-heading; }
|
||||
h3 { @extend %block-label, %label-blue; }
|
||||
h4 { font-size: inherit; }
|
||||
|
||||
.apii { float: right; }
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
module Docs
|
||||
class Lua
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('hr', 'h1 img', '.footer').remove
|
||||
|
||||
css('[name]').each do |node|
|
||||
node['id'] = node['name']
|
||||
node.remove_attribute('name')
|
||||
end
|
||||
|
||||
css('h1 > a[id]', 'h2 > a[id]', 'h3 > a[id]').each do |node|
|
||||
node.parent['id'] = node['id']
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
3.times { at_css('h1[id="1"]').previous_element.remove }
|
||||
|
||||
css('.apii').each do |node|
|
||||
node.parent.previous_element << node
|
||||
end
|
||||
|
||||
css('pre').each do |node|
|
||||
node.content = node.content.remove(/\A\s*\n/).rstrip.strip_heredoc
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,29 @@
|
||||
module Docs
|
||||
class Lua
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
type = nil
|
||||
|
||||
doc.children.each_with_object [] do |node, entries|
|
||||
if node.name == 'h1'
|
||||
type = node.content.strip
|
||||
type.remove! %r{.+\u{2013}\s+}
|
||||
type.remove! 'The '
|
||||
type = 'API' if type == 'Application Program Interface'
|
||||
end
|
||||
|
||||
next if type && type.include?('Incompatibilities')
|
||||
next if node.name == 'h2' && type.in?(%w(API Auxiliary\ Library Standard\ Libraries))
|
||||
|
||||
if node.name == 'h2' || node.name == 'h3'
|
||||
name = node.content
|
||||
name.remove! %r{.+\u{2013}\s+}
|
||||
name.remove! %r{\[.+\]}
|
||||
name.gsub! %r{\s+\(.*\)}, '()'
|
||||
entries << [name, node['id'], type]
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,17 @@
|
||||
module Docs
|
||||
class Lua < UrlScraper
|
||||
self.type = 'lua'
|
||||
self.version = '5.3'
|
||||
self.base_url = 'http://www.lua.org/manual/5.3/'
|
||||
self.root_path = 'manual.html'
|
||||
|
||||
html_filters.push 'lua/clean_html', 'lua/entries'
|
||||
|
||||
options[:skip_links] = true
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 1994–2015 Lua.org, PUC-Rio.<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 814 B |
@ -0,0 +1 @@
|
||||
http://lua-users.org/wiki/LuaLogo
|
Loading…
Reference in new issue