Skip to content

Commit

Permalink
Merge branch 'release/v1.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
andweeb committed Feb 17, 2019
2 parents 8a42b64 + 728e158 commit 9b9d4d0
Show file tree
Hide file tree
Showing 21 changed files with 1,477 additions and 71 deletions.
3 changes: 3 additions & 0 deletions docs/html/Entity.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ <h5><a href="#selectionModalShortcuts">selectionModalShortcuts</a></h5>
<ul>
<li><kbd>^k</kbd> to navigate up an item</li>
<li><kbd>^j</kbd> to navigate down an item</li>
<li><kbd>^u</kbd> to navigate a page of rows up</li>
<li><kbd>^d</kbd> to navigate a page of rows down</li>
</ul>
</td>
</tr>
Expand All @@ -109,6 +111,7 @@ <h5><a href="#dispatchAction">dispatchAction</a></h5>
<ul>
<li><code>mode</code> - The name of the current mode</li>
<li><code>shortcut</code> - A shortcut object containing the keybindings and event handler for the entity</li>
<li><code>workflow</code> - The list of events that compose the current workflow</li>
</ul>
<p>Returns:</p>
<ul>
Expand Down
40 changes: 38 additions & 2 deletions docs/html/File.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<body>
<header>
<h1><a href="./index.html">docs</a> &raquo; File</h1>
<p>File class that subclasses <a href="Entity.html">Entity</a> to represent some directory or file</p>
<p>File class that subclasses <a href="Entity.html">Entity</a> to represent some directory or file to be automated</p>

</header>
<h3>API Overview</h3>
Expand All @@ -28,6 +28,7 @@ <h3>API Overview</h3>
<ul>
<li><a href="#copy">copy</a></li>
<li><a href="#createEvent">createEvent</a></li>
<li><a href="#createFileChoices">createFileChoices</a></li>
<li><a href="#getFileIcon">getFileIcon</a></li>
<li><a href="#initialize">initialize</a></li>
<li><a href="#move">move</a></li>
Expand Down Expand Up @@ -112,6 +113,41 @@ <h5><a href="#createEvent">createEvent</a></h5>
<ul>
<li>An event handler function</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="createFileChoices">
<a name="//apple_ref/cpp/Method/createFileChoices" class="dashAnchor"></a>
<h5><a href="#createFileChoices">createFileChoices</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>File.createFileChoices(fileListIterator, createText, createSubText) -&gt; choice object list</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Creates a list of choice objects each representing the file walked with the provided iterator</p>
<p>Parameters:</p>
<ul>
<li><code>fileListIterator</code> - an iterator to walk a list of file paths, i.e. <code>s:gmatch(pattern)</code></li>
<li><code>createText</code> - an optional function that takes in a single <code>path</code> argument to return a formatted string to assign to the <code>text</code> field in each file choice object</li>
<li><code>createSubText</code> - an optional function that takes in a single <code>path</code> argument to return a formatted string to assign to the <code>subText</code> field in each file choice object</li>
</ul>
<p>Returns:</p>
<ul>
<li><code>choices</code> - A list of choice objects each containing the following fields:<ul>
<li><code>text</code> - The primary chooser text string</li>
<li><code>subText</code> - The chooser subtext string</li>
<li><code>fileName</code> - The name of the file</li>
<li><code>path</code> - The path of the file</li>
</ul>
</li>
</ul>
</td>
</tr>
</table>
Expand All @@ -130,7 +166,7 @@ <h5><a href="#getFileIcon">getFileIcon</a></h5>
</tr>
<tr>
<th>Description</th>
<td><p>Retrieves an icon image for the given file path or returns nil if not found</p>
<td><p>Retrieves an icon image for the given file path or returns <code>nil</code> if not found</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of a file</li>
Expand Down
267 changes: 267 additions & 0 deletions docs/html/SmartFolder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ki docs: SmartFolder</title>
<style type="text/css">
a { text-decoration: none; }
a:hover { text-decoration: underline; }
th { background-color: #DDDDDD; vertical-align: top; padding: 3px; }
td { width: 100%; background-color: #EEEEEE; vertical-align: top; padding: 3px; }
table { width: 100% ; border: 1px solid #0; text-align: left; }
section > table table td { width: 0; }
</style>
<link rel="stylesheet" href="docs.css" type="text/css" media="screen" />
</head>
<body>
<header>
<h1><a href="./index.html">docs</a> &raquo; SmartFolder</h1>
<p>SmartFolder class that subclasses <a href="File.html">File</a> to represent a <a href="https://support.apple.com/kb/PH25589">smart folder</a> to be automated</p>

</header>
<h3>API Overview</h3>
<ul>
<li>Methods - API calls which can only be made on an object returned by a constructor</li>
<ul>
<li><a href="#copy">copy</a></li>
<li><a href="#initialize">initialize</a></li>
<li><a href="#move">move</a></li>
<li><a href="#moveToTrash">moveToTrash</a></li>
<li><a href="#openFile">openFile</a></li>
<li><a href="#openFileWith">openFileWith</a></li>
<li><a href="#openInfoWindow">openInfoWindow</a></li>
<li><a href="#showFileSearchSelectionModal">showFileSearchSelectionModal</a></li>
</ul>
</ul>
<h3>API Documentation</h3>
<h4 class="documentation-section">Methods</h4>
<section id="copy">
<a name="//apple_ref/cpp/Method/copy" class="dashAnchor"></a>
<h5><a href="#copy">copy</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:copy(path)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Copies a file in the smart folder search results to different folder</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="initialize">
<a name="//apple_ref/cpp/Method/initialize" class="dashAnchor"></a>
<h5><a href="#initialize">initialize</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:initialize(path, shortcuts)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Initializes a new smart folder entity instance with its search criteria file and custom shortcuts. By default, a cheatsheet and default shortcuts are initialized.</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
<li><code>shortcuts</code> - The list of shortcuts containing keybindings and actions for the smart folder entity</li>
</ul>
<p>Each <code>shortcut</code> item should be a list with items at the following indices:</p>
<ul>
<li><code>1</code> - An optional table containing zero or more of the following keyboard modifiers: <code>"cmd"</code>, <code>"alt"</code>, <code>"shift"</code>, <code>"ctrl"</code>, <code>"fn"</code></li>
<li><code>2</code> - The name of a keyboard key. String representations of keys can be found in <a href="https://www.hammerspoon.org/docs/hs.keycodes.html#map"><code>hs.keycodes.map</code></a>.</li>
<li><code>3</code> - The event handler that defines the action for when the shortcut is triggered</li>
<li><code>4</code> - A table containing the metadata for the shortcut, also a list with items at the following indices:<ul>
<li><code>1</code> - The category name of the shortcut</li>
<li><code>2</code> - A description of what the shortcut does</li>
</ul>
</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="move">
<a name="//apple_ref/cpp/Method/move" class="dashAnchor"></a>
<h5><a href="#move">move</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:move(path)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Moves a selected file in the smart folder to a different folder</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="moveToTrash">
<a name="//apple_ref/cpp/Method/moveToTrash" class="dashAnchor"></a>
<h5><a href="#moveToTrash">moveToTrash</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:moveToTrash(path)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Moves a selected file in the smart folder search results to the Trash</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="openFile">
<a name="//apple_ref/cpp/Method/openFile" class="dashAnchor"></a>
<h5><a href="#openFile">openFile</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:openFile(path)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Open a file from the smart folder search results</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="openFileWith">
<a name="//apple_ref/cpp/Method/openFileWith" class="dashAnchor"></a>
<h5><a href="#openFileWith">openFileWith</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:openFileWith(path)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Open a file selected from the smart folder search results with a specific application</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="openInfoWindow">
<a name="//apple_ref/cpp/Method/openInfoWindow" class="dashAnchor"></a>
<h5><a href="#openInfoWindow">openInfoWindow</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:openInfoWindow(path)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Opens a Finder information window for the file selected from the smart folder search results</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
<section id="showFileSearchSelectionModal">
<a name="//apple_ref/cpp/Method/showFileSearchSelectionModal" class="dashAnchor"></a>
<h5><a href="#showFileSearchSelectionModal">showFileSearchSelectionModal</a></h5>
<table>
<tr>
<th>Signature</th>
<td><code>SmartFolder:showFileSearchSelectionModal(path, callback)</code></td>
</tr>
<tr>
<th>Type</th>
<td>Method</td>
</tr>
<tr>
<th>Description</th>
<td><p>Shows a selection modal with smart folder search result choices</p>
<p>Parameters:</p>
<ul>
<li><code>path</code> - The path of the smart folder (<code>.savedSearch</code> file)</li>
<li><code>callback</code> - The callback function invoked on a file choice selection with a choice object created from <a href="File.html#createFileChoices"><code>File.createFileChoices</code></a></li>
</ul>
<p>Returns:</p>
<ul>
<li>None</li>
</ul>
</td>
</tr>
</table>
</section>
</body>
</html>
7 changes: 6 additions & 1 deletion docs/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,17 @@ <h3>API documentation</h3>
</tr>
<tr>
<th><a href="File.html">File</a></th>
<td><p>File class that subclasses <a href="Entity.html">Entity</a> to represent some directory or file</p>
<td><p>File class that subclasses <a href="Entity.html">Entity</a> to represent some directory or file to be automated</p>
</td>
</tr>
<tr>
<th><a href="Ki.html">Ki</a></th>
<td><p><strong>Expressive modal macOS automation, inspired by vi</strong></p>
</td>
</tr>
<tr>
<th><a href="SmartFolder.html">SmartFolder</a></th>
<td><p>SmartFolder class that subclasses <a href="File.html">File</a> to represent a <a href="https://support.apple.com/kb/PH25589">smart folder</a> to be automated</p>
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/markdown/Entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Entity class that represents some generic automatable desktop entity
| **Signature** | `Entity:dispatchAction(mode, shortcut) -> boolean` |
| **Type** | Method |
| **Description** | Dispatch an action from a shortcut within the context of the given mode |
| **Parameters** | <ul><li>`mode` - The name of the current mode</li><li>`shortcut` - A shortcut object containing the keybindings and event handler for the entity</li></ul> |
| **Parameters** | <ul><li>`mode` - The name of the current mode</li><li>`shortcut` - A shortcut object containing the keybindings and event handler for the entity</li><li>`workflow` - The list of events that compose the current workflow</li></ul> |
| **Returns** | <ul><li>A boolean denoting to whether enable or disable automatic mode exit after the action has been dispatched</li></ul> |

| [getEventHandler](#getEventHandler) | |
Expand Down
Loading

0 comments on commit 9b9d4d0

Please sign in to comment.