UNPKG

docxtemplater

Version:

docx and pptx generator working with templates and data (like Mustache, for Word and Powerpoint documents)

8 lines (7 loc) 9.96 kB
"use strict"; var expectedPrintedPostParsed = "\n(0)<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><w:document xmlns:wpc=\"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas\" xmlns:cx=\"http://schemas.microsoft.com/office/drawing/2014/chartex\" xmlns:cx1=\"http://schemas.microsoft.com/office/drawing/2015/9/8/chartex\" xmlns:cx2=\"http://schemas.microsoft.com/office/drawing/2015/10/21/chartex\" xmlns:cx3=\"http://schemas.microsoft.com/office/drawing/2016/5/9/chartex\" xmlns:cx4=\"http://schemas.microsoft.com/office/drawing/2016/5/10/chartex\" xmlns:cx5=\"http://schemas.microsoft.com/office/drawing/2016/5/11/chartex\" xmlns:cx6=\"http://schemas.microsoft.com/office/drawing/2016/5/12/chartex\" xmlns:cx7=\"http://schemas.microsoft.com/office/drawing/2016/5/13/chartex\" xmlns:cx8=\"http://schemas.microsoft.com/office/drawing/2016/5/14/chartex\" xmlns:mc=\"http://schemas.openxmlformats.org/markup-compatibility/2006\" xmlns:aink=\"http://schemas.microsoft.com/office/drawing/2016/ink\" xmlns:am3d=\"http://schemas.microsoft.com/office/drawing/2017/model3d\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:m=\"http://schemas.openxmlformats.org/officeDocument/2006/math\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:wp14=\"http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w10=\"urn:schemas-microsoft-com:office:word\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\" xmlns:w15=\"http://schemas.microsoft.com/office/word/2012/wordml\" xmlns:w16cid=\"http://schemas.microsoft.com/office/word/2016/wordml/cid\" xmlns:w16se=\"http://schemas.microsoft.com/office/word/2015/wordml/symex\" xmlns:wpg=\"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup\" xmlns:wpi=\"http://schemas.microsoft.com/office/word/2010/wordprocessingInk\" xmlns:wne=\"http://schemas.microsoft.com/office/word/2006/wordml\" xmlns:wps=\"http://schemas.microsoft.com/office/word/2010/wordprocessingShape\" mc:Ignorable=\"w14 w15 w16se w16cid wp14\"><w:body>\n***START LOOP OF hi\n(1) <w:p>\n(2) <w:r>\n(3) <w:t xml:space=\"preserve\">\n(3) </w:t>\n(2) </w:r>\n(2) <w:p w14:paraId=\"736A2D9F\" w14:textId=\"77777777\" w:rsidR=\"008E1095\" w:rsidRDefault=\"008E1095\"/>\n(2) <w:sdt><w:sdtPr><w:alias w:val=\"SF:Table\"/><w:id w:val=\"2039776175\"/><w:placeholder><w:docPart w:val=\"CFCF8C7E6B33489A9DD50D7417AD410D\"/></w:placeholder><w15:color w:val=\"008000\"/><w15:appearance w15:val=\"hidden\"/></w:sdtPr>\n(2) <w:sdtContent>\n(3) <w:p w14:paraId=\"4800949B\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00D3440B\"/>\n(3) <w:tbl><w:tblPr><w:tblStyle w:val=\"TableGrid\"/><w:tblW w:w=\"0\" w:type=\"auto\"/><w:tblLook w:val=\"0660\" w:firstRow=\"1\" w:lastRow=\"1\" w:firstColumn=\"0\" w:lastColumn=\"0\" w:noHBand=\"1\" w:noVBand=\"1\"/></w:tblPr><w:tblGrid><w:gridCol w:w=\"2909\"/><w:gridCol w:w=\"2928\"/><w:gridCol w:w=\"2793\"/></w:tblGrid>\n(3) <w:tr w:rsidR=\"00D3440B\" w14:paraId=\"5887C255\" w14:textId=\"77777777\" w:rsidTr=\"00F617CB\">\n(4) <w:trPr><w:tblHeader/></w:trPr>\n(4) <w:tc>\n(5) <w:tcPr><w:tcW w:w=\"0\" w:type=\"auto\"/></w:tcPr>\n(5) <w:p w14:paraId=\"5951DD51\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00F617CB\">\n(6) <w:r>\n(7) <w:t xml:space=\"preserve\">\n(8) name\n(7) </w:t>\n(6) </w:r>\n(5) </w:p>\n(4) </w:tc>\n(4) <w:tc>\n(5) <w:tcPr><w:tcW w:w=\"0\" w:type=\"auto\"/></w:tcPr>\n(5) <w:p w14:paraId=\"34A4528E\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00F617CB\">\n(6) <w:r>\n(7) <w:t xml:space=\"preserve\">\n(8) phone\n(7) </w:t>\n(6) </w:r>\n(5) </w:p>\n(4) </w:tc>\n(4) <w:tc>\n(5) <w:tcPr><w:tcW w:w=\"0\" w:type=\"auto\"/></w:tcPr>\n(5) <w:p w14:paraId=\"1EFFDB2B\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00F617CB\">\n(6) <w:r>\n(7) <w:t xml:space=\"preserve\">\n(8) website\n(7) </w:t>\n(6) </w:r>\n(5) </w:p>\n(4) </w:tc>\n(3) </w:tr>\n(3) <w:tr w:rsidR=\"00D3440B\" w14:paraId=\"53971E16\" w14:textId=\"77777777\" w:rsidTr=\"00F617CB\">\n(4) <w:sdt><w:sdtPr><w:alias w:val=\"SF:R\"/><w:id w:val=\"1927457022\"/><w15:color w:val=\"008000\"/><w15:appearance w15:val=\"hidden\"/></w:sdtPr>\n(4) <w:sdtContent>\n(5) <w:tc>\n(6) <w:tcPr><w:tcW w:w=\"0\" w:type=\"auto\"/></w:tcPr>\n(6) <w:p w14:paraId=\"6B371C2E\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00F617CB\">\n(7) <w:pPr>\n(8) <w:spacing w:line=\"360\" w:lineRule=\"auto\"/>\n(8) <w:jc w:val=\"both\"/>\n(7) </w:pPr>\n(7) <w:r>\n(8) <w:t xml:space=\"preserve\">\n=============================={foo}\n(8) </w:t>\n(7) </w:r>\n(6) </w:p>\n(5) </w:tc>\n(4) </w:sdtContent>\n(4) </w:sdt><w:sdt><w:sdtPr><w:alias w:val=\"SF:R\"/><w:id w:val=\"1556285925\"/><w15:color w:val=\"008000\"/><w15:appearance w15:val=\"hidden\"/></w:sdtPr>\n(4) <w:sdtContent>\n(5) <w:tc>\n(6) <w:tcPr><w:tcW w:w=\"0\" w:type=\"auto\"/></w:tcPr>\n(6) <w:p w14:paraId=\"3C4100BB\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00F617CB\">\n(7) <w:pPr>\n(8) <w:spacing w:line=\"360\" w:lineRule=\"auto\"/>\n(8) <w:jc w:val=\"both\"/>\n(7) </w:pPr>\n(7) <w:r>\n(8) <w:t xml:space=\"preserve\">\n=============================={bar}\n(8) </w:t>\n(7) </w:r>\n(6) </w:p>\n(5) </w:tc>\n(4) </w:sdtContent>\n(4) </w:sdt><w:sdt><w:sdtPr><w:alias w:val=\"SF:R\"/><w:id w:val=\"-788971804\"/><w15:color w:val=\"008000\"/><w15:appearance w15:val=\"hidden\"/></w:sdtPr>\n(4) <w:sdtContent>\n(5) <w:tc>\n(6) <w:tcPr><w:tcW w:w=\"0\" w:type=\"auto\"/></w:tcPr>\n(6) <w:p w14:paraId=\"24C5CEB1\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00F617CB\">\n(7) <w:pPr>\n(8) <w:spacing w:line=\"360\" w:lineRule=\"auto\"/>\n(8) <w:jc w:val=\"both\"/>\n(7) </w:pPr>\n(7) <w:r>\n(8) <w:t xml:space=\"preserve\">\n=============================={bar}\n(8) </w:t>\n(7) </w:r>\n(6) </w:p>\n(5) </w:tc>\n(4) </w:sdtContent>\n(4) </w:sdt>\n(3) </w:tr>\n(3) </w:tbl>\n(3) <w:p w14:paraId=\"676A1E43\" w14:textId=\"77777777\" w:rsidR=\"00D3440B\" w:rsidRDefault=\"00D3440B\" w:rsidP=\"00D3440B\"/>\n(2) </w:sdtContent>\n(2) </w:sdt>\n(2) <w:p w14:paraId=\"22D858B2\" w14:textId=\"69A6ACE6\" w:rsidR=\"009843AE\" w:rsidRDefault=\"00EB53B3\"/>\n(1) </w:p>\n(1) <w:p>\n(2) <w:r>\n(3) <w:t xml:space=\"preserve\">\n(3) </w:t>\n(2) </w:r>\n(1) </w:p>\n***END LOOP OF hi\n(0)</w:body></w:document>"; var rawXMLValue = "<p:sp>\n <p:nvSpPr>\n <p:cNvPr id=\"37\" name=\"CustomShape 2\"/>\n <p:cNvSpPr/>\n <p:nvPr/>\n </p:nvSpPr>\n <p:spPr>\n <a:xfrm>\n <a:off x=\"504000\" y=\"1769040\"/>\n <a:ext cx=\"9071280\" cy=\"4384080\"/>\n </a:xfrm>\n <a:prstGeom prst=\"rect\">\n <a:avLst/>\n </a:prstGeom>\n <a:noFill/>\n <a:ln>\n <a:noFill/>\n </a:ln>\n </p:spPr>\n <p:style>\n <a:lnRef idx=\"0\"/>\n <a:fillRef idx=\"0\"/>\n <a:effectRef idx=\"0\"/>\n <a:fontRef idx=\"minor\"/>\n </p:style>\n <p:txBody>\n <a:bodyPr lIns=\"0\" rIns=\"0\" tIns=\"0\" bIns=\"0\" anchor=\"ctr\"/>\n <a:p>\n <a:pPr algn=\"ctr\">\n <a:lnSpc>\n <a:spcPct val=\"100000\"/>\n </a:lnSpc>\n </a:pPr>\n <a:r>\n <a:rPr b=\"0\" lang=\"fr-FR\" sz=\"3200\" spc=\"-1\" strike=\"noStrike\">\n <a:solidFill>\n <a:srgbClr val=\"000000\"/>\n </a:solidFill>\n <a:uFill>\n <a:solidFill>\n <a:srgbClr val=\"ffffff\"/>\n </a:solidFill>\n </a:uFill>\n <a:latin typeface=\"Arial\"/>\n </a:rPr>\n <a:t>Hello World</a:t>\n </a:r>\n <a:endParaRPr b=\"0\" lang=\"fr-FR\" sz=\"1800\" spc=\"-1\" strike=\"noStrike\">\n <a:solidFill>\n <a:srgbClr val=\"000000\"/>\n </a:solidFill>\n <a:uFill>\n <a:solidFill>\n <a:srgbClr val=\"ffffff\"/>\n </a:solidFill>\n </a:uFill>\n <a:latin typeface=\"Arial\"/>\n </a:endParaRPr>\n </a:p>\n </p:txBody>\n</p:sp>"; module.exports = { expectedPrintedPostParsed: expectedPrintedPostParsed, rawXMLValue: rawXMLValue };