1.0.6 • Published 4 years ago
@marktext/file-icons v1.0.6
File Icons
File icons used in MarkText and inspired by file-icons/atom.
![]()
Installation
yarn add @marktext/file-iconsUsage
import fileIcons from '@marktext/file-icons'
import '@marktext/file-icons/build/index.css'
const icon = fileIcons.matchLanguage('javascript')
// iconEle.classList.add(icon.icon)
// icon with color
// iconEle.classList.add(icon.colour[0])
// iconEle.classList.add(icon.colour[1])You can refer more APIs at atom/icon-tables.js at master · file-icons/atom · GitHub
Development
yarn devAnd open browser at http://127.0.0.1:3000/ to see the example. the example is at folder src.
Build and Publish
# Change the version in package.json
# Build to the build folder
yarn build
# Publish to npm
yarn pubLicense
MIT.