huangcheng / craft-extension-prettier

Craft eXtension - Prettier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Craft eXtension - Prettier

A Craft extension to format code blocks using Prettier

Features

Preview

Preview the result on blocks clicking. preview

Config

Options are the same with Prettier Playground, so the formatting result can be fine-tuned. config

the parser is specified automatically based on the language of the selected block, but for those languages Craft doesn't support it, it still can be specified manually.

Format

original

Just click the format button, and the content of the block will be updated.

formatted

Building

Simply run npm install and than npm run build to generate the .craftX file which can be installed. You can use npm run dev to test and debug in your local environment

To learn more about Craft eXtensions visit the Craft X developer portal.

Links

Prettier Prettier Playground

About

Craft eXtension - Prettier

License:MIT License


Languages

Language:TypeScript 75.3%Language:JavaScript 22.2%Language:Shell 1.3%Language:HTML 1.1%