Skip to content

A formatter for wxml, ttml, swan, axml. 小程序 DSL 格式化工具

License

Notifications You must be signed in to change notification settings

Arichy/xxml-formatter

 
 

Repository files navigation

xxml-formatter

A formatter for xxml based on htmlparser2

xxml is a kind of DSL used wildly by Chinese microapps such as:

  • .wxml - Weixin microapp
  • .ttml - Bytedance microapp
  • .swan - Baidu microapp
  • .axml - Alipay microapp

Usage

import Formatter from 'xxml-formatter';
const formatter = new Formatter({ tabSize: 2 });

const sourceCode = `<view><text>hello world</text></view>`;
const resultCode = formatter.format(sourceCode);
console.log(resultCode);

Output (simplified):

<view>
  <text>hello world</text>
</view>

About

A formatter for wxml, ttml, swan, axml. 小程序 DSL 格式化工具

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.2%
  • HTML 1.8%