Public
Back
Version 2
6/6/2024
export function renderResume({ resumeDetails, style, customStyleUrl, font, sectionOrder, sections }) {
const allSections = ['header', 'summary', 'education', 'work', 'projects', 'volunteer', 'awards', 'certificates', 'publications', 'skills', 'languages', 'interests', 'references'];
const uniqueSpecifiedOrder = Array.from(new Set(sectionOrder));
const order = uniqueSpecifiedOrder.concat(allSections.filter(section => !uniqueSpecifiedOrder.includes(section)));
const sectionsHtml = order.map(section => sections[section] ? sections[section](resumeDetails) : '').join('');
const fontLink = font !== 'default' ? fontLinks[font] : '';
const customStyle = customStyleUrl ? `<link rel="stylesheet" href="${customStyleUrl}">` : '';
return `
<html>
<head>
<style>
${baseStyles}
</style>
${fontLink}
${customStyle}
</head>
<body class="font-sans">
${sectionsHtml}
</body>
</html>
`;
}
Updated: August 16, 2024