1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-22 08:20:11 +00:00

Merge remote-tracking branch 'refs/remotes/origin/dev'

This commit is contained in:
devlinjd 2015-10-25 08:19:21 -04:00
commit f7c05f49b2
4 changed files with 51 additions and 12 deletions

View File

@ -57,7 +57,7 @@ fluentcmd in1.json in2.json -o out.html -o out.doc -o out.pdf
You should see something to the effect of: You should see something to the effect of:
``` ```
*** FluentCMD v0.3.1 *** *** FluentCMD v0.4.0 ***
Reading JSON resume: foo/resume.json Reading JSON resume: foo/resume.json
Generating HTML resume: out/resume.html Generating HTML resume: out/resume.html
Generating TXT resume: out/resume.txt Generating TXT resume: out/resume.txt
@ -78,7 +78,7 @@ fluentcmd resume.json -t modern
fluentcmd resume.json -t ~/foo/bar/my-custom-theme/ fluentcmd resume.json -t ~/foo/bar/my-custom-theme/
``` ```
As of v0.3.1, available predefined themes are `modern`, `minimist`, `informatic`, and `hello-world`. As of v0.4.0, available predefined themes are `modern`, `minimist`, and `hello-world`.
### Merging resumes ### Merging resumes
@ -129,6 +129,14 @@ fluentcmd me.json -o out/resume.all
..tells FluentCV to read `me.json` and generate `out/resume.md`, `out/resume.doc`, `out/resume.html`, `out/resume.txt`, `out/resume.pdf`, and `out/resume.json`. ..tells FluentCV to read `me.json` and generate `out/resume.md`, `out/resume.doc`, `out/resume.html`, `out/resume.txt`, `out/resume.pdf`, and `out/resume.json`.
### Prettifying
FluentCMD applies [js-beautify][10]-style HTML prettification by default to HTML-formatted resumes. To disable prettification, the `--nopretty` or `-n` flag can be used:
```bash
fluentcmd resume.json out.all --nopretty
```
## License ## License
MIT. Go crazy. See [LICENSE.md][1] for details. MIT. Go crazy. See [LICENSE.md][1] for details.
@ -142,3 +150,4 @@ MIT. Go crazy. See [LICENSE.md][1] for details.
[7]: http://fluentcv.com [7]: http://fluentcv.com
[8]: https://youtu.be/N9wsjroVlu8 [8]: https://youtu.be/N9wsjroVlu8
[9]: https://api.jquery.com/jquery.extend/ [9]: https://api.jquery.com/jquery.extend/
[10]: https://github.com/beautify-web/js-beautify

View File

@ -1,6 +1,6 @@
{ {
"name": "fluentcmd", "name": "fluentcmd",
"version": "0.3.1", "version": "0.4.0",
"description": "Generate beautiful, targeted resumes from your command line or shell.", "description": "Generate beautiful, targeted resumes from your command line or shell.",
"repository": { "repository": {
"type": "git", "type": "git",
@ -24,7 +24,7 @@
}, },
"homepage": "https://github.com/fluentdesk/fluentcmd", "homepage": "https://github.com/fluentdesk/fluentcmd",
"dependencies": { "dependencies": {
"fluentlib": "fluentdesk/fluentlib#v0.2.0", "fluentlib": "fluentdesk/fluentlib#v0.3.0",
"minimist": "^1.2.0", "minimist": "^1.2.0",
"underscore": "^1.8.3" "underscore": "^1.8.3"
} }

View File

@ -22,11 +22,14 @@ module.exports = function () {
@param theme Friendly name of the resume theme. Defaults to "modern". @param theme Friendly name of the resume theme. Defaults to "modern".
@param logger Optional logging override. @param logger Optional logging override.
*/ */
function gen( src, dst, theme, logger, errHandler ) { function gen( src, dst, opts, logger, errHandler ) {
_log = logger || console.log; _log = logger || console.log;
_err = errHandler || error; _err = errHandler || error;
_opts.theme = (theme && theme.toLowerCase().trim()) || 'modern';
//_opts = extend( true, _opts, opts );
_opts.theme = (opts.theme && opts.theme.toLowerCase().trim()) || 'modern';
_opts.prettify = opts.prettify === true ? _opts.prettify : false;
// Load input resumes... // Load input resumes...
if(!src || !src.length) { throw { fluenterror: 3 }; } if(!src || !src.length) { throw { fluenterror: 3 }; }
@ -71,7 +74,7 @@ module.exports = function () {
var fObj = _fmts.filter( function(_f) { return _f.ext === fType; } )[0]; var fObj = _fmts.filter( function(_f) { return _f.ext === fType; } )[0];
var fOut = path.join( f.substring( 0, f.lastIndexOf('.') + 1 ) + fObj.ext ); var fOut = path.join( f.substring( 0, f.lastIndexOf('.') + 1 ) + fObj.ext );
_log( 'Generating ' + fi.fmt.name.toUpperCase() + ' resume: ' + path.relative(process.cwd(), f ) ); _log( 'Generating ' + fi.fmt.name.toUpperCase() + ' resume: ' + path.relative(process.cwd(), f ) );
return fObj.gen.generate( rez, fOut, _opts.theme ); return fObj.gen.generate( rez, fOut, _opts );
} }
catch( ex ) { catch( ex ) {
_err( ex ); _err( ex );
@ -98,11 +101,17 @@ module.exports = function () {
]; ];
/** /**
Default options. Default FluentCMD options.
*/ */
var _opts = { var _opts = {
theme: 'modern', theme: 'modern',
} prettify: { // ← See https://github.com/beautify-web/js-beautify#options
indent_size: 2,
unformatted: ['em','strong'],
max_char: 80, // ← See lib/html.js in above-linked repo
//wrap_line_length: 120, ← Don't use this
}
};
/** /**
Internal module interface. Used by FCV Desktop and HMR. Internal module interface. Used by FCV Desktop and HMR.

View File

@ -10,17 +10,38 @@ var ARGS = require( 'minimist' )
, PKG = require('../package.json'); , PKG = require('../package.json');
try { try {
main();
}
catch( ex ) {
handleError( ex );
}
function main() {
// Setup.
console.log( '*** FluentCMD v' + PKG.version + ' ***' ); console.log( '*** FluentCMD v' + PKG.version + ' ***' );
if( process.argv.length <= 2 ) { throw { fluenterror: 3 }; } if( process.argv.length <= 2 ) { throw { fluenterror: 3 }; }
// Convert arguments to source files, target files, options
var args = ARGS( process.argv.slice(2) ); var args = ARGS( process.argv.slice(2) );
var src = args._ || []; var src = args._ || [];
var dst = (args.o && ((typeof args.o === 'string' && [ args.o ]) || args.o)) || []; var dst = (args.o && ((typeof args.o === 'string' && [ args.o ]) || args.o)) || [];
dst = (dst === true) ? [] : dst; // handle -o with missing output file dst = (dst === true) ? [] : dst; // Handle -o with missing output file
FCMD.generate( src, dst, args.t || 'modern' );
// Generate!
FCMD.generate( src, dst, getOpts( args ) );
process.platform !== 'win32' && console.log('\n'); process.platform !== 'win32' && console.log('\n');
} }
catch( ex ) {
function getOpts( args ) {
var noPretty = args['nopretty'] || args.n;
noPretty = noPretty && (noPretty === true || noPretty === 'true');
return {
theme: args.t || 'modern',
prettify: !noPretty
};
}
function handleError( ex ) {
var msg = ''; var msg = '';
if( ex.fluenterror ){ if( ex.fluenterror ){
switch( ex.fluenterror ) { // TODO: Remove magic numbers switch( ex.fluenterror ) { // TODO: Remove magic numbers