Skip to content

Commit

Permalink
Add help document
Browse files Browse the repository at this point in the history
Currently with help for the new Reformat Document command.
  • Loading branch information
sanssecours authored and infininight committed May 30, 2017
1 parent 59724dc commit 4a0254f
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Commands/Help.tmCommand
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>#!/bin/bash
. "$TM_SUPPORT_PATH/lib/webpreview.sh"
html_header "Ruby Bundle Help" "Ruby"
"$TM_SUPPORT_PATH/lib/markdown_to_help.rb" \
"$TM_BUNDLE_SUPPORT/help/help.markdown"
html_footer</string>
<key>input</key>
<string>none</string>
<key>inputFormat</key>
<string>text</string>
<key>name</key>
<string>Help</string>
<key>outputCaret</key>
<string>afterOutput</string>
<key>outputFormat</key>
<string>html</string>
<key>outputLocation</key>
<string>newWindow</string>
<key>scope</key>
<string>source.ruby</string>
<key>uuid</key>
<string>535AF150-5613-44DB-AB41-EBB934A5865F</string>
<key>version</key>
<integer>2</integer>
</dict>
</plist>
23 changes: 23 additions & 0 deletions Support/help/help.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Reformat Document

The command “Reformat Document” – accessible via <kbd>^</kbd> + <kbd>⇧</kbd> + <kbd>H</kbd> – formats the current document using the `--auto-correct` option of [RuboCop][]. It also shows information about the formatting status in a floating tooltip. The command displays the information about the formatting status either as black text only, or as colorful text if [aha][] is accessible via `PATH`.

[aha]: https://github.com/theZiz/aha
[RuboCop]: https://github.com/bbatsov/rubocop

## RuboCop Version

Which version of [RuboCop][] “Reformat Document” uses depends on your environment. The command will try the options below in the given order.

1. The value of the command specified via `TM_RUBOCOP`.
2. An executable version of RuboCop accessible via `bin/rubocop`.
3. The version of `rubocop` installed via [Bundler][].
4. Any other version of `rubocop` accessible via,
- `/usr/local/bin/rubocop`,
- `$HOME/.rbenv/shims/rubocop`
- or the locations in your `PATH`.

“Reformat Document” prefers [RVM][] install locations of `rubocop` for all of the applicable options above.

[Bundler]: https://bundler.io
[RVM]: https://rvm.io
1 change: 1 addition & 0 deletions info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string>------------------------------------</string>
<string>D5660BB2-C554-4694-9E0F-F20CDB6B9EA0</string>
<string>6EA7AE06-3EA9-497D-A6DE-732DE43DA6E9</string>
<string>535AF150-5613-44DB-AB41-EBB934A5865F</string>
<string>------------------------------------</string>
<string>8646378E-91F5-4771-AC7C-43FC49A93576</string>
<string>EE5F19BA-6C02-11D9-92BA-0011242E4184</string>
Expand Down

0 comments on commit 4a0254f

Please sign in to comment.