mirror of https://github.com/freeCodeCamp/devdocs
parent
d3ecba0628
commit
a812cc8d0a
@ -0,0 +1,14 @@
|
|||||||
|
module Docs
|
||||||
|
class Phalcon
|
||||||
|
class CleanHtmlFilter < Filter
|
||||||
|
def call
|
||||||
|
@doc = at_css('.body')
|
||||||
|
|
||||||
|
# Remove unnecessary things
|
||||||
|
css('.headerlink', '#what-is-phalcon', '#other-formats', '#welcome h1', '#welcome p', '#table-of-contents h2').remove
|
||||||
|
|
||||||
|
doc
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,20 @@
|
|||||||
|
module Docs
|
||||||
|
class Phalcon
|
||||||
|
class EntriesFilter < Docs::EntriesFilter
|
||||||
|
def get_name
|
||||||
|
node = css('h1').first
|
||||||
|
name = node.content.strip
|
||||||
|
node.remove
|
||||||
|
name
|
||||||
|
end
|
||||||
|
|
||||||
|
def get_type
|
||||||
|
if slug.start_with?('reference')
|
||||||
|
'Reference'
|
||||||
|
else
|
||||||
|
'API'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -0,0 +1,23 @@
|
|||||||
|
module Docs
|
||||||
|
class Phalcon < UrlScraper
|
||||||
|
self.name = 'Phalcon'
|
||||||
|
self.slug = 'phalcon'
|
||||||
|
self.type = 'phalcon'
|
||||||
|
self.base_url = 'https://docs.phalconphp.com/en/latest/'
|
||||||
|
self.root_path = 'index.html'
|
||||||
|
self.links = {
|
||||||
|
home: 'https://phalconphp.com/',
|
||||||
|
code: 'https://github.com/phalcon/cphalcon/'
|
||||||
|
}
|
||||||
|
|
||||||
|
html_filters.push 'phalcon/clean_html', 'phalcon/entries', 'title'
|
||||||
|
|
||||||
|
options[:root_title] = 'Phalcon'
|
||||||
|
options[:only_patterns] = [/reference\//, /api\//]
|
||||||
|
|
||||||
|
options[:attribution] = <<-HTML
|
||||||
|
© 2012–2015 the Phalcon Team<br>
|
||||||
|
Licensed under the Creative Commons Attribution License 3.0.
|
||||||
|
HTML
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
@ -0,0 +1 @@
|
|||||||
|
https://github.com/phalcon/website/blob/master/public/img/phalcon-22.png
|
Loading…
Reference in new issue