jsonresume-theme-engineering 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -27,7 +27,6 @@ Or if you're on OSX and got [Homebrew](http://brew.sh/) installed:
27
27
  brew install node
28
28
  ```
29
29
 
30
-
31
30
  ### Install npm packages
32
31
 
33
32
  We need to install the dependencies:
@@ -36,29 +35,28 @@ We need to install the dependencies:
36
35
  npm install
37
36
  ```
38
37
 
39
- ### Serve theme
38
+ ### Render Resume
40
39
 
41
- If you do not provide a `resume.json` at the root directory level, copy the sample resume and run the development server:
40
+ If you do not provide a `resume.json` at the root directory level, use the sample resume and render it as HTML:
42
41
 
43
42
  ```
44
43
  cp sample-resume.json resume.json
45
- npm start
44
+ npm run html
46
45
  ```
47
46
 
48
47
  You should now see this message:
49
48
 
50
49
  ```
51
- Preview: http://localhost:4000
52
- Press ctrl-c to stop
50
+ You can find your rendered resume at resume.html. Nice work! 🚀
53
51
  ```
54
52
 
55
53
  Congratulations, you've made it! You can now start to modify this theme (see Contribute section below).
56
54
 
57
55
  ## PDF Export
58
- To export your resume, you can run the following command below. This will automatically create a `resume.pdf` file within your current directory:
56
+ To export your resume in PDF format, you can run the following command below. This will automatically create a `resume.pdf` file within your current directory:
59
57
 
60
58
  ```
61
- npm run export
59
+ npm run pdf
62
60
  ```
63
61
 
64
62
  Alternatively, you can also do a **print page** on the browser and save it as as PDF (by setting margins to none and removing header/footers.)
package/index.js CHANGED
@@ -1,23 +1,20 @@
1
1
  const
2
2
  fs = require('fs'),
3
- handlebars = require('handlebars'),
4
- handlebarsWax = require('handlebars-wax'),
3
+ path = require('path'),
4
+ Handlebars = require('handlebars'),
5
5
  addressFormat = require('address-format'),
6
- moment = require('moment'),
7
- Swag = require('swag');
6
+ moment = require('moment');
8
7
 
9
- Swag.registerHelpers(handlebars);
10
-
11
- handlebars.registerHelper({
8
+ Handlebars.registerHelper({
12
9
 
13
10
  wrapURL: function (url) {
14
11
  const wrappedUrl = '<a href="' + url + '">' + url.replace(/.*?:\/\//g, '') + "</a>";
15
- return new handlebars.SafeString(wrappedUrl);
12
+ return new Handlebars.SafeString(wrappedUrl);
16
13
  },
17
14
 
18
15
  wrapMail: function (address) {
19
16
  const wrappedAddress = '<a href="mailto:' + address + '">' + address + "</a>";
20
- return new handlebars.SafeString(wrappedAddress);
17
+ return new Handlebars.SafeString(wrappedAddress);
21
18
  },
22
19
 
23
20
  formatAddress: function (address, city, region, postalCode, countryCode) {
@@ -42,14 +39,49 @@ handlebars.registerHelper({
42
39
  });
43
40
 
44
41
  function render(resume) {
42
+ if (!resume || typeof resume !== 'object') {
43
+ throw new Error('Expected input to be a valid resume object');
44
+ }
45
+
45
46
  let dir = __dirname,
46
47
  css = fs.readFileSync(dir + '/style.css', 'utf-8'),
47
- resumeTemplate = fs.readFileSync(dir + '/resume.hbs', 'utf-8');
48
+ resumeTemplate = fs.readFileSync(dir + '/resume.hbs', 'utf-8'),
49
+ partialsDir = path.join(dir, 'partials'),
50
+ viewsDir = path.join(dir, 'views');
51
+
52
+ // Load partials from partialsDir
53
+ let partialFilenames = fs.readdirSync(partialsDir);
54
+ partialFilenames.forEach(function (filename) {
55
+ var matches = /^([^.]+).hbs$/.exec(filename);
56
+ if (!matches) {
57
+ return;
58
+ }
59
+ var name = matches[1];
60
+ var filepath = path.join(partialsDir, filename);
61
+ var template = fs.readFileSync(filepath, 'utf8');
62
+
63
+ Handlebars.registerPartial(name, template);
64
+ });
48
65
 
49
- let Handlebars = handlebarsWax(handlebars);
66
+ // Load partials from viewsDir (if it exists)
67
+ try {
68
+ if (fs.existsSync(viewsDir)) {
69
+ let viewFilenames = fs.readdirSync(viewsDir);
70
+ viewFilenames.forEach(function (filename) {
71
+ var matches = /^([^.]+).hbs$/.exec(filename);
72
+ if (!matches) {
73
+ return;
74
+ }
75
+ var name = matches[1];
76
+ var filepath = path.join(viewsDir, filename);
77
+ var template = fs.readFileSync(filepath, 'utf8');
50
78
 
51
- Handlebars.partials(dir + '/views/**/*.{hbs,js}');
52
- Handlebars.partials(dir + '/partials/**/*.{hbs,js}');
79
+ Handlebars.registerPartial(name, template);
80
+ });
81
+ }
82
+ } catch (err) {
83
+ console.error('Error loading views directory:', err);
84
+ }
53
85
 
54
86
  return Handlebars.compile(resumeTemplate)({
55
87
  css: css,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jsonresume-theme-engineering",
3
- "version": "0.2.1",
3
+ "version": "0.4.0",
4
4
  "description": "JSON Resume theme for engineers",
5
5
  "keywords": [
6
6
  "jsonresume",
@@ -17,17 +17,24 @@
17
17
  },
18
18
  "license": "MIT",
19
19
  "scripts": {
20
- "start": "resume serve --theme .",
21
- "export": "resume export --theme . resume.pdf"
20
+ "html": "resumed render --theme jsonresume-theme-engineering",
21
+ "pdf": "resumed export --theme jsonresume-theme-engineering",
22
+ "test": "mocha test/*.test.js"
22
23
  },
23
24
  "dependencies": {
24
25
  "address-format": "0.0.3",
25
26
  "handlebars": "^4.7.8",
26
- "handlebars-wax": "^6.1.0",
27
- "moment": "^2.30.1",
28
- "swag": "^0.7.0"
27
+ "jsonresume-theme-engineering": "file:./",
28
+ "moment": "^2.30.1"
29
29
  },
30
30
  "devDependencies": {
31
- "resume-cli": "^3.1.2"
31
+ "looks-same": "^9.0.1",
32
+ "mocha": "^11.7.2",
33
+ "pdf-img-convert": "^2.0.0",
34
+ "pdf-parse": "^1.1.1",
35
+ "pngjs": "^7.0.0",
36
+ "puppeteer": "^24.22.3",
37
+ "resumed": "^6.1.0",
38
+ "sinon": "^21.0.0"
32
39
  }
33
40
  }
@@ -1,11 +0,0 @@
1
- # To get started with Dependabot version updates, you'll need to specify which
2
- # package ecosystems to update and where the package manifests are located.
3
- # Please see the documentation for all configuration options:
4
- # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
-
6
- version: 2
7
- updates:
8
- - package-ecosystem: "npm"
9
- directory: "/" # Location of package manifests
10
- schedule:
11
- interval: "weekly"
package/Makefile DELETED
@@ -1,12 +0,0 @@
1
- HBS_TEMPLATES = $(sort $(wildcard partials/** views/** resume.hbs ))
2
-
3
- all: resume.png
4
-
5
- resume.json: sample-resume.json
6
- cp sample-resume.json resume.json
7
-
8
- resume.pdf: resume.json index.js $(HBS_TEMPLATES)
9
- npm run export
10
-
11
- resume.png: resume.pdf
12
- pdftoppm -png resume.pdf > resume.png
package/TODO.md DELETED
@@ -1 +0,0 @@
1
- - switch from resume-cli to https://github.com/rbardini/resumed
Binary file
Binary file
Binary file
Binary file
package/resume.png DELETED
Binary file
@@ -1,156 +0,0 @@
1
- {
2
- "basics": {
3
- "name": "Richard Hendriks",
4
- "label": "Programmer",
5
- "picture": "http://www.piedpiper.com/app/themes/pied-piper/dist/images/richard.png",
6
- "email": "richard.hendriks@piedpiper.com",
7
- "phone": "(912) 555-4321",
8
- "website": "http://piedpiper.com",
9
- "summary": "Richard hails from <strong>Tulsa</strong>. He has earned degrees from the University of Oklahoma and Stanford. (Go Sooners and Cardinals!) Before starting Pied Piper, he worked for <a href='http://www.hooli.xyz/'>Hooli</a> as a part time software developer. While his work focuses on applied information theory, mostly optimizing lossless compression schema of both the length-limited and adaptive variants, his non-work interests range widely, everything from quantum computing to chaos theory. He could tell you about it, but THAT would NOT be a <em>“length-limited”</em> conversation!",
10
- "location": {
11
- "address": "Newell Road",
12
- "postalCode": "94303",
13
- "city": "Palo Alto",
14
- "countryCode": "US",
15
- "region": "CA"
16
- },
17
- "profiles": [
18
- {
19
- "network": "Twitter",
20
- "username": "siliconHBO",
21
- "url": "https://twitter.com/siliconHBO"
22
- },
23
- {
24
- "network": "Facebook",
25
- "username": "SiliconHBO",
26
- "url": "https://www.facebook.com/SiliconHBO"
27
- },
28
- {
29
- "network": "Instagram",
30
- "username": "siliconhbo",
31
- "url": "https://www.instagram.com/siliconhbo/"
32
- }
33
- ]
34
- },
35
- "work": [
36
- {
37
- "company": "Pied Piper",
38
- "position": "CEO/President",
39
- "website": "http://piedpiper.com",
40
- "startDate": "2014-04-13",
41
- "summary": "Pied Piper is a multi-platform technology based on a proprietary universal compression algorithm that has consistently fielded high Weisman Scores™ that are not merely competitive, but approach the theoretical limit of lossless compression.",
42
- "highlights": [
43
- "Build an algorithm for artist to detect if their music was violating copy right infringement laws",
44
- "Successfully won <a href='https://techcrunch.com/event-type/disrupt/'>Techcrunch Disrupt</a>",
45
- "Optimized an algorithm that holds the current world record for Weisman Scores"
46
- ]
47
- },
48
- {
49
- "company": "Hooli",
50
- "position": "Senior Software Engineer",
51
- "website": "http://www.hooli.xyz/",
52
- "startDate": "2014-01-01",
53
- "endDate": "2014-04-06",
54
- "highlights": [
55
- "Worked on optimizing the backend algorithms for <a href='http://www.hooli.xyz/'>Hooli</a>"
56
- ]
57
- },
58
- {
59
- "company": "Hooli",
60
- "position": "Software Engineer",
61
- "website": "http://www.hooli.xyz/",
62
- "startDate": "2013-01-01",
63
- "endDate": "2014-01-01",
64
- "highlights": [
65
- "Contributed bugfixes and smaller features for <a href='http://www.hooli.xyz/'>Hooli</a>"
66
- ]
67
- }
68
- ],
69
- "volunteer": [
70
- {
71
- "organization": "CoderDojo",
72
- "position": "Teacher",
73
- "website": "http://coderdojo.com/",
74
- "startDate": "2012-01-01",
75
- "endDate": "2013-01-01",
76
- "summary": "Global movement of free coding clubs for young people.",
77
- "highlights": [
78
- "Awarded 'Teacher of the Month'"
79
- ]
80
- }
81
- ],
82
- "education": [
83
- {
84
- "institution": "Stanford",
85
- "area": "Computer Science",
86
- "studyType": "B.S",
87
- "location": "Palo Alto, CA",
88
- "specialization": "Machine Learning",
89
- "startDate": "2011-06-01",
90
- "endDate": "2014-01-01",
91
- "gpa": "GPA 4.0",
92
- "courses": [
93
- "<strong>DB1101</strong> - Basic SQL",
94
- "<strong>CS2011</strong> - Java Introduction"
95
- ]
96
- }
97
- ],
98
- "awards": [
99
- {
100
- "title": "Digital Compression Pioneer Award",
101
- "date": "2014-11-01",
102
- "awarder": "Techcrunch",
103
- "summary": "There is no spoon."
104
- }
105
- ],
106
- "publications": [
107
- {
108
- "name": "Video compression for 3d media",
109
- "publisher": "Hooli",
110
- "releaseDate": "2014-10-01",
111
- "website": "http://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)",
112
- "summary": "Innovative middle-out compression algorithm that changes the way we store data."
113
- }
114
- ],
115
- "skills": [
116
- {
117
- "name": "Web Development",
118
- "level": "Master",
119
- "keywords": [
120
- "HTML",
121
- "CSS",
122
- "Javascript"
123
- ]
124
- },
125
- {
126
- "name": "Compression",
127
- "level": "Master",
128
- "keywords": [
129
- "Mpeg",
130
- "MP4",
131
- "GIF"
132
- ]
133
- }
134
- ],
135
- "languages": [
136
- {
137
- "language": "English",
138
- "fluency": "Native speaker"
139
- }
140
- ],
141
- "interests": [
142
- {
143
- "name": "Wildlife",
144
- "keywords": [
145
- "Ferrets",
146
- "Unicorns"
147
- ]
148
- }
149
- ],
150
- "references": [
151
- {
152
- "name": "Erlich Bachman",
153
- "reference": "It is my pleasure to recommend Richard. That is all."
154
- }
155
- ]
156
- }