Skip to content

Disfactory/docx-exporter-js

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published