mirror of https://github.com/freeCodeCamp/devdocs
parent
6f1ff802f9
commit
0a09c8904e
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 76 KiB |
@ -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
|
||||
© The Apache Software Foundation<br>
|
||||
Licensed under the Apache License, Version 2.0.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 632 B |
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…
Reference in new issue