Add Lua documentation

pull/168/head
Thibaut 10 years ago
parent 4a930ee4eb
commit 81c9bfa874

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 69 KiB

@ -1,6 +1,6 @@
[
[ "2015-02-15",
"New <a href=\"/iojs/\">io.js</a> and <a href=\"/yii1/\">Yii 1.1</a> documentations"
"New <a href=\"/iojs/\">io.js</a>, <a href=\"/lua/\">Lua</a> and <a href=\"/yii1/\">Yii 1.1</a> documentations"
], [
"2015-02-08",
"New dark theme\nClick the icon in the bottom left corner to activate.\n<a href=\"https://github.com/Thibaut/devdocs/issues\" target=\"_blank\">Feedback</a> welcome :)"

@ -200,6 +200,11 @@ credits = [
'2012-2015 The Dojo Foundation',
'MIT',
'https://raw.github.com/lodash/lodash/master/LICENSE.txt'
], [
'Lua',
'19942015 Lua.org, PUC-Rio',
'MIT',
'http://www.lua.org/license.html'
], [
'Marionette.js',
'2014 Muted Solutions, LLC',

@ -46,6 +46,7 @@
'pages/laravel',
'pages/less',
'pages/lodash',
'pages/lua',
'pages/marionette',
'pages/markdown',
'pages/maxcdn',

@ -46,6 +46,7 @@
'pages/laravel',
'pages/less',
'pages/lodash',
'pages/lua',
'pages/marionette',
'pages/markdown',
'pages/maxcdn',

@ -86,3 +86,4 @@
%icon-light { background-position: 0 -14rem; }
%icon-light-white { background-position: -1rem -14rem; }
._icon-iojs:before { background-position: -2rem -14rem; }
._icon-lua:before { background-position: -3rem -14rem; }

@ -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
&copy; 1994&ndash;2015 Lua.org, PUC-Rio.<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 814 B

@ -0,0 +1 @@
http://lua-users.org/wiki/LuaLogo
Loading…
Cancel
Save