Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.07 KB

README.md

File metadata and controls

50 lines (36 loc) · 1.07 KB

Factory reporting docx exporter

A browser javascript rewrite of the original python exporter

Development

pnpm install
pnpm dev

Click the download button will generate a docx file with sample data inside main.js

Build

pnpm build

This will generate a dist folder with export-word-docx.js inside. Copy the file to your project and include it with script tag.

Usage

<script src="export-word-docx.js"></script>

And the exportWordDocx function will be available in the global scope.

const exampleData = [
{
  sender: 'XXX',
  serialNumber: '00000000',
  location: '台北市中山區中山北路一段',
  legislator: 'XXX',
  townName: '台北市中山區',
  imageUrls: [
    // 'https://i.imgur.com/taKOy2v.png',
    // 'https://i.imgur.com/LrUki4U.jpg',
  ],
},
];

await window.exportWordDocx(exampleData);

License

MIT