A browser javascript rewrite of the original python exporter
pnpm install
pnpm dev
Click the download button will generate a docx file with sample data inside main.js
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.
<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);
MIT