mirror of
https://github.com/JuanCanham/HackMyResume.git
synced 2025-05-12 00:27:08 +01:00
Compare commits
12 Commits
Author | SHA1 | Date | |
---|---|---|---|
9dd759ffa2 | |||
befa26cbb2 | |||
31e2e12769 | |||
f728004c4c | |||
61386308a0 | |||
2e5a68d942 | |||
cf15738f58 | |||
d4a3a08aff | |||
b1d987c3b4 | |||
a2b482f60b | |||
189f37b6a1 | |||
6e4263e58c |
55
README.md
55
README.md
@ -26,53 +26,73 @@ FluentCMD requires a recent version of [Node.js][4] and [NPM][5]. Then:
|
||||
|
||||
1. (Optional, for PDF support) Install the latest official [wkhtmltopdf][3] binary for your platform.
|
||||
2. Install **fluentcmd** by running `npm install fluentcmd -g`.
|
||||
3. You're ready to go!
|
||||
3. You're ready to go.
|
||||
|
||||
## Use
|
||||
|
||||
Assuming you've got a JSON-formatted resume handy, generating resumes in different formats and combinations easy. Just run:
|
||||
|
||||
`fluentcmd [inputs] [outputs] [-t theme]`.
|
||||
```bash
|
||||
fluentcmd [inputs] [outputs] [-t theme].
|
||||
```
|
||||
|
||||
Where `[inputs]` is one or more .json resume files, `[outputs]` is one or more destination resumes, and `[theme]` is the desired theme. For example:
|
||||
Where `[inputs]` is one or more .json resume files, separated by spaces; `[outputs]` is one or more destination resumes, each prefaced with the `-o` option; and `[theme]` is the desired theme. For example:
|
||||
|
||||
```bash
|
||||
# Generate all resume formats (HTML, PDF, DOC, TXT)
|
||||
fluentcmd resume.json resume.all -t informatic
|
||||
fluentcmd resume.json -o out/resume.all -t modern
|
||||
|
||||
# Generate a specific resume format
|
||||
fluentcmd resume.json resume.html -t informatic
|
||||
fluentcmd resume.json resume.txt -t informatic
|
||||
fluentcmd resume.json resume.pdf -t informatic
|
||||
fluentcmd resume.json resume.doc -t informatic
|
||||
fluentcmd resume.json -o out/resume.html
|
||||
fluentcmd resume.json -o out/resume.pdf
|
||||
fluentcmd resume.json -o out/resume.md
|
||||
fluentcmd resume.json -o out/resume.doc
|
||||
fluentcmd resume.json -o out/resume.json
|
||||
fluentcmd resume.json -o out/resume.txt
|
||||
|
||||
# Specify 2 inputs and 3 outputs
|
||||
fluentcmd in1.json in2.json -o out.html -o out.doc -o out.pdf
|
||||
```
|
||||
|
||||
You should see something to the effect of:
|
||||
|
||||
```
|
||||
*** FluentCMD v0.1.0 ***
|
||||
*** FluentCMD v0.3.1 ***
|
||||
Reading JSON resume: foo/resume.json
|
||||
Generating HTML resume: out/resume.html
|
||||
Generating TXT resume: out/resume.txt
|
||||
Generating DOC resume: out/resume.doc
|
||||
Generating PDF resume: out/resume.pdf
|
||||
Generating JSON resume: out/resume.json
|
||||
Generating MARKDOWN resume: out/resume.md
|
||||
```
|
||||
|
||||
## Advanced
|
||||
|
||||
### Applying a theme
|
||||
|
||||
You can specify a predefined or custom theme via the optional `-t` parameter. For a predefined theme, include the theme name. For a custom theme, include the path to the custom theme's folder.
|
||||
|
||||
```bash
|
||||
fluentcmd resume.json -t modern
|
||||
fluentcmd resume.json -t ~/foo/bar/my-custom-theme/
|
||||
```
|
||||
|
||||
As of v0.3.1, available predefined themes are `modern`, `minimist`, `informatic`, and `hello-world`.
|
||||
|
||||
### Merging resumes
|
||||
|
||||
You can **merge multiple resumes together** by specifying them in order from most generic to most specific:
|
||||
|
||||
```bash
|
||||
# Merge specific.json onto base.json and generate all formats
|
||||
fluentcmd base.json specific.json resume.all
|
||||
fluentcmd base.json specific.json -o resume.all
|
||||
```
|
||||
|
||||
This can be useful for overriding a base (generic) resume with information from a specific (targeted) resume. For example, you might override your generic catch-all "software developer" resume with specific details from your targeted "game developer" resume, or combine two partial resumes into a "complete" resume. Merging follows conventional [extend()][9]-style behavior and there's no arbitrary limit to how many resumes you can merge:
|
||||
|
||||
```bash
|
||||
fluentcmd in1.json in2.json in3.json in4.json out.html out.doc
|
||||
fluentcmd in1.json in2.json in3.json in4.json -o out.html -o out.doc
|
||||
Reading JSON resume: in1.json
|
||||
Reading JSON resume: in2.json
|
||||
Reading JSON resume: in3.json
|
||||
@ -88,13 +108,13 @@ You can specify **multiple output targets** and FluentCMD will build them:
|
||||
|
||||
```bash
|
||||
# Generate out1.doc, out1.pdf, and foo.txt from me.json.
|
||||
fluentcmd me.json out1.doc out1.pdf foo.txt
|
||||
fluentcmd me.json -o out1.doc -o out1.pdf -o foo.txt
|
||||
```
|
||||
|
||||
You can also omit the output file(s) and/or theme completely:
|
||||
|
||||
```bash
|
||||
# Equivalent to "fluentcmd resume.json resume.all -t informatic"
|
||||
# Equivalent to "fluentcmd resume.json resume.all -t modern"
|
||||
fluentcmd resume.json
|
||||
```
|
||||
|
||||
@ -104,15 +124,10 @@ The special `.all` extension tells FluentCMD to generate all supported output fo
|
||||
|
||||
```bash
|
||||
# Generate all resume formats (HTML, PDF, DOC, TXT, etc.)
|
||||
fluentcmd input.json output.all
|
||||
fluentcmd me.json -o out/resume.all
|
||||
```
|
||||
|
||||
..tells FluentCV to read `input.json` and generate `output.doc`, `output.html`, `output.txt`, `output.pdf`. That's more or less equivalent to:
|
||||
|
||||
```bash
|
||||
# Generate all resume formats (HTML, PDF, DOC, TXT)
|
||||
fluentcmd input.json output.doc output.html output.txt output.pdf
|
||||
```
|
||||
..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`.
|
||||
|
||||
## License
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "fluentcmd",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.1",
|
||||
"description": "Generate beautiful, targeted resumes from your command line or shell.",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -24,7 +24,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/fluentdesk/fluentcmd",
|
||||
"dependencies": {
|
||||
"fluentlib": "fluentdesk/fluentlib#v0.1.1",
|
||||
"fluentlib": "fluentdesk/fluentlib#v0.2.0",
|
||||
"minimist": "^1.2.0",
|
||||
"underscore": "^1.8.3"
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ module.exports = function () {
|
||||
generate 0..N resumes in the desired formats.
|
||||
@param src Path to the source JSON resume file: "rez/resume.json".
|
||||
@param dst An array of paths to the target resume file(s).
|
||||
@param theme Friendly name of the resume theme. Defaults to "informatic".
|
||||
@param theme Friendly name of the resume theme. Defaults to "modern".
|
||||
@param logger Optional logging override.
|
||||
*/
|
||||
function gen( src, dst, theme, logger, errHandler ) {
|
||||
|
||||
_log = logger || console.log;
|
||||
_err = errHandler || error;
|
||||
_opts.theme = (theme && theme.toLowerCase().trim()) || 'informatic';
|
||||
_opts.theme = (theme && theme.toLowerCase().trim()) || 'modern';
|
||||
|
||||
// Load input resumes...
|
||||
if(!src || !src.length) { throw { fluenterror: 3 }; }
|
||||
@ -49,7 +49,8 @@ module.exports = function () {
|
||||
( (dst && dst.length && dst) || ['resume.all'] ).forEach( function(t) {
|
||||
var to = path.resolve(t), pa = path.parse(to), fmat = pa.ext || '.all';
|
||||
targets.push.apply(targets, fmat === '.all' ?
|
||||
_fmts.map(function(z){ return to.replace(/all$/g,z.name); }) : [to]);
|
||||
_fmts.map(function(z){ return { file: to.replace(/all$/g,z.ext), fmt: z } })
|
||||
: [{ file: to, fmt: _.findWhere( _fmts, { ext: fmat.substring(1) }) }]);
|
||||
});
|
||||
|
||||
// Run the transformation!
|
||||
@ -64,19 +65,12 @@ module.exports = function () {
|
||||
@param f Full path to the destination resume to generate, for example,
|
||||
"/foo/bar/resume.pdf" or "c:\foo\bar\resume.txt".
|
||||
*/
|
||||
function single( f ) {
|
||||
function single( fi ) {
|
||||
try {
|
||||
// Get the output file type (pdf, html, txt, etc)
|
||||
var fType = path.extname( f ).trim().toLowerCase().substr(1);
|
||||
var fName = path.basename( f, '.' + fType );
|
||||
|
||||
// Get the format object (if any) corresponding to that type, and assemble
|
||||
// the final output file path for the generated resume.
|
||||
var fObj = _fmts.filter( function(_f) { return _f.name === fType; } )[0];
|
||||
var f = fi.file, fType = fi.fmt.ext, fName = path.basename( f, '.' + fType );
|
||||
var fObj = _fmts.filter( function(_f) { return _f.ext === fType; } )[0];
|
||||
var fOut = path.join( f.substring( 0, f.lastIndexOf('.') + 1 ) + fObj.ext );
|
||||
|
||||
// Generate!
|
||||
_log( 'Generating ' + fType.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 );
|
||||
}
|
||||
catch( ex ) {
|
||||
@ -98,14 +92,16 @@ module.exports = function () {
|
||||
{ name: 'html', ext: 'html', gen: new FLUENT.HtmlGenerator() },
|
||||
{ name: 'txt', ext: 'txt', gen: new FLUENT.TextGenerator() },
|
||||
{ name: 'doc', ext: 'doc', fmt: 'xml', gen: new FLUENT.WordGenerator() },
|
||||
{ name: 'pdf', ext: 'pdf', fmt: 'html', is: false, gen: new FLUENT.HtmlPdfGenerator() }
|
||||
{ name: 'pdf', ext: 'pdf', fmt: 'html', is: false, gen: new FLUENT.HtmlPdfGenerator() },
|
||||
{ name: 'markdown', ext: 'md', fmt: 'txt', gen: new FLUENT.MarkdownGenerator() },
|
||||
{ name: 'json', ext: 'json', gen: new FLUENT.JsonGenerator() }
|
||||
];
|
||||
|
||||
/**
|
||||
Default options.
|
||||
*/
|
||||
var _opts = {
|
||||
theme: 'informatic',
|
||||
theme: 'modern',
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,16 +13,17 @@ try {
|
||||
console.log( '*** FluentCMD v' + PKG.version + ' ***' );
|
||||
if( process.argv.length <= 2 ) { throw { fluenterror: 3 }; }
|
||||
var args = ARGS( process.argv.slice(2) );
|
||||
var src = args._.filter( function( a ) { return a.match(/\.json$/); });
|
||||
var dst = args._.filter( function( a ) { return !a.match(/\.json$/); });
|
||||
FCMD.generate( src, dst, args.t || 'informatic' );
|
||||
var src = args._ || [];
|
||||
var dst = (args.o && ((typeof args.o === 'string' && [ args.o ]) || args.o)) || [];
|
||||
dst = (dst === true) ? [] : dst; // handle -o with missing output file
|
||||
FCMD.generate( src, dst, args.t || 'modern' );
|
||||
process.platform !== 'win32' && console.log('\n');
|
||||
}
|
||||
catch( ex ) {
|
||||
|
||||
var msg = '';
|
||||
if( ex.fluenterror ){
|
||||
switch( ex.fluenterror ) {
|
||||
switch( ex.fluenterror ) { // TODO: Remove magic numbers
|
||||
case 1: msg = "The specified theme couldn't be found: " + ex.data; break;
|
||||
case 2: msg = "Couldn't copy CSS file to destination folder"; break;
|
||||
case 3: msg = "Please specify a valid JSON resume file."; break;
|
||||
|
Reference in New Issue
Block a user