mirror of https://github.com/freeCodeCamp/devdocs
parent
5335c81535
commit
cc509c17f2
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 60 KiB |
@ -0,0 +1,4 @@
|
||||
#= require views/pages/base
|
||||
#= require views/pages/underscore
|
||||
|
||||
app.views.MarionettePage = app.views.UnderscorePage
|
@ -0,0 +1,7 @@
|
||||
._marionette {
|
||||
padding-left: 1rem;
|
||||
|
||||
> h1, > h2 { margin-left: -1rem; }
|
||||
> h2 { @extend %block-heading; }
|
||||
> h3 { @extend %block-label, %label-blue; }
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
module Docs
|
||||
class Marionette
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
root_page? ? root : other
|
||||
doc
|
||||
end
|
||||
|
||||
def root
|
||||
at_css('p').remove
|
||||
end
|
||||
|
||||
def other
|
||||
css('#source + h2', '#improve', '#source', '.glyphicon').remove
|
||||
|
||||
css('pre > code').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('h2', 'h3').each do |node|
|
||||
id = node.content.strip
|
||||
id.downcase!
|
||||
id.remove! %r{['"\/\.:]}
|
||||
id.gsub! %r{[\ _]}, '-'
|
||||
node['id'] = id
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,12 @@
|
||||
module Docs
|
||||
class Marionette
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def get_name
|
||||
name = at_css('h1').content.strip
|
||||
name.remove!(/Marionette./)
|
||||
name = name[0].upcase + name.from(1)
|
||||
name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,27 @@
|
||||
module Docs
|
||||
class Marionette < UrlScraper
|
||||
self.name = 'Marionette.js'
|
||||
self.slug = 'marionette'
|
||||
self.type = 'marionette'
|
||||
self.version = '2.2.1'
|
||||
self.base_url = 'http://marionettejs.com/docs/'
|
||||
self.root_path = 'current'
|
||||
|
||||
html_filters.push 'marionette/clean_html', 'marionette/entries'
|
||||
|
||||
options[:container] = '#content'
|
||||
|
||||
options[:skip] = %w(/readme.html)
|
||||
options[:skip_patterns] = [/\A\/v\d/]
|
||||
|
||||
options[:fix_urls] = ->(url) do
|
||||
url.sub! %r{marionette([^\/#\?]*)\.md}, 'marionette\1'
|
||||
url
|
||||
end
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2014 Muted Solutions, LLC<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 779 B |
After Width: | Height: | Size: 2.0 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/marionettejs/marionettejs.com
|
Loading…
Reference in new issue