mirror of https://github.com/freeCodeCamp/devdocs
parent
5f6f8a7194
commit
50dfc91721
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 44 KiB After Width: | Height: | Size: 46 KiB |
@ -0,0 +1,4 @@
|
||||
#= require views/pages/base
|
||||
#= require views/pages/underscore
|
||||
|
||||
app.views.GruntPage = app.views.UnderscorePage
|
@ -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
|
||||
© 2014 Grunt Team<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 607 B |
After Width: | Height: | Size: 1.0 KiB |
@ -0,0 +1 @@
|
||||
https://github.com/gruntjs/gruntjs.com/tree/master/src/img
|
Loading…
Reference in new issue