mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-09-29 05:36:48 +02:00
Add Marionette.js documentation
This commit is contained in:
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 |
|
@ -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',
|
||||
|
|
|
@ -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 """,
|
||||
|
|
4
assets/javascripts/views/pages/marionette.coffee
Normal file
4
assets/javascripts/views/pages/marionette.coffee
Normal file
|
@ -0,0 +1,4 @@
|
|||
#= require views/pages/base
|
||||
#= require views/pages/underscore
|
||||
|
||||
app.views.MarionettePage = app.views.UnderscorePage
|
|
@ -45,6 +45,7 @@
|
|||
'pages/laravel',
|
||||
'pages/less',
|
||||
'pages/lodash',
|
||||
'pages/marionette',
|
||||
'pages/markdown',
|
||||
'pages/maxcdn',
|
||||
'pages/mdn',
|
||||
|
|
|
@ -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; }
|
||||
|
|
7
assets/stylesheets/pages/_marionette.scss
Normal file
7
assets/stylesheets/pages/_marionette.scss
Normal file
|
@ -0,0 +1,7 @@
|
|||
._marionette {
|
||||
padding-left: 1rem;
|
||||
|
||||
> h1, > h2 { margin-left: -1rem; }
|
||||
> h2 { @extend %block-heading; }
|
||||
> h3 { @extend %block-label, %label-blue; }
|
||||
}
|
30
lib/docs/filters/marionette/clean_html.rb
Normal file
30
lib/docs/filters/marionette/clean_html.rb
Normal 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
|
12
lib/docs/filters/marionette/entries.rb
Normal file
12
lib/docs/filters/marionette/entries.rb
Normal 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
|
27
lib/docs/scrapers/marionette.rb
Normal file
27
lib/docs/scrapers/marionette.rb
Normal 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
|
||||
© 2014 Muted Solutions, LLC<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
BIN
public/icons/docs/marionette/16.png
Normal file
BIN
public/icons/docs/marionette/16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 779 B |
BIN
public/icons/docs/marionette/16@2x.png
Normal file
BIN
public/icons/docs/marionette/16@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
1
public/icons/docs/marionette/SOURCE
Normal file
1
public/icons/docs/marionette/SOURCE
Normal file
|
@ -0,0 +1 @@
|
|||
https://github.com/marionettejs/marionettejs.com
|
Loading…
Reference in a new issue