Render section content as Markdown

Closes #7
This commit is contained in:
Rafael Bardini 2020-11-01 15:03:16 +01:00
parent d8346b424a
commit 0f102e0bc0
12 changed files with 6593 additions and 17 deletions

View File

@ -1,6 +1,7 @@
const fs = require('fs')
const path = require('path')
const Handlebars = require('handlebars')
const micromark = require('micromark')
const extname = '.hbs'
const partialsDir = path.join(__dirname, 'partials')
@ -30,6 +31,8 @@ Handlebars.registerHelper('join', (arr, separator) =>
arr.join(typeof separator === 'string' ? separator : ', '),
)
Handlebars.registerHelper('markdown', doc => micromark(doc))
exports.render = resume => {
const template = fs.readFileSync(path.join(__dirname, 'resume.hbs'), 'utf-8')
const css = fs.readFileSync(path.join(__dirname, 'style.css'), 'utf-8')

6580
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,8 @@
"test": "tap"
},
"dependencies": {
"handlebars": "^4.7.6"
"handlebars": "^4.7.6",
"micromark": "^2.10.1"
},
"devDependencies": {
"eslint": "7.12.0",

View File

@ -1,8 +1,8 @@
{{#summary}}
<section id="about">
<h3>About</h3>
<div>
<p>{{.}}</p>
</div>
<article>
{{{markdown .}}}
</article>
</section>
{{/summary}}

View File

@ -20,7 +20,7 @@
</div>
</header>
{{#summary}}
<p>{{.}}</p>
{{{markdown .}}}
{{/summary}}
</article>
{{/each}}

View File

@ -22,7 +22,7 @@
</div>
</header>
{{#studyType}}
<p>{{.}}</p>
{{{markdown .}}}
{{/studyType}}
{{#if courses.length}}
<h5>Courses</h5>

View File

@ -27,7 +27,7 @@
</div>
</header>
{{#description}}
<p>{{.}}</p>
{{{markdown .}}}
{{/description}}
{{#if highlights.length}}
<h5>Highlights</h5>

View File

@ -23,7 +23,7 @@
</div>
</header>
{{#summary}}
<p>{{.}}</p>
{{{markdown .}}}
{{/summary}}
</article>
{{/each}}

View File

@ -5,7 +5,7 @@
{{#each resume.references}}
{{#if reference}}
<blockquote>
<p>{{reference}}</p>
{{{markdown reference}}}
{{#name}}
<p>
<cite>{{.}}</cite>

View File

@ -22,7 +22,7 @@
</div>
</header>
{{#summary}}
<p>{{.}}</p>
{{{markdown .}}}
{{/summary}}
{{#if highlights.length}}
<h5>Highlights</h5>

View File

@ -22,7 +22,7 @@
</div>
</header>
{{#summary}}
<p>{{.}}</p>
{{{markdown .}}}
{{/summary}}
{{#if highlights.length}}
<h5>Highlights</h5>

View File

@ -252,9 +252,9 @@ blockquote > * + * {
</section>
<section id="about">
<h3>About</h3>
<div>
<article>
<p>Richard hails from Tulsa. He has earned degrees from the University of Oklahoma and Stanford. (Go Sooners and Cardinal!) Before starting Pied Piper, he worked for Hooli 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 length-limited conversation!</p>
</div>
</article>
</section>
<section id="profiles">
<h3>Profiles</h3>