Add Apache documentation

pull/205/head
Thibaut 10 years ago
parent 6f1ff802f9
commit 0a09c8904e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

After

Width:  |  Height:  |  Size: 76 KiB

@ -1,7 +1,7 @@
[
[
"2015-04-26",
"New <a href=\"/npm/\">npm</a> documentation"
"New <a href=\"/apache_http_server/\">Apache HTTP Server</a> and <a href=\"/npm/\">npm</a> documentations"
], [
"2015-03-22",
"New <a href=\"/meteor/\">Meteor</a> and <a href=\"/mocha/\">mocha</a> documentations"

@ -80,6 +80,11 @@ credits = [
'2010-2015 Google, Inc.',
'CC BY',
'http://creativecommons.org/licenses/by/3.0/'
], [
'Apache HTTP Server',
'The Apache Software Foundation',
'Apache',
'http://www.apache.org/licenses/LICENSE-2.0'
], [
'Backbone.js',
'2010-2014 Jeremy Ashkenas, DocumentCloud',

@ -30,6 +30,7 @@
@import 'pages/base',
'pages/angular',
'pages/apache',
'pages/bower',
'pages/c',
'pages/chai',

@ -30,6 +30,7 @@
@import 'pages/base',
'pages/angular',
'pages/apache',
'pages/bower',
'pages/c',
'pages/chai',

@ -99,4 +99,5 @@
._icon-symfony:before { background-position: -5rem -7rem; }
._icon-mocha:before { background-position: -6rem -7rem; }
._icon-meteor:before { background-position: -7rem -7rem; @extend %darkIconFix !optional; }
._icon-npm:before { background-position: -8rem -7rem }
._icon-npm:before { background-position: -8rem -7rem; }
._icon-apache_http_server:before { background-position: -9rem -7rem; }

@ -0,0 +1,6 @@
._apache {
@extend %simple;
.note, .warning { @extend %note; }
.warning { @extend %note-red; }
}

@ -0,0 +1,41 @@
module Docs
class Apache
class CleanHtmlFilter < Filter
def call
if root_page?
doc.children = css('h1, .category')
return doc
end
css('.toplang', '#quickview', '.top').remove
css('> .section', '#preamble', 'a[href*="dict.html"]', 'code var', 'code strong').each do |node|
node.before(node.children).remove
end
css('p > code:first-child:last-child', 'td > code:first-child:last-child').each do |node|
next if node.previous.try(:content).present? || node.next.try(:content).present?
node.inner_html = node.inner_html.squish.gsub(/<br(\ \/)?>\s*/, "\n")
node.content = node.content.strip
node.name = 'pre' if node.content =~ /\s/
node.parent.before(node.parent.children).remove if node.parent.name == 'p'
end
css('code').each do |node|
node.inner_html = node.inner_html.squish
end
css('.note h3', '.warning h3').each do |node|
node.before("<p><strong>#{node.inner_html}</strong></p>").remove
end
css('h2:not([id]) a[id]:not([href])').each do |node|
node.parent['id'] = node['id']
node.before(node.children).remove
end
doc
end
end
end
end

@ -0,0 +1,56 @@
module Docs
class Apache
class EntriesFilter < Docs::EntriesFilter
def get_name
if slug == 'mod/'
'Modules'
elsif slug == 'programs/'
'Programs'
elsif slug == 'mod/core'
'core'
else
name = at_css('h1').content.strip
name.remove! %r{\ Support\z}i
name.remove! %r{in\ Apache\z}
name.remove! %r{\ documentation\z}i
name.remove! %r{\AApache\ (httpd\ )?(Tutorial:\ )?}i
name.remove! 'HTTP Server Tutorial: '
name.sub! 'Module mod_', 'mod_'
name.remove! %r{\ \-.*} if slug.start_with?('programs')
name
end
end
def get_type
if slug.start_with?('howto')
'Tutorials'
elsif slug.start_with?('platform')
'Platform Specific Notes'
elsif slug.start_with?('programs')
'Programs'
elsif slug.start_with?('misc')
'Miscellaneous'
elsif slug.start_with?('mod/')
'Modules'
elsif slug.start_with?('ssl/')
'Guide: SSL/TLS'
elsif slug.start_with?('rewrite/')
'Guide: Rewrite'
elsif slug.start_with?('vhosts/')
'Guide: Virtual Host'
else
'Guide'
end
end
def additional_entries
css('.directive-section > h2').each_with_object [] do |node, entries|
name = node.content.strip
next unless name.sub!(/\ Directive\z/, '')
name.prepend "#{self.name.start_with?('MPM') ? 'MPM' : self.name}: "
entries << [name, node['id'], 'Directives']
end
end
end
end
end

@ -0,0 +1,37 @@
module Docs
class Apache < UrlScraper
self.name = 'Apache HTTP Server'
self.slug = 'apache_http_server'
self.type = 'apache'
self.version = '2.4.12'
self.base_url = 'http://httpd.apache.org/docs/2.4/en/'
self.links = {
home: 'http://httpd.apache.org/'
}
html_filters.push 'apache/clean_html', 'apache/entries'
options[:container] = '#page-content'
options[:skip] = %w(
upgrading.html
license.html
sitemap.html
glossary.html
mod/quickreference.html
mod/directive-dict.html
mod/directives.html
mod/module-dict.html
programs/other.html)
options[:skip_patterns] = [
/\A(da|de|en|es|fr|ja|ko|pt-br|tr|zh-cn)\//,
/\Anew_features/,
/\Adeveloper\// ]
options[:attribution] = <<-HTML
&copy; The Apache Software Foundation<br>
Licensed under the Apache License, Version 2.0.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -0,0 +1 @@
https://github.com/Kapeli/Dash-X-Platform-Resources/blob/master/docset_icons/apache%402x.png
Loading…
Cancel
Save