Add Grunt documentation

pull/90/head
Thibaut 11 years ago
parent 5f6f8a7194
commit 50dfc91721

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 46 KiB

@ -125,6 +125,11 @@ credits = [
'Google, Inc.',
'CC BY',
'http://creativecommons.org/licenses/by/3.0/'
], [
'Grunt',
'2014 Grunt Team',
'MIT',
'https://raw.githubusercontent.com/gruntjs/gruntjs.com/master/LICENSE'
], [
'HTTP',
'1999 The Internet Society',

@ -25,7 +25,7 @@ newsItem = (date, news) ->
app.news = [
[ 1399075200000, # May 3, 2014
""" New <a href="/express/">Express</a> documentation """,
""" New <a href="/express/">Express</a> and <a href="/grunt/">Grunt</a> documentations """,
], [
1396742400000, # April 6, 2014
""" New <a href="/go/">Go</a> documentation """,

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

@ -38,6 +38,7 @@
'pages/jquery',
'pages/knockout',
'pages/git',
'pages/grunt',
'pages/less',
'pages/lodash',
'pages/mdn',

@ -54,3 +54,4 @@
._icon-cpp:before { background-position: 0 -8rem; }
._icon-go:before { background-position: -1rem -8rem; }
._icon-express:before { background-position: -2rem -8rem; }
._icon-grunt:before { background-position: -3rem -8rem; }

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

@ -0,0 +1,28 @@
module Docs
class Grunt
class CleanHtmlFilter < Filter
def call
@doc = at_css('.hero-unit')
if root_page?
at_css('h1').content = 'Grunt'
end
css('.end-link').remove
# Put id attributes on headings
css('a.anchor').each do |node|
node.parent['id'] = node['name']
node.before(node.children).remove
end
# Remove code highlighting
css('pre').each do |node|
node.content = node.content
end
doc
end
end
end
end

@ -0,0 +1,34 @@
module Docs
class Grunt
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content
end
def get_type
if name.starts_with?('grunt') || name == 'Inside Tasks'
name
else
'Miscellaneous'
end
end
def additional_entries
return [] unless subpath.starts_with?('api')
css('h3').each_with_object [] do |node, entries|
name = node.content
name.remove! %r{\s.+\z}
next if name == self.name
entries << [name, node['id']]
end
end
def include_default_entry?
name != 'Inside Tasks'
end
end
end
end

@ -0,0 +1,27 @@
module Docs
class Grunt < UrlScraper
self.name = 'Grunt'
self.type = 'grunt'
self.version = '0.4.4'
self.base_url = 'http://gruntjs.com/'
self.root_path = 'getting-started'
self.initial_paths = %w(api/grunt)
html_filters.push 'grunt/clean_html', 'grunt/entries'
options[:only] = %w(
configuring-tasks
sample-gruntfile
creating-tasks
using-the-cli
)
options[:only_patterns] = [/\Aapi\//]
options[:container] = '.container > .row-fluid'
options[:attribution] = <<-HTML
&copy; 2014 Grunt Team<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 607 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

@ -0,0 +1 @@
https://github.com/gruntjs/gruntjs.com/tree/master/src/img
Loading…
Cancel
Save