yaml-cv 0.1.8 → 0.1.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a85bcc96ea67d1ff8541cfddfcec80270740f1c3479c89f4920dc9ff2b1f18a2
4
- data.tar.gz: b5ff82d0fb6abb8491ee7a0781452c42808437091a9a4272e2230fa47cbafc3e
3
+ metadata.gz: e24e5233ed27343de0b480b7c5883e741dcd98f391edd12bcd3a15b27c9e41ad
4
+ data.tar.gz: cb27b2b0b9322dda9521b2a6865d1c4c4f995fb01c073325ebe59e208a79dc21
5
5
  SHA512:
6
- metadata.gz: 383ab7062038b3e9143877ec58753fa984da4d9bf8a551eed9db356a68e0998e8e4e2eb5c7e11cb7a3522b5f35c59adeb26fd82f2d0c8a052bcdf5c867352dd3
7
- data.tar.gz: 41793cfb5b978842c6d625b0e746f350fb52b23123cdd7e100c7d2dc336fc22d52a618aaac53e65c59899ba9e21590e1c3e7cffe1c5c116ee40c79317d7937fc
6
+ metadata.gz: 6b7b09c80a7394828c123eb01100b1f9bb978add7ae442fb4518dd2d7483dae0c1e020942cb53d98fd25cb3e8cb466654373b7d8c28bd0ccaea9016cbe9cb238
7
+ data.tar.gz: fb6dfc2d4c85fd7432540d9ac804f9016a6634d31acc833ee38d10cfd7353539ceb6a33edbbed391d30d63549363a28e2513064ab25479ad638007b84807ef3d
@@ -26,16 +26,17 @@
26
26
  </p>
27
27
  </td>
28
28
  <td class="content-wrapper">
29
- <ul class="contact-list">
30
- {{# contact_padding}}
31
- <li class="contact-wrapper">&nbsp;</li>
32
- {{/ contact_padding}}
29
+ <table class="contact-list" cellpadding="2">
33
30
  {{# contact}}
34
- <li class="contact-wrapper">
35
- <a {{# url}}href="{{ url }}"{{/ url}} target="_blank">{{{icon}}}{{ text }}</a>
36
- </li>
31
+ <tr>
32
+ {{# .}}
33
+ <td class="contact-wrapper">
34
+ <a {{# url}}href="{{ url }}"{{/ url}} target="_blank">{{{ icon_svg }}}{{ text }}</a>
35
+ </td>
36
+ {{/ .}}
37
+ </tr>
37
38
  {{/ contact}}
38
- </ul>
39
+ </table>
39
40
  </td>
40
41
  </tr>
41
42
  </table>
@@ -46,11 +47,11 @@
46
47
  <table>
47
48
 
48
49
  <!--
49
- ____________ ___________ _____ _ _____
50
+ ____________ ___________ _____ _ _____
50
51
  | ___ \ ___ \ _ | ___|_ _| | | ___|
51
- | |_/ / |_/ / | | | |_ | | | | | |__
52
- | __/| /| | | | _| | | | | | __|
53
- | | | |\ \\ \_/ / | _| |_| |____| |___
52
+ | |_/ / |_/ / | | | |_ | | | | | |__
53
+ | __/| /| | | | _| | | | | | __|
54
+ | | | |\ \\ \_/ / | _| |_| |____| |___
54
55
  \_| \_| \_|\___/\_| \___/\_____/\____/
55
56
  -->
56
57
  {{# has_profile}}
@@ -65,9 +66,9 @@ ____________ ___________ _____ _ _____
65
66
  {{/ has_profile}}
66
67
 
67
68
  <!--
68
- _____ _ _______ _ _ _____
69
+ _____ _ _______ _ _ _____
69
70
  / ___| | / /_ _| | | | / ___|
70
- \ `--.| |/ / | | | | | | \ `--.
71
+ \ `--.| |/ / | | | | | | \ `--.
71
72
  `--. \ \ | | | | | | `--. \
72
73
  /\__/ / |\ \_| |_| |____| |____/\__/ /
73
74
  \____/\_| \_/\___/\_____/\_____/\____/
@@ -78,26 +79,28 @@ ____________ ___________ _____ _ _____
78
79
  <p class="title cyan">Skills</p>
79
80
  </td>
80
81
  <td class="content-wrapper skills-section">
81
- <div class="fields-wrapper">
82
- <ul class="fields-list skill-list no-list" style="columns: {{ skills.columns }};">
83
- {{# skills.fields}}
84
- <li>
85
- <span class="skill-title">{{ name }}</span>
86
- <br>
87
- <span class="content">{{{ description }}}</span>
88
- </li>
89
- {{/ skills.fields}}
90
- </ul>
91
- </div>
82
+ <table class="skill-list">
83
+ {{# skills}}
84
+ <tr>
85
+ {{# .}}
86
+ <td class="skill-wrapper">
87
+ <span class="skill-title">{{{ name }}}</span>
88
+ <br>
89
+ <span class="content">{{{ description }}}</span>
90
+ </td>
91
+ {{/ .}}
92
+ </tr>
93
+ {{/ skills}}
94
+ </table>
92
95
  </td>
93
96
  </tr>
94
97
  {{/ has_skills}}
95
98
 
96
99
  <!--
97
- _____ _____ _____ _ _ _ _ _____ _____ ___ _
98
- |_ _| ___/ __ \| | | || \ | |_ _/ __ \ / _ \ | |
99
- | | | |__ | / \/| |_| || \| | | | | / \// /_\ \| |
100
- | | | __|| | | _ || . ` | | | | | | _ || |
100
+ _____ _____ _____ _ _ _ _ _____ _____ ___ _
101
+ |_ _| ___/ __ \| | | || \ | |_ _/ __ \ / _ \ | |
102
+ | | | |__ | / \/| |_| || \| | | | | / \// /_\ \| |
103
+ | | | __|| | | _ || . ` | | | | | | _ || |
101
104
  | | | |___| \__/\| | | || |\ |_| |_| \__/\| | | || |____
102
105
  \_/ \____/ \____/\_| |_/\_| \_/\___/ \____/\_| |_/\_____/
103
106
  -->
@@ -110,8 +113,8 @@ ____________ ___________ _____ _ _____
110
113
  <table class="technical-list">
111
114
  {{# technical}}
112
115
  <tr>
113
- <td class="skill-title">{{ category }}</td>
114
- <td width="100%" class="content"><p>{{{ items }}}</p></td>
116
+ <td class="skill-title technical-title">{{ category }}</td>
117
+ <td class="content"><p>{{{ items }}}</p></td>
115
118
  </tr>
116
119
  {{/ technical}}
117
120
  </table>
@@ -120,12 +123,12 @@ ____________ ___________ _____ _ _____
120
123
  {{/ has_technical}}
121
124
 
122
125
  <!--
123
- _____ _____ _____ _____ _____ _____ _ _ _____
126
+ _____ _____ _____ _____ _____ _____ _ _ _____
124
127
  / ___| ___/ __ \_ _|_ _| _ | \ | |/ ___|
125
- \ `--.| |__ | / \/ | | | | | | | | \| |\ `--.
128
+ \ `--.| |__ | / \/ | | | | | | | | \| |\ `--.
126
129
  `--. \ __|| | | | | | | | | | . ` | `--. \
127
130
  /\__/ / |___| \__/\ | | _| |_\ \_/ / |\ |/\__/ /
128
- \____/\____/ \____/ \_/ \___/ \___/\_| \_/\____/
131
+ \____/\____/ \____/ \_/ \___/ \___/\_| \_/\____/
129
132
  -->
130
133
  {{# sections}}
131
134
  <tr class="section">
data/lib/assets/pdf.css CHANGED
@@ -17,3 +17,7 @@ p, li, td {
17
17
  {
18
18
  height: 1em !important;
19
19
  }
20
+
21
+ .section .title-wrapper {
22
+ width: 18%;
23
+ }
data/lib/assets/style.css CHANGED
@@ -16,6 +16,7 @@ tbody {
16
16
 
17
17
  table {
18
18
  padding: 0;
19
+ border-collapse: collapse;
19
20
  }
20
21
 
21
22
  .cyan {
@@ -141,47 +142,59 @@ p {
141
142
  font-weight: 600;
142
143
  }
143
144
 
144
- .fields-list {
145
- column-fill: balance;
146
- }
147
- .fields-list li {
148
- break-inside: avoid-column;
149
- display: inline-block;
150
- page-break-inside: avoid;
145
+ .skill-wrapper {
146
+ vertical-align: top;
147
+ padding-top: 0;
148
+ padding-right: 1em;
149
+ padding-bottom: 0.5em;
150
+ padding-left: 0;
151
151
  }
152
-
153
152
  .skill-title {
154
153
  color: #696969;
155
- font-size: .86em;
154
+ font-size: 1em;
156
155
  font-weight: 600;
157
156
  vertical-align: top;
158
157
  text-align: left;
159
158
  }
160
- .skills-section {
161
- padding-bottom: .25em !important;
162
- }
163
-
164
- .fields-list li {
165
- margin-bottom: .5em;
166
- }
167
159
 
168
160
  .title .logo {
169
161
  vertical-align: middle;
170
- height: 1.4em;
162
+ height: 1.15em;
171
163
  top: -.2em;
172
164
  position: relative;
173
165
  }
174
166
 
167
+ .technical-list {
168
+ vertical-align: bottom;
169
+ }
170
+ .technical-list td {
171
+ padding: 0;
172
+ }
175
173
  .technical-list .content {
176
174
  width: 100%;
175
+ height: 100%;
177
176
  display: block;
177
+ padding-top: .2em;
178
178
  }
179
-
180
179
  .technical-list .content p {
181
180
  width: 100%;
181
+ height: 100%;
182
182
  display: inline-block;
183
183
  }
184
+ .technical-list .technical-title {
185
+ padding-right: 0.5em;
186
+ }
184
187
 
185
188
  .section td.title-wrapper {
186
189
  padding-bottom: .6em;
187
190
  }
191
+
192
+ .section > td {
193
+ padding: 0;
194
+ }
195
+ .content-wrapper {
196
+ padding: 0 0 1em 0;
197
+ }
198
+ .content-wrapper table {
199
+ margin: 0;
200
+ }
data/lib/yaml-cv.rb CHANGED
@@ -37,7 +37,7 @@ end
37
37
  class CV < Mustache
38
38
 
39
39
  self.template_file = File.join(File.dirname(__FILE__), "assets/cv.mustache")
40
-
40
+
41
41
  attr_accessor :is_pdf
42
42
 
43
43
  def initialize(file_path)
@@ -46,12 +46,12 @@ class CV < Mustache
46
46
 
47
47
  if @cv["contact"]
48
48
  @cv["contact"] = @cv["contact"].map { |c|
49
- c["icon"] = icon(c["icon"])
49
+ c["icon_svg"] = icon(c["icon"])
50
50
  c
51
51
  }
52
52
  end
53
53
  end
54
-
54
+
55
55
  def details
56
56
  @cv["details"]
57
57
  end
@@ -65,7 +65,23 @@ class CV < Mustache
65
65
  end
66
66
 
67
67
  def skills
68
- @cv["skills"]
68
+ # split into an n-column table
69
+ nskills = @cv["skills"]["fields"].length()
70
+ ncols = @cv["skills"]["columns"]
71
+ nrows = (nskills / ncols).ceil
72
+
73
+ skills_table = Array.new(nrows){Array.new(ncols)}
74
+
75
+ i = 0
76
+ while i < nskills
77
+
78
+ col = i % ncols
79
+ row = i / nrows
80
+ skills_table[row][col] = @cv["skills"]["fields"][i]
81
+
82
+ i = i + 1
83
+ end
84
+ skills_table
69
85
  end
70
86
 
71
87
  def has_skills
@@ -90,15 +106,15 @@ class CV < Mustache
90
106
  s
91
107
  }
92
108
  end
93
-
109
+
94
110
  def full_name
95
111
  details["last_name"] + " " + details["first_name"]
96
112
  end
97
-
113
+
98
114
  def css
99
115
  load_asset("style.css")
100
116
  end
101
-
117
+
102
118
  def pdf_css
103
119
  load_asset("pdf.css")
104
120
  end
@@ -108,18 +124,19 @@ class CV < Mustache
108
124
  end
109
125
 
110
126
  def contact
111
- @cv["contact"]
112
- end
127
+ # split into a 2-column table
128
+ contact_table = Array.new(3){Array.new(2)}
113
129
 
114
- def contact_padding
115
- if !contact
116
- return 0
117
- end
130
+ i = 0
131
+ while i < @cv["contact"].length()
118
132
 
119
- columns = (contact.length / 3.0).ceil
120
- padding = (1 - columns) * 3
133
+ row = i % 3
134
+ col = 1 - (i / 3)
135
+ contact_table[row][col] = @cv["contact"][i]
121
136
 
122
- Array.new(padding) { |i| 0 }
137
+ i = i + 1
138
+ end
139
+ contact_table
123
140
  end
124
141
 
125
142
  def icon(name)
@@ -130,7 +147,7 @@ class CV < Mustache
130
147
  if !subsections
131
148
  return
132
149
  end
133
-
150
+
134
151
  subsections.map { |e|
135
152
  if e["from"]
136
153
  e["from"] = format_period e["from"]
@@ -138,11 +155,11 @@ class CV < Mustache
138
155
  if e["to"]
139
156
  e["to"] = format_period e["to"]
140
157
  end
141
-
158
+
142
159
  if e["logo"]
143
160
  e["logo_img"] = read_image e["logo"]
144
161
  end
145
-
162
+
146
163
  e
147
164
  }
148
165
  end
@@ -186,7 +203,7 @@ class CV < Mustache
186
203
 
187
204
  temp_file.close
188
205
  end
189
-
206
+
190
207
  end
191
208
 
192
209
  def is_windows
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yaml-cv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Greg Mantaos
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-08 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mustache