Initial Home page

Austin Cheney 2015-08-24 14:49:08 -05:00
commit a2e5fcf9fa
1 changed files with 24 additions and 0 deletions

24
Home.md Normal file

@ -0,0 +1,24 @@
# Atom Beautify
## How to guides
### How to configure various options or change the default beautifier for a given language
1. 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.
2. 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
3. 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
}
}
### How to configure an unsupported language using an existing beautifier
1. 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.
2. 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.
3. 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.
4. 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).
5. 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 :wink:.