Merge pull request #5 from Semipublic/devin/1779300013-docx-formatting
feat: apply Noto Serif font and heading styles to DOCX export
This commit is contained in:
@@ -197,6 +197,82 @@ export function markdownToDocx(markdown, title) {
|
|||||||
|
|
||||||
return new Document({
|
return new Document({
|
||||||
title: title || 'PMC Funding Brief',
|
title: title || 'PMC Funding Brief',
|
||||||
|
styles: {
|
||||||
|
default: {
|
||||||
|
document: {
|
||||||
|
run: {
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 22, // 11 pt
|
||||||
|
color: '1f1b16',
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
spacing: { after: 160, line: 276 }, // 1.15× line spacing
|
||||||
|
},
|
||||||
|
},
|
||||||
|
heading1: {
|
||||||
|
run: {
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 40, // 20 pt
|
||||||
|
bold: true,
|
||||||
|
color: '1f1b16',
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
spacing: { before: 360, after: 120 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
heading2: {
|
||||||
|
run: {
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 32, // 16 pt
|
||||||
|
bold: true,
|
||||||
|
color: '1f1b16',
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
spacing: { before: 300, after: 120 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
heading3: {
|
||||||
|
run: {
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 28, // 14 pt
|
||||||
|
bold: true,
|
||||||
|
color: '1f1b16',
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
spacing: { before: 240, after: 80 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
heading4: {
|
||||||
|
run: {
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 24, // 12 pt
|
||||||
|
bold: true,
|
||||||
|
color: '1f1b16',
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
spacing: { before: 200, after: 80 },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
listParagraph: {
|
||||||
|
run: {
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 22,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
paragraphStyles: [
|
||||||
|
{
|
||||||
|
id: 'Hyperlink',
|
||||||
|
name: 'Hyperlink',
|
||||||
|
run: {
|
||||||
|
color: '1d4ed8',
|
||||||
|
underline: { type: 'single' },
|
||||||
|
font: 'Noto Serif',
|
||||||
|
size: 22,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
numbering: {
|
numbering: {
|
||||||
config: [
|
config: [
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user