hacksalot / HackMyResume

Generate polished résumés and CVs in HTML, Markdown, LaTeX, MS Word, PDF, plain text, JSON, XML, YAML, smoke signal, and carrier pigeon.
https://fluentdesk.com/hackmyresume
MIT License
9.28k stars 527 forks source link

Merging resumes fails (Cannot read property 'markdownify' of undefined) #90

Closed RichyHBM closed 8 years ago

RichyHBM commented 8 years ago

When merging 2 cvs, 1 with full content and 1 with partial, HackMyResume fails to build the html and pdf versions.

For example: cv1.json

{
  "name": "Jane Q. Fullstacker",
  "meta": {
    "format": "FRESH@0.1.0",
    "version": "0.1.0"
  },
  "info": {
    "label": "Senior Developer",
    "characterClass": "Programmer",
    "brief": "**Full-stack software developer with 6+ years industry experience** specializing in scalable cloud architectures for this, that, and the other. A native of southern CA, Jane enjoys hiking, mystery novels, and the company of Rufus, her two-year-old beagle.",
    "image": "jane_doe.png",
    "quote": "Be the change you want to see in the world."
  },
  "social": [
    {
      "label": "GitHub",
      "network": "GitHub",
      "user": "janef-was-here",
      "url": "https://github.com/janef-was-here"
    }
  ],
  "employment": {
    "summary": "7+ years industry IT and software development experience.",
    "history": [
      {
        "employer": "One Cool Startup",
        "url": "https://onecool.io/does-not-exist",
        "position": "Head Code Ninja",
        "summary": "Development team manager for [OneCoolApp](https://en.wikipedia.org/wiki/Vaporware) and OneCoolWebsite, a free social network tiddlywink generator and lifestyle portal with over 200,000 users.",
        "start": "2013-09",
        "current": true,
        "keywords": ["Agile","PM","Amazon Web Services","AWS"],
        "highlights": ["Managed a 5-person development team", "Accomplishment 2", "Etc."]
      },
      {
        "employer": "Veridian Dynamics",
        "url": "https://en.wikipedia.org/wiki/Better_Off_Ted#Plot",
        "position": "Principal Developer",
        "summary": "Developer on numerous projects culminating in technical lead role for the [Jabberwocky project](http://betteroffted.wikia.com/wiki/Jabberwocky) and promotion to principal developer.",
        "start": "2011-07",
        "end": "2013-08",
        "keywords": ["C++","C","Linux"],
        "highlights": ["Managed a 5-person development team", "Accomplishment 2", "Etc."]
      },
      {
        "employer": "Stark Industries",
        "position": "IT Administrator",
        "summary": "Junior programmer with heavy code responsibilities. Promoted to intermediate role after 6 months.",
        "start": "2008-10",
        "end": "2011-06",
        "keywords": ["Novell","Active Directory","Linux","Windows"],
        "highlights": ["Promoted to intermediate developer after 6 months", "Accomplishment 2", "Etc."]
      }
    ]
  },
  "samples": [
    {
      "title": "Rememberpedia",
      "summary": "A website to help you remember things.",
      "url": "https://rememberpedia.com",
      "date": "2015-07"
    }
  ]
}

And cv2.json

{
  "name": "Jane Q. Fullstacker",
  "meta": {
    "format": "FRESH@0.1.0",
    "version": "0.1.0"
  },
  "info": {
    "label": "Senior Developer",
    "characterClass": "Programmer",
    "brief": "This is a more specific cv that should override, or add, specific parts",
    "image": "jane_doe.png",
    "quote": "Be the change you want to see in the world."
  },
  "social": [
    {
      "label": "Twitter",
      "network": "Twitter",
      "user": "janef-was-here",
      "url": "https://twitter.com/janef-was-here"
    }
  ],
  "employment": {
    "history": [
      {
        "employer": "Dunder Mifflin",
        "position": "Intern",
        "summary": "Performed IT administration and deployments for Dunder Mifflin.",
        "start": "2008-06",
        "end": "2008-09",
        "keywords": ["Novell","Active Directory","Linux","Windows"],
        "highlights": ["Supervised roll-out of Dunder Mifflin Infinity website.", "Performed mission-critical system backups and ", "Etc."]
      }
    ]
  },
  "samples": [
    {
      "title": "Asteroids",
      "summary": "A browser-based space shooter built on Three.js.",
      "url": "http://janef.me/asteroids",
      "date": "2014-09"
    }
  ]
}

Both of which validate, and can build the final resumes fine:

hackmyresume VALIDATE cv1.json cv2.json

*** HackMyResume v1.3.1 ***
Validating cv1.json against FRESH schema: VALID!
Validating cv2.json against FRESH schema: VALID!

Yet when you merge them together, they error:

hackmyresume BUILD cv1.json cv2.json TO out/resume.all

*** HackMyResume v1.3.1 ***
Applying MODERN theme (5 formats)
Reading resume: cv1.json
Reading resume: cv2.json
Merging undefined onto undefined
Generating DOC resume: out/resume.doc
[TypeError: Cannot read property 'xmlify' of undefined]
Generating HTML resume: out/resume.html
[TypeError: Cannot read property 'markdownify' of undefined]
Generating MD resume: out/resume.md
Generating PDF resume: out/resume.pdf
[TypeError: Cannot read property 'markdownify' of undefined]
Generating TXT resume: out/resume.txt
Generating JSON resume: out/resume.json
Generating YML resume: out/resume.yml
ERROR: Cannot read property 'stringify' of undefined
TypeError: Cannot read property 'stringify' of undefined
    at Class.module.exports.BaseGenerator.extend.generate (/Users/me/.nvm/versions/node/v5.3.0/lib/node_modules/hackmyresume/src/gen/json-yaml-generator.js:30:49)
    at single (/Users/me/.nvm/versions/node/v5.3.0/lib/node_modules/hackmyresume/src/verbs/generate.js:165:32)
    at /Users/me/.nvm/versions/node/v5.3.0/lib/node_modules/hackmyresume/src/verbs/generate.js:78:17
    at Array.forEach (native)
    at build (/Users/me/.nvm/versions/node/v5.3.0/lib/node_modules/hackmyresume/src/verbs/generate.js:77:13)
    at main (/Users/me/.nvm/versions/node/v5.3.0/lib/node_modules/hackmyresume/src/index.js:79:42)
    at Object.<anonymous> (/Users/me/.nvm/versions/node/v5.3.0/lib/node_modules/hackmyresume/src/index.js:27:3)
    at Module._compile (module.js:398:26)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)

Similar issues occur with JsonResume formats

RichyHBM commented 8 years ago

It is also not very clear what the merging action does.

Does merging override everything defined in the generic json (in this case cv1.json) with anything defined in the specific one (in this case cv2.json). For elements that are arrays, does it merge both arrays or does it overide them? In this example, should the Social fields of the final resume have both Github and Twitter (a merge of both arrays of the json files) or just have Twitter (as it is the only one defined in the more specific cv, cv2.json)

It would be very useful to have some basic example json files as part of the project, I see there are a couple in the test folders but these don't merge either

RichyHBM commented 8 years ago

Using the development branch/release seems to fix this, so closing