Hi,
I'm currently using the following code to generate HTML content while skipping certain block types:
const htmlContent = page.html({
skipBlockTypes: ['LAYOUT_FOOTER' as ApiBlockType, 'LAYOUT_FIGURE' as ApiBlockType],
});
However, I noticed that signatures are not included in the HTML output. To handle this, I found that I need to manually search for signature blocks using:
const signatureBlocks = page.listSignatures().map(signature => {
return signature.str(); // Placeholder like [SIGNATURE]
});
Alternatively, I was exploring the idea of generating a full page in Markdown for more flexibility. I was also debating on using https://github.com/mixmark-io/turndown to covert html to makrdown.
For instance, using getLinesByLayoutArea to segment the page covert each page into html and into markdown after:
const segmented = page.getLinesByLayoutArea(true); // Sort lines in reading order
console.log("---- HEADER:");
console.log(segmented.header.map((l) => l.text).join("\n"));
console.log("\n---- CONTENT:");
console.log(segmented.content.map((l) => l.text).join("\n"));
console.log("\n---- FOOTER:");
console.log(segmented.footer.map((l) => l.text).join("\n"));
While this works, rendering the signature within the HTML feels a bit cumbersome. Is there a more streamlined way to include signature blocks in the HTML? Additionally, I was wondering if there are any plans to introduce a Markdown rendering option for JavaScript in the near future. It could be helpful for those of us working with simpler, more flexible outputs.
Hi,
I'm currently using the following code to generate HTML content while skipping certain block types:
However, I noticed that signatures are not included in the HTML output. To handle this, I found that I need to manually search for signature blocks using:
Alternatively, I was exploring the idea of generating a full page in Markdown for more flexibility. I was also debating on using https://github.com/mixmark-io/turndown to covert html to makrdown.
For instance, using getLinesByLayoutArea to segment the page covert each page into html and into markdown after:
While this works, rendering the signature within the HTML feels a bit cumbersome. Is there a more streamlined way to include signature blocks in the HTML? Additionally, I was wondering if there are any plans to introduce a Markdown rendering option for JavaScript in the near future. It could be helpful for those of us working with simpler, more flexible outputs.