### Install Hanzi Writer Miniprogram Plugin Source: https://github.com/chanind/hanzi-writer-miniprogram/blob/master/README.md Command-line instruction to install the Hanzi Writer miniprogram plugin using npm, making it available for use in your project. ```shell npm install hanzi-writer-miniprogram ``` -------------------------------- ### Set Up Local Development Environment Source: https://github.com/chanind/hanzi-writer-miniprogram/blob/master/README.md Command to install project dependencies for local development after cloning the repository, typically used for contributing to the project. ```shell yarn install ``` -------------------------------- ### Embed Hanzi Writer View Component in WXML Source: https://github.com/chanind/hanzi-writer-miniprogram/blob/master/README.md Example WXML snippet for embedding the `hanzi-writer-view` component into a miniprogram page. It demonstrates how to specify a unique ID, width, and height attributes for the component. ```xml ``` -------------------------------- ### Configure Hanzi Writer View Component in page.json Source: https://github.com/chanind/hanzi-writer-miniprogram/blob/master/README.md JSON configuration required in a Wechat miniprogram's `page.json` file to register the `hanzi-writer-view` component, mapping its tag name to the installed plugin path for use in pages. ```json { "usingComponents": { "hanzi-writer-view": "hanzi-writer-miniprogram/hanzi-writer-view" } } ``` -------------------------------- ### Initialize Hanzi Writer Context in Miniprogram Page Source: https://github.com/chanind/hanzi-writer-miniprogram/blob/master/README.md JavaScript code demonstrating how to import `createHanziWriterContext` and initialize the Hanzi Writer instance within a Wechat miniprogram page's `onLoad` method. It shows how to link the instance to the WXML component by ID and perform a basic method call like `loopCharacterAnimation()`. ```javascript import createHanziWriterContext from 'hanzi-writer-miniprogram'; Page({ onLoad: function() { this.writerCtx = createHanziWriterContext({ id: 'hz-writer', character: '你', page: this, }); // You can call any normal HanziWriter method here this.writerCtx.loopCharacterAnimation(); } }); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.