Closed navarretedaniel closed 4 years ago
You'll need to include the HTML generated by Mammoth within a document that includes a stylesheet with that class defined.
Appreciate the quick response; I just wasn't sure whether this was an option when using the CLI functionality mammoth document.docx output.html --style-map=custom-style-map
as it automatically creates the HTML document with <html>
, <head>
, and <body>
tags.
Easy enough to do outside the CLI.
Thank you for clarifying.
Mammoth doesn't create the <html>
, <head>
and <body>
tags, just the HTML fragment for the document. If you're opening the fragment in a browser, the browser will automatically add in those elements to the DOM, but they shouldn't be in the actual HTML file.
I have many custom Word styles that I would like to map to a custom CSS file.
For example:
p[style-name='INDENT_2_TEXT'] =>p.INDENT_2_TEXT
My
INDENT_2_TEXT
CSS style is as follows:I'm unclear whether this is possible? If it is, how do I link my CSS stylesheet?
Thank you.