14
14
* limitations under the License.
15
15
*/
16
16
17
- 'use strict'
17
+ 'use strict' ;
18
18
19
19
const Hogan = require ( 'hogan.js' ) ;
20
20
const fs = require ( 'fs' ) ;
@@ -45,7 +45,7 @@ function generateEmbeds(config) {
45
45
glob ( config . src + '/**/*.html' , { } , ( err , files ) => {
46
46
files . forEach ( file => generateEmbed ( config , file ) ) ;
47
47
} ) ;
48
- }
48
+ } ;
49
49
50
50
/**
51
51
* Generates embeds for a given file.
@@ -76,7 +76,7 @@ function generateEmbed(config, file) {
76
76
generateTemplate ( context ) ;
77
77
} ) ;
78
78
} ) ;
79
- }
79
+ } ;
80
80
81
81
/**
82
82
* Syntax highlights a string.
@@ -89,10 +89,10 @@ function highlight(code) {
89
89
reject ( err ) ;
90
90
} else {
91
91
resolve ( result . toString ( ) ) ;
92
- }
92
+ } ;
93
93
} ) ;
94
94
} ) ;
95
- }
95
+ } ;
96
96
97
97
/**
98
98
* Renders the given template into a file.
@@ -112,9 +112,9 @@ function generate(file, template, context, minifyResult) {
112
112
removeComments : true ,
113
113
removeAttributeQuotes : true
114
114
} ) ;
115
- }
115
+ } ;
116
116
writeFile ( path . join ( context . config . destRoot , file ) , string ) ;
117
- }
117
+ } ;
118
118
119
119
/**
120
120
* Appends a list of flags separated by a '.' to a filename.
@@ -123,15 +123,15 @@ function addFlag() {
123
123
const filename = arguments [ 0 ] ;
124
124
const postfix = [ ] . slice . call ( arguments , 1 ) . join ( '.' ) ;
125
125
return filename . replace ( '.html' , '.' + postfix + '.html' ) ;
126
- }
126
+ } ;
127
127
128
128
/**
129
129
* Parses an ABE document from a file.
130
130
*/
131
131
function parseDocument ( file ) {
132
132
const inputString = fs . readFileSync ( file , 'utf-8' ) ;
133
133
return DocumentParser . parse ( inputString ) ;
134
- }
134
+ } ;
135
135
136
136
/**
137
137
* Opens the embed html file in a browser to determine the initial height.
@@ -165,17 +165,17 @@ function generateTemplate(context) {
165
165
} )
166
166
. catch ( err => console . log ( err ) ) ;
167
167
} ) ;
168
- }
168
+ } ;
169
169
170
170
function compileTemplate ( filePath ) {
171
171
let string = fs . readFileSync ( path . join ( templatesDir , filePath ) , 'utf8' ) ;
172
172
return Hogan . compile ( string ) ;
173
- }
173
+ } ;
174
174
175
175
function writeFile ( filePath , content ) {
176
176
mkdirp ( path . dirname ( filePath ) ) ;
177
177
fs . writeFileSync ( filePath , content ) ;
178
- }
178
+ } ;
179
179
180
180
module . exports = { } ;
181
181
module . exports . generatePreview = generateEmbeds ;
0 commit comments