- Updated `docxtemplater` from 3.66.4 to 3.66.7 - Updated `i18next` from 25.5.3 to 25.6.0 - Updated `@biomejs/biome` from 2.2.4 to 2.2.5 - Updated TypeScript types for `node`, `react`, and `react-dom` - Added AGENTS.md for development guidelines and best practices - Added README.md with installation, usage, and development instructions
3.6 KiB
3.6 KiB
Kintone Word Output Plugin
A Kintone plugin that allows users to format and download data using Word template files (.docx). This plugin integrates with Kintone's record data and uses the docxtemplater library to populate templates with dynamic content.
Features
- Template-Based Output: Use pre-designed Word (.docx) templates to format your Kintone data.
- Data Source Flexibility: Choose data from the current record or from another Kintone app.
- Dynamic Content Population: Leverage angular-expressions for complex data manipulation within templates.
- Multi-Language Support: Includes English and Japanese localization.
- Error Handling: Comprehensive error messages for configuration and runtime issues.
Installation
- Download the plugin package from the releases page.
- Upload the plugin to your Kintone environment via the Kintone Plugin Uploader.
- Enable the plugin in your desired Kintone app.
Usage
Configuration
- In the app settings, navigate to the plugin configuration.
- Select the data source:
- Own Record: Use an attachment field in the current app that contains the Word template.
- Record from Another App: Specify the App ID, Record ID, and Attachment Field Code for the template.
- Save the settings.
Outputting Word Files
- Open a record in the Kintone app where the plugin is enabled.
- Click the "Output Word" button in the record view.
- The plugin will generate and download a Word file based on the configured template and record data.
Template Requirements
- Templates must be in .docx format.
- Use placeholders like
{{fieldCode}}
in the template to insert data. - Supports angular-expressions for advanced formatting (e.g.,
{{fieldCode | uppercase}}
). - Custom Filters: The plugin provides the following custom filters for use in templates:
toUpperCase
: Converts a string to uppercase (e.g.,{{fieldCode | toUpperCase}}
).toLowerCase
: Converts a string to lowercase (e.g.,{{fieldCode | toLowerCase}}
).regexMatch
: Checks if a string matches a regex pattern (e.g.,{{fieldCode | regexMatch:'pattern'}}
).regexFilter
: Filters an array of strings based on a regex pattern (e.g.,{{arrayField | regexFilter:'pattern'}}
).includes
: Checks if an array or string includes a substring (e.g.,{{arrayField | includes:'value'}}
).indexOf
: Returns the index of a substring in an array or string (e.g.,{{arrayField | indexOf:'value'}}
).
Development
Prerequisites
- Node.js (version 18 or higher)
- npm or yarn
Setup
-
Clone the repository:
git clone https://github.com/your-repo/kintone-plugin-docx.git cd kintone-plugin-docx
-
Install dependencies:
npm install
-
Generate private key for development:
npm run gen:key
-
Start development server:
npm start
Build
- Development build:
npm run build
- Production build:
npm run build:prod
Upload to Kintone
npm run upload
Dependencies
@kintone/rest-api-client
: For interacting with Kintone REST API.docxtemplater
: For processing Word templates.angular-expressions
: For template expressions.react
: For the plugin's UI components.
License
This project is licensed under the MIT License. See the LICENSE.txt file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
Support
For support, please check the Kintone Developer Network or open an issue in this repository.