-
Notifications
You must be signed in to change notification settings - Fork 450
Home
-
Here are all of the documented options: https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md I recommend using the Atom Beautify package settings and finding the options you want. There are a lot.
-
To switch from JS Beautify to Pretty Diff (or the opposite) use Language Config - JavaScript - Default Beautifier: https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#language-config---javascript---default-beautifier
-
Be aware of the beautifier's option names and the similarly supported option name in Atom Beautify. For instance the vertical option for Pretty Diff is called align_assignments in Atom Beautify: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/prettydiff.coffee#L24 or you can set it in your .jsbeautifyrc file with something like:
{ "js": { "align_assignments": true } }
- Add the language to Atom Beautify. Read How to add a Language in https://github.com/Glavin001/atom-beautify/blob/master/docs/add-languages-and-beautifiers.md#how-to-add-a-language for details.
- Add the chosen language support to your chosen beautifier. See https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/prettydiff.coffee#L30 for an example of Pretty Diff's beautifier code. You can simply add yourLanguageName: true and Atom Beautify will see that the Pretty Diff beautifier supports that language.
- Determine which of the selected beautifier's supported languages works best for your chosen language. Go to the beautifier's website and play around with the supported options.
- Properly handle the language and select the best options to use. Go to https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/prettydiff.coffee#L57-L91 (using Pretty Diff as an example) and add the language that you found worked best on http://prettydiff.com/ (that beautifier's website).
- Read How to add a Beautifier for a Language step 4 for instructions on how to add test files. I insist that a simple test be added for a Pull Request to be merged 😉.