https://github.com/alexayan/beauty.js
https://github.com/alexayan/beauty.js
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alexayan/beauty.js
- Owner: alexayan
- Created: 2017-12-20T03:46:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-20T03:46:51.000Z (over 8 years ago)
- Last Synced: 2025-04-02T22:33:18.249Z (over 1 year ago)
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# beauty.js








make web beautiful
## Use it with NPM
Install it via npm:
```shell
npm install beauty.js
```
And include in your project:
```javascript
import beautyJS from 'beauty.js';
// default usage
beautyJS.beauty('text')
beautyJS.beauty(Element)
// custom usage of TextFormat
const format = new beautyJS.TextFormat({
nouns: ['Apple', 'IOS']
});
format.updateNouns(['Apple', 'IOS', 'Android'])
format.formatText('text')
// all tags must closed like: or
format.formatHTMLText('
text
')
// all tags must closed like: and no nest
format.formatHTML('textanother text')
// custom usage of ParagraphFormat
const p = new beautyJS.ParagraphFormat(Element, {
disableHanging: false, // 取消标点悬挂
format: new beautyJS.TestFormat(), // 文本格式化
disableFormat: false, // 禁用文本格式化
clamp: 3 // 最多显示行数
})
// clamp
p.clamp(10) //设置展开行数
// remember destroy to avoid memory leaks
p.clear()
```
## Use it with Script Link
```javascript
// Files are located on /node_modules/beauty.js/build/
beautyJS.beauty('text')
...
```
## License
MIT