@@ -49,7 +49,8 @@ module.exports = function () {
4949 ( ( dst && dst . length && dst ) || [ 'resume.all' ] ) . forEach ( function ( t ) {
5050 var to = path . resolve ( t ) , pa = path . parse ( to ) , fmat = pa . ext || '.all' ;
5151 targets . push . apply ( targets , fmat === '.all' ?
52- _fmts . map ( function ( z ) { return to . replace ( / a l l $ / g, z . name ) ; } ) : [ to ] ) ;
52+ _fmts . map ( function ( z ) { return { file : to . replace ( / a l l $ / g, z . ext ) , fmt : z } } )
53+ : [ { file : to , fmt : z } ] ) ;
5354 } ) ;
5455
5556 // Run the transformation!
@@ -64,19 +65,12 @@ module.exports = function () {
6465 @param f Full path to the destination resume to generate, for example,
6566 "/foo/bar/resume.pdf" or "c:\foo\bar\resume.txt".
6667 */
67- function single ( f ) {
68+ function single ( fi ) {
6869 try {
69- // Get the output file type (pdf, html, txt, etc)
70- var fType = path . extname ( f ) . trim ( ) . toLowerCase ( ) . substr ( 1 ) ;
71- var fName = path . basename ( f , '.' + fType ) ;
72-
73- // Get the format object (if any) corresponding to that type, and assemble
74- // the final output file path for the generated resume.
75- var fObj = _fmts . filter ( function ( _f ) { return _f . name === fType ; } ) [ 0 ] ;
70+ var f = fi . file , fType = fi . fmt . ext , fName = path . basename ( f , '.' + fType ) ;
71+ var fObj = _fmts . filter ( function ( _f ) { return _f . ext === fType ; } ) [ 0 ] ;
7672 var fOut = path . join ( f . substring ( 0 , f . lastIndexOf ( '.' ) + 1 ) + fObj . ext ) ;
77-
78- // Generate!
79- _log ( 'Generating ' + fType . toUpperCase ( ) + ' resume: ' + path . relative ( process . cwd ( ) , f ) ) ;
73+ _log ( 'Generating ' + fi . fmt . name . toUpperCase ( ) + ' resume: ' + path . relative ( process . cwd ( ) , f ) ) ;
8074 return fObj . gen . generate ( rez , fOut , _opts . theme ) ;
8175 }
8276 catch ( ex ) {
@@ -98,7 +92,8 @@ module.exports = function () {
9892 { name : 'html' , ext : 'html' , gen : new FLUENT . HtmlGenerator ( ) } ,
9993 { name : 'txt' , ext : 'txt' , gen : new FLUENT . TextGenerator ( ) } ,
10094 { name : 'doc' , ext : 'doc' , fmt : 'xml' , gen : new FLUENT . WordGenerator ( ) } ,
101- { name : 'pdf' , ext : 'pdf' , fmt : 'html' , is : false , gen : new FLUENT . HtmlPdfGenerator ( ) }
95+ { name : 'pdf' , ext : 'pdf' , fmt : 'html' , is : false , gen : new FLUENT . HtmlPdfGenerator ( ) } ,
96+ { name : 'markdown' , ext : 'md' , fmt : 'txt' , gen : new FLUENT . MarkdownGenerator ( ) }
10297 ] ;
10398
10499 /**
0 commit comments