File tree Expand file tree Collapse file tree 8 files changed +93
-0
lines changed
javascripts/templates/pages
public/icons/docs/handlebars Expand file tree Collapse file tree 8 files changed +93
-0
lines changed Original file line number Diff line number Diff line change @@ -310,6 +310,11 @@ credits = [
310
310
' GruntJS Team' ,
311
311
' MIT' ,
312
312
' https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10'
313
+ ], [
314
+ ' Handlebars' ,
315
+ ' 2011-2017 Yehuda Katz' ,
316
+ ' MIT' ,
317
+ ' https://raw.githubusercontent.com/wycats/handlebars.js/master/LICENSE'
313
318
], [
314
319
' Haskell' ,
315
320
' The University of Glasgow' ,
Original file line number Diff line number Diff line change 27
27
._flow ,
28
28
._gnu ,
29
29
._grunt ,
30
+ ._handlebars ,
30
31
._haxe ,
31
32
._immutable ,
32
33
._influxdata ,
Original file line number Diff line number Diff line change
1
+ module Docs
2
+ class Handlebars
3
+ class CleanHtmlFilter < Filter
4
+ def call
5
+ # Remove the t-shirt shop advertisement
6
+ css ( '#callout' ) . remove
7
+
8
+ # The title filter is used to add titles to pages without one, remove original headers
9
+ css ( 'h1' ) . remove
10
+
11
+ # Remove the link to the issue tracker
12
+ css ( '.issue-tracker' ) . remove
13
+
14
+ css ( 'pre' ) . each do |node |
15
+ # Remove nested nodes inside pre tags
16
+ node . content = node . content
17
+
18
+ # Add syntax highlighting
19
+ node [ 'data-language' ] = 'html'
20
+ end
21
+
22
+ # Transform 'Learn More' links to headers in the "Getting Started" part of the homepage
23
+ # If this step is skipped, that section looks cluttered with 4 sub-sections without any dividers
24
+ css ( '#getting-started + .contents a.more-info' ) . each do |node |
25
+ clone = node . clone
26
+
27
+ # Move it to the top of the sub-section
28
+ node . parent . prepend_child ( clone )
29
+
30
+ # Turn it into a header
31
+ clone . name = 'h3'
32
+
33
+ # Remove the "Learn More: " part
34
+ clone . content = clone . content [ 12 ..-1 ]
35
+ end
36
+
37
+ # Remove class attributes from div elements to reduce file size
38
+ css ( 'div' ) . remove_attr ( 'class' )
39
+
40
+ doc
41
+ end
42
+ end
43
+ end
44
+ end
Original file line number Diff line number Diff line change
1
+ module Docs
2
+ class Handlebars
3
+ class EntriesFilter < Docs ::EntriesFilter
4
+ def get_name
5
+ subpath [ 0 ..-6 ] . titleize
6
+ end
7
+
8
+ def get_type
9
+ name
10
+ end
11
+
12
+ def additional_entries
13
+ css ( 'h2, h3' ) . to_a . map do |node |
14
+ [ node . content . strip , node [ 'id' ] , root_page? ? 'Manual' : nil ]
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
Original file line number Diff line number Diff line change
1
+ module Docs
2
+ class Handlebars < UrlScraper
3
+ self . name = 'Handlebars.js'
4
+ self . slug = 'handlebars'
5
+ self . type = 'handlebars'
6
+ self . release = '4.0.11'
7
+ self . base_url = 'https://handlebarsjs.com/'
8
+ self . links = {
9
+ home : 'https://handlebarsjs.com/' ,
10
+ code : 'https://github.com/wycats/handlebars.js/'
11
+ }
12
+
13
+ html_filters . push 'handlebars/entries' , 'handlebars/clean_html' , 'title'
14
+
15
+ options [ :container ] = '#contents'
16
+ options [ :root_title ] = 'Handlebars.js'
17
+
18
+ options [ :attribution ] = <<-HTML
19
+ © 2011-2017 by Yehuda Katz< br >
20
+ Licensed under the MIT License.
21
+ HTML
22
+ end
23
+ end
Original file line number Diff line number Diff line change
1
+ https://github.com/yahoo/formatjs-site/tree/master/public/img
You can’t perform that action at this time.
0 commit comments