Add Marionette.js documentation

This commit is contained in:
Thibaut 2014-10-19 11:19:20 -04:00
parent 5335c81535
commit cc509c17f2
14 changed files with 89 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View file

@ -192,6 +192,11 @@ credits = [
'2009-2014 The Dojo Foundation',
'MIT',
'https://raw.github.com/lodash/lodash/master/LICENSE.txt'
], [
'Marionette.js',
'2014 Muted Solutions, LLC',
'MIT',
'http://mutedsolutions.mit-license.org/'
], [
'Markdown',
'2004 John Gruber',

View file

@ -34,7 +34,7 @@ newsItem = (date, news) ->
app.news = [
[ 1413676800000, # October 19, 2014
""" New <a href="/svg/">SVG</a> documentation """,
""" New <a href="/svg/">SVG</a> and <a href="/marionette">Marionette.js</a> documentations """,
], [
1413590400000, # October 18, 2014
""" New <a href="/nginx/">nginx</a> documentation """,

View file

@ -0,0 +1,4 @@
#= require views/pages/base
#= require views/pages/underscore
app.views.MarionettePage = app.views.UnderscorePage

View file

@ -45,6 +45,7 @@
'pages/laravel',
'pages/less',
'pages/lodash',
'pages/marionette',
'pages/markdown',
'pages/maxcdn',
'pages/mdn',

View file

@ -67,3 +67,4 @@
._icon-xpath:before { background-position: -3rem -10rem; }
._icon-nginx:before { background-position: -4rem -10rem; }
._icon-svg:before { background-position: 0 -11rem; }
._icon-marionette:before { background-position: -1rem -11rem; }

View file

@ -0,0 +1,7 @@
._marionette {
padding-left: 1rem;
> h1, > h2 { margin-left: -1rem; }
> h2 { @extend %block-heading; }
> h3 { @extend %block-label, %label-blue; }
}

View file

@ -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

View file

@ -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

View file

@ -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
&copy; 2014 Muted Solutions, LLC<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 779 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1 @@
https://github.com/marionettejs/marionettejs.com