atom-beautify/docs/code/class/Beautifier.html

582 lines
14 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'>
<title>Atom-Beautify Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Atom-Beautify'>
Atom-Beautify
</a>
&raquo;
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
&raquo;
<span class='title'>Beautifier</span>
</div>
</div>
<div id='content'>
<h1>
Class:
Beautifier
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src&#47;beautifiers&#47;beautifier.coffee</td>
</tr>
</table>
<h2>Direct Known Subclasses</h2>
<p class='children'>
<a href='../class/AlignYaml.html'>AlignYaml</a>
<a href='../class/Autopep8.html'>Autopep8</a>
<a href='../class/BashBeautify.html'>BashBeautify</a>
<a href='../class/Brittany.html'>Brittany</a>
<a href='../class/ClangFormat.html'>ClangFormat</a>
<a href='../class/Cljfmt.html'>Cljfmt</a>
<a href='../class/CoffeeFmt.html'>CoffeeFmt</a>
<a href='../class/CoffeeFormatter.html'>CoffeeFormatter</a>
<a href='../class/Crystal.html'>Crystal</a>
<a href='../class/JSBeautify.html'>JSBeautify</a>
<a href='../class/Dfmt.html'>Dfmt</a>
<a href='../class/ElmFormat.html'>ElmFormat</a>
<a href='../class/ErlTidy.html'>ErlTidy</a>
<a href='../class/ESLintFixer.html'>ESLintFixer</a>
<a href='../class/R.html'>R</a>
<a href='../class/FortranBeautifier.html'>FortranBeautifier</a>
<a href='../class/Gherkin.html'>Gherkin</a>
<a href='../class/GN.html'>GN</a>
<a href='../class/Gofmt.html'>Gofmt</a>
<a href='../class/Goimports.html'>Goimports</a>
<a href='../class/HhFormat.html'>HhFormat</a>
<a href='../class/Hindent.html'>Hindent</a>
<a href='../class/HTMLBeautifier.html'>HTMLBeautifier</a>
<a href='../class/JSBeautify.html'>JSBeautify</a>
<a href='../class/JSCSFixer.html'>JSCSFixer</a>
<a href='../class/LatexBeautify.html'>LatexBeautify</a>
<a href='../class/Lua.html'>Lua</a>
<a href='../class/MarkoBeautifier.html'>MarkoBeautifier</a>
<a href='../class/NginxBeautify.html'>NginxBeautify</a>
<a href='../class/OCPIndent.html'>OCPIndent</a>
<a href='../class/PerlTidy.html'>PerlTidy</a>
<a href='../class/PHPCSFixer.html'>PHPCSFixer</a>
<a href='../class/PHPCBF.html'>PHPCBF</a>
<a href='../class/Prettier.html'>Prettier</a>
<a href='../class/PrettyDiff.html'>PrettyDiff</a>
<a href='../class/PugBeautify.html'>PugBeautify</a>
<a href='../class/PuppetFix.html'>PuppetFix</a>
<a href='../class/PythonBeautifier.html'>PythonBeautifier</a>
<a href='../class/Remark.html'>Remark</a>
<a href='../class/Rubocop.html'>Rubocop</a>
<a href='../class/RubyBeautify.html'>RubyBeautify</a>
<a href='../class/Rustfmt.html'>Rustfmt</a>
<a href='../class/SassConvert.html'>SassConvert</a>
<a href='../class/Sqlformat.html'>Sqlformat</a>
<a href='../class/StylishHaskell.html'>StylishHaskell</a>
<a href='../class/Terraformfmt.html'>Terraformfmt</a>
<a href='../class/TidyMarkdown.html'>TidyMarkdown</a>
<a href='../class/TypeScriptFormatter.html'>TypeScriptFormatter</a>
<a href='../class/Uncrustify.html'>Uncrustify</a>
<a href='../class/EmacsVerilogMode.html'>EmacsVerilogMode</a>
<a href='../class/VhdlBeautifier.html'>VhdlBeautifier</a>
<a href='../class/VueBeautifier.html'>VueBeautifier</a>
<a href='../class/Yapf.html'>Yapf</a>
</p>
<h2>Variables Summary</h2>
<dl class='constants'>
<dt id='Promise-variable'>
Promise
=
</dt>
<dd>
<pre><code class='coffeescript'>Promise</code></pre>
<div class='docstring'>
<p>Promise</p>
</div>
<div class='tags'>
</div>
</dd>
<dt id='name-variable'>
name
=
</dt>
<dd>
<pre><code class='coffeescript'>&#39;Beautifier&#39;</code></pre>
<div class='docstring'>
<p>Name of Beautifier</p>
</div>
<div class='tags'>
</div>
</dd>
<dt id='options-variable'>
options
=
</dt>
<dd>
<pre><code class='coffeescript'>{}</code></pre>
<div class='docstring'>
<p>Supported Options</p><p>Enable options for supported languages.</p><ul>
<li><string:language>:<boolean:all_options_enabled></li>
<li><string:language>:<string:option_key>:<boolean:enabled></li>
<li><string:language>:<string:option_key>:<string:rename></li>
<li><string:language>:<string:option_key>:<function:transform></li>
<li><string:language>:<string:option_key>:<array:mapper></li>
</ul>
</div>
<div class='tags'>
</div>
</dd>
<dt id='executables-variable'>
executables
=
</dt>
<dd>
<pre><code class='coffeescript'>[]</code></pre>
</dd>
<dt id='_exe-variable'>
_exe
=
</dt>
<dd>
<pre><code class='coffeescript'>{}</code></pre>
</dd>
<dt id='languages-variable'>
languages
=
</dt>
<dd>
<pre><code class='coffeescript'>null</code></pre>
<div class='docstring'>
<p>Supported languages by this Beautifier</p><p>Extracted from the keys of the <code>options</code> field.</p>
</div>
<div class='tags'>
</div>
</dd>
<dt id='beautify-variable'>
beautify
=
</dt>
<dd>
<pre><code class='coffeescript'>null</code></pre>
<div class='docstring'>
<p>Beautify text</p><p>Override this method in subclasses</p>
</div>
<div class='tags'>
</div>
</dd>
<dt id='logger-variable'>
logger
=
</dt>
<dd>
<pre><code class='coffeescript'>null</code></pre>
<div class='docstring'>
<p>Logger instance</p>
</div>
<div class='tags'>
</div>
</dd>
</dl>
<h2>Instance Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#isPreInstalled-dynamic'>
#
(void)
<b>isPreInstalled</b><span>()</span>
</a>
</span>
<span class='desc'>
Is the beautifier a command-line interface beautifier?
</span>
</li>
<li>
<span class='signature'>
<a href='#loadExecutables-dynamic'>
#
(void)
<b>loadExecutables</b><span>()</span>
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#exe-dynamic'>
#
(void)
<b>exe</b><span>(cmd)</span>
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#deprecate-dynamic'>
#
(void)
<b>deprecate</b><span>(warning)</span>
</a>
</span>
<span class='desc'>
Show deprecation warning to user.
</span>
</li>
<li>
<span class='signature'>
<a href='#deprecateOptionForExecutable-dynamic'>
#
(void)
<b>deprecateOptionForExecutable</b><span>(exeName, oldOption, newOption)</span>
</a>
</span>
<span class='desc'>
</span>
</li>
<li>
<span class='signature'>
<a href='#tempFile-dynamic'>
#
(void)
<b>tempFile</b><span>(name = &quot;atom-beautify-temp&quot;, contents = &quot;&quot;, ext = &quot;&quot;)</span>
</a>
</span>
<span class='desc'>
Create temporary file
</span>
</li>
<li>
<span class='signature'>
<a href='#readFile-dynamic'>
#
(void)
<b>readFile</b><span>(filePath)</span>
</a>
</span>
<span class='desc'>
Read file
</span>
</li>
<li>
<span class='signature'>
<a href='#findFile-dynamic'>
#
(void)
<b>findFile</b><span>(startDir, fileNames)</span>
</a>
</span>
<span class='desc'>
Find file
</span>
</li>
<li>
<span class='signature'>
<a href='#getDefaultLineEnding-dynamic'>
#
(void)
<b>getDefaultLineEnding</b><span>(crlf, lf, optionEol)</span>
</a>
</span>
<span class='desc'>
Retrieves the default line ending based upon the Atom configuration <code>line-ending-selector.defaultLineEnding</code>.
</span>
</li>
<li>
<span class='signature'>
<a href='#which-dynamic'>
#
(void)
<b>which</b><span>(exe, options = {})</span>
</a>
</span>
<span class='desc'>
Like the unix which utility.
</span>
</li>
<li>
<span class='signature'>
<a href='#run-dynamic'>
#
(void)
<b>run</b><span>(executable, args, {cwd, ignoreReturnCode, help, onStdin} = {})</span>
</a>
</span>
<span class='desc'>
Run command-line interface command
</span>
</li>
<li>
<span class='signature'>
<a href='#setupLogger-dynamic'>
#
(void)
<b>setupLogger</b><span>()</span>
</a>
</span>
<span class='desc'>
Initialize and configure Logger
</span>
</li>
</ul>
<h2>Constructor Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='constructor-dynamic'>
#
(void)
<b>constructor</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Constructor to setup beautifer</p>
</div>
<div class='tags'>
</div>
</div>
</div>
<h2>Instance Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='isPreInstalled-dynamic'>
#
(void)
<b>isPreInstalled</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Is the beautifier a command-line interface beautifier?</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='loadExecutables-dynamic'>
#
(void)
<b>loadExecutables</b><span>()</span>
<br>
</p>
</div>
<div class='method_details'>
<p class='signature' id='exe-dynamic'>
#
(void)
<b>exe</b><span>(cmd)</span>
<br>
</p>
</div>
<div class='method_details'>
<p class='signature' id='deprecate-dynamic'>
#
(void)
<b>deprecate</b><span>(warning)</span>
<br>
</p>
<div class='docstring'>
<p>Show deprecation warning to user.</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='deprecateOptionForExecutable-dynamic'>
#
(void)
<b>deprecateOptionForExecutable</b><span>(exeName, oldOption, newOption)</span>
<br>
</p>
</div>
<div class='method_details'>
<p class='signature' id='tempFile-dynamic'>
#
(void)
<b>tempFile</b><span>(name = &quot;atom-beautify-temp&quot;, contents = &quot;&quot;, ext = &quot;&quot;)</span>
<br>
</p>
<div class='docstring'>
<p>Create temporary file</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='readFile-dynamic'>
#
(void)
<b>readFile</b><span>(filePath)</span>
<br>
</p>
<div class='docstring'>
<p>Read file</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='findFile-dynamic'>
#
(void)
<b>findFile</b><span>(startDir, fileNames)</span>
<br>
</p>
<div class='docstring'>
<p>Find file</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='getDefaultLineEnding-dynamic'>
#
(void)
<b>getDefaultLineEnding</b><span>(crlf, lf, optionEol)</span>
<br>
</p>
<div class='docstring'>
<p>Retrieves the default line ending based upon the Atom configuration
<code>line-ending-selector.defaultLineEnding</code>. If the Atom configuration
indicates &quot;OS Default&quot;, the <code>process.platform</code> is queried, returning
CRLF for Windows systems and LF for all other systems.
Code modified from atom/line-ending-selector
returns: The correct line-ending character sequence based upon the Atom
configuration, or <code>null</code> if the Atom line ending configuration was not
recognized.
see: <a href="https://github.com/atom/line-ending-selector/blob/master/lib/main.js">https://github.com/atom/line-ending-selector/blob/master/lib/main.js</a></p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='which-dynamic'>
#
(void)
<b>which</b><span>(exe, options = {})</span>
<br>
</p>
<div class='docstring'>
<p>Like the unix which utility.</p><p>Finds the first instance of a specified executable in the PATH environment variable.
Does not cache the results,
so hash -r is not needed when the PATH changes.
See <a href="https://github.com/isaacs/node-which">https://github.com/isaacs/node-which</a></p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='run-dynamic'>
#
(void)
<b>run</b><span>(executable, args, {cwd, ignoreReturnCode, help, onStdin} = {})</span>
<br>
</p>
<div class='docstring'>
<p>Run command-line interface command</p>
</div>
<div class='tags'>
</div>
</div>
<div class='method_details'>
<p class='signature' id='setupLogger-dynamic'>
#
(void)
<b>setupLogger</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Initialize and configure Logger</p>
</div>
<div class='tags'>
</div>
</div>
</div>
</div>
<div id='footer'>
By
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.1.2
&#10034;
Press H to see the keyboard shortcuts
&#10034;
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
&#10034;
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>