Skip to content

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Waboodoo committed Dec 21, 2023
1 parent 5c80fe4 commit 0a8eb53
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion HTTPShortcuts/app/src/main/assets/docs/categories.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" href="style.css">
</head>
<body id="root">
<h1>Categories</h1><p>Categories can be used to group different shortcuts together into separate tabs inside the app. Each category has a name and can contain zero or more shortcuts. You can switch between categories while on the app's main screen by swiping horizontally or by selecting the tab at the top of the screen below the title bar.</p><h3>Managing Categories</h3><p>You can access the categories editor via the &quot;Categories&quot; option in the dropdown menu in the app's main screen, or by long-pressing on any of the category tabs in the main screen.</p><h3>Layout Types</h3><p>A category's layout type defines how shortcuts within it are displayed. There are currently only 3 options: list, which will display the shortcuts vertically below each other in a list, and 3 different types of grid, where shortcuts are displayed in a grid, similar to Android's home screen.</p><h3>Backgrounds</h3><p>You can change a category's background to either use the default color (i.e., white or black, depending on whether dark mode is enabled) or set it to a specific color.</p><h3>Hidden Categories</h3><p>A category can be set to be hidden. A hidden category will not show up as a tab in the app. This can be useful if you have shortcuts that you only want to access directly from the home screen (make sure to place them first before hiding the category) or that you only want to trigger from other shortcuts, using <a href="scripting.md#trigger-shortcut">Scripting</a>
<h1>Categories</h1><p>Categories can be used to group different shortcuts together into separate tabs inside the app. Each category has a name and can contain zero or more shortcuts. You can switch between categories while on the app's main screen by swiping horizontally or by selecting the tab at the top of the screen below the title bar.</p><h3>Managing Categories</h3><p>You can access the categories editor via the &quot;Categories&quot; option in the dropdown menu in the app's main screen.</p><h3>Layout Types</h3><p>A category's layout type defines how shortcuts within it are displayed. There are currently only 4 options: list, which will display the shortcuts vertically below each other in a list, and 3 different types of grid, where shortcuts are displayed in a grid, similar to Android's home screen.</p><h3>Backgrounds</h3><p>You can change a category's background to either use the default color (i.e., white or black, depending on whether dark mode is enabled) or set it to a specific color.</p><h3>Hidden Categories</h3><p>A category can be set to be hidden. A hidden category will not show up as a tab in the app. This can be useful if you have shortcuts that you only want to access directly from the home screen (make sure to place them first before hiding the category) or that you only want to trigger from other shortcuts, using <a href="scripting.md#trigger-shortcut">Scripting</a>
or via a <a href="shortcuts.md#multi-shortcut">Multi-Shortcut</a>.</p>
</body>
</html>
2 changes: 1 addition & 1 deletion HTTPShortcuts/app/src/main/assets/docs/variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
<link rel="stylesheet" href="style.css">
</head>
<body id="root">
<h1>Variables</h1><p>Variables allow you to inject pieces of information dynamically into your shortcuts when executing them. A variable consists of a name and a value which is resolved at execution time, based on its type. For some variable types this means that a prompt dialog is shown that asks for a value, others can be resolved without user input. They are global, meaning that they do not belong to a specific shortcut but can be used by all of them.</p><p>Variables are also particularly useful when combined with the app's <a href="scripting.md">Scripting</a> capabilities, as it allows you to compute a value using a piece of JavaScript, storing that value into a variable and then use that value as part of the HTTP request.</p><p>For more details on when variables are resolved see the <a href="execution-flow.md">Execution Flow</a> documentation.</p><h2>Using Variables</h2><p>You can insert a placeholder for a variable into your shortcuts' url, requests parameters, request body, authentication and header fields by clicking the <em>&quot;{ }&quot;</em> button next to the input field and selecting a variable.</p><p>When executing a shortcut that contains variable placeholders all of them are resolved according to their type.</p><p>You can also insert these placeholders into some of your variables, i.e., you can have variables reference other variables, and you can use them when writing <a href="scripting.md#variables">scripts</a>.</p><h2>Variable Types</h2><p>When creating a variable, you have to select its type. The type dictates how the variable will receive its value, and what types of values it supports.</p><p><a name="constant"></a></p><h3>Static Variable</h3><p>A <em>Static Variable</em> (formerly called <em>constant</em>) stores a static value. A typical use case is to store a piece of information that is shared across multiple shortcuts, such as an authentication token or a domain name. This way it can easily be changed.</p><p>It is also possible to change the value of a static variable programmatically before or after a shortcut runs, e.g., store parts of an HTTP response into it. See the <a href="scripting.md#variables">Scripting</a> documentation for more details.</p><p><a name="multiple-choice"></a></p><h3>Multiple Choice Selection</h3><p>The <em>Multiple Choice Selection</em> type consists of a list of options, each of which has a value and a label. It triggers a dialog from which one of the options can be selected.</p><p>It can also be configured to allow selecting multiple values. The selected values will be concatenated using the specified separator. The order in which they were selected is preserved.</p><p><a name="text-number-password"></a></p><h3>Text Input, Number and Password Input</h3><p>The <em>Text Input</em>, <em>Number Input</em> and <em>Password Input</em> types trigger a prompt dialog where a value can be entered into a text field.</p><p><a name="number-slider"></a></p><h3>Number Slider</h3><p>The <em>Number Slider</em> type is similar to the <em>number</em> type. It allows you to pick a number. However, the number is entered using a horizontal slider, for which you can define the minimum and maximum value, as well as the step size.</p><p><a name="date-time"></a></p><h3>Date Input and Time Input</h3><p>The <em>Date Input</em> and <em>Time Input</em> types trigger a prompt dialog where a date or time can be selected. If you just want the current date or time without showing a picker dialog, use the <em>timestamp</em> type instead.</p><p>The output format can be specified according to Android's <a href="https://developer.android.com/reference/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.</p><p><a name="timestamp"></a></p><h3>Timestamp</h3><p>A variable of <em>timestamp</em> type will use the current date and/or time as its valid, using the specified format. The output format can be specified according to Android's <a href="https://developer.android.com/reference/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.</p><p><a name="color"></a></p><h3>Color Input</h3><p>The <em>Color Input</em> type triggers a prompt dialog where a color can be selected. Its value is returned in RGB hex format (e.g., ff0000 for red).</p><p><a name="toggle"></a></p><h3>Toggle</h3><p>The <em>Toggle</em> type consists of a list of values. Every time it is used it resolves to the next value in the list. When the last value is reached it starts again from the first.</p><p><a name="uuid"></a></p><h3>UUID</h3><p>The <em>uuid</em> type will generate a random UUID (<em>U</em>niversally <em>U</em>nique <em>Id</em>entifier) and use that as its value.</p><p>Please note that the UUID is generated once per shortcut execution, not once per variable use, meaning that if you use the same variable multiple times within one shortcut it will have the same value in all places. If you need multiple UUIDs for a single shortcut execution you'll need to use multiple different variables.</p><p><a name="clipboard-content"></a></p><h3>Clipboard Content</h3><p>Variables of type <em>clipboard content</em> will resolve to the latest textual value that was copied to the clipboard. If there is no text in the clipboard or the last thing that was copied does not have a textual representation, the variable will have an empty value.</p><p><a name="sharing"></a></p><h2>Sharing Values into Variables</h2><p>In the advanced settings section of a variable you can mark it as <em>Allow Receiving Value from Share Dialog</em>. This makes it possible to provide the value of this variable through Android's <em>Share</em>-dialog, e.g., by sharing a URL or text snippet from another app. The variable will then assume the shared value during the execution of a shortcut.</p><p>If you enable this option, you will also find a dropdown further down which lets you pick which part of the shared value the variable should assume: the text, the title (if any), or both.</p><p>If you are on Android 11 or newer, you can enhance this by enabling a shortcut as a Direct Share target. You will find the checkbox for this in its &quot;Trigger &amp; Execution Settings&quot;. When this is enabled, the shortcut will appear in the Direct Share sheet, making it easier to quickly share text with that specific shortcut.</p>
<h1>Variables</h1><p>Variables allow you to inject pieces of information dynamically into your shortcuts when executing them. A variable consists of a name and a value which is resolved at execution time, based on its type. For some variable types this means that a prompt dialog is shown that asks for a value, others can be resolved without user input. They are global, meaning that they do not belong to a specific shortcut but can be used by any of them.</p><p>Variables are also particularly useful when combined with the app's <a href="scripting.md">Scripting</a> capabilities, as it allows you to compute a value using a piece of JavaScript code, store that value into a variable and then use that value as part of the HTTP request.</p><p>For more details on when variables are resolved see the <a href="execution-flow.md">Execution Flow</a> documentation.</p><h2>Using Variables</h2><p>You can insert a placeholder for a variable into your shortcuts' url, requests parameters, request body, authentication and header fields by clicking the <em>&quot;{ }&quot;</em> button next to the input field and selecting a variable.</p><p>When executing a shortcut that contains variable placeholders all of them are resolved according to their type. The are resolved in the order in which they appear in the Variables screen, so if you want one variable to be resolved before another, make sure to rearrange them accordingly by dragging.</p><p>You can also insert these placeholders into some of your variables, i.e., you can have variables reference other variables, and you can use them when writing <a href="scripting.md#variables">scripts</a>.</p><h2>Variable Types</h2><p>When creating a variable, you have to select its type. The type dictates how the variable will receive its value, and what types of values it supports.</p><p><a name="constant"></a></p><h3>Static Variable</h3><p>A <em>Static Variable</em> (formerly called <em>constant</em>) stores a static value. A typical use case is to store a piece of information that is shared across multiple shortcuts, such as an authentication token or a domain name. This way it can easily be changed.</p><p>It is also possible to change the value of a static variable programmatically before or after a shortcut runs, e.g., to store parts of an HTTP response into it. See the <a href="scripting.md#variables">Scripting</a> documentation for more details.</p><p><a name="multiple-choice"></a></p><h3>Multiple Choice Selection</h3><p>The <em>Multiple Choice Selection</em> type consists of a list of options, each of which has a value and a label. It triggers a dialog from which one of the options can be selected.</p><p>It can also be configured to allow selecting multiple values. The selected values will be concatenated using the specified separator. The order in which they were selected is preserved.</p><p><a name="text-number-password"></a></p><h3>Text Input, Number and Password Input</h3><p>The <em>Text Input</em>, <em>Number Input</em> and <em>Password Input</em> types trigger a prompt dialog where a value can be entered into a text field.</p><p><a name="number-slider"></a></p><h3>Number Slider</h3><p>The <em>Number Slider</em> type is similar to the <em>number</em> type. It allows you to pick a number. However, the number is entered using a horizontal slider, for which you can define the minimum and maximum value, as well as the step size.</p><p><a name="date-time"></a></p><h3>Date Input and Time Input</h3><p>The <em>Date Input</em> and <em>Time Input</em> types trigger a prompt dialog where a date or time can be selected. If you just want the current date or time without showing a picker dialog, use the <em>timestamp</em> type instead.</p><p>The output format can be specified according to Android's <a href="https://developer.android.com/reference/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.</p><p><a name="timestamp"></a></p><h3>Timestamp</h3><p>A variable of <em>timestamp</em> type will use the current date and/or time as its valid, using the specified format. The output format can be specified according to Android's <a href="https://developer.android.com/reference/java/text/SimpleDateFormat.html">SimpleDateFormat</a>.</p><p><a name="color"></a></p><h3>Color Input</h3><p>The <em>Color Input</em> type triggers a prompt dialog where a color can be selected. Its value is returned in RGB hex format (e.g., ff0000 for red).</p><p><a name="toggle"></a></p><h3>Toggle</h3><p>The <em>Toggle</em> type consists of a list of values. Every time it is used it resolves to the next value in the list. When the last value is reached it starts again from the first.</p><p><a name="uuid"></a></p><h3>UUID</h3><p>The <em>uuid</em> type will generate a random UUID (<em>U</em>niversally <em>U</em>nique <em>Id</em>entifier) and use that as its value.</p><p>Please note that the UUID is generated once per shortcut execution, not once per variable use, meaning that if you use the same variable multiple times within one shortcut it will have the same value in all places. If you need multiple UUIDs for a single shortcut execution you'll need to use multiple different variables.</p><p><a name="clipboard-content"></a></p><h3>Clipboard Content</h3><p>Variables of type <em>clipboard content</em> will resolve to the latest textual value that was copied to the clipboard. If there is no text in the clipboard or the last thing that was copied does not have a textual representation, the variable will have an empty value.</p><p><a name="sharing"></a></p><h2>Sharing Values into Variables</h2><p>In the advanced settings section of a variable you can mark it as <em>Allow Receiving Value from Share Dialog</em>. This makes it possible to provide the value of this variable through Android's <em>Share</em>-dialog, e.g., by sharing a URL or text snippet from another app. The variable will then assume the shared value during the execution of a shortcut.</p><p>If you enable this option, you will also find a dropdown further down which lets you pick which part of the shared value the variable should assume: the text, the title (if any), or both.</p><p>If you are on Android 11 or newer, you can enhance this by enabling a shortcut as a Direct Share target. You will find the checkbox for this in its &quot;Trigger &amp; Execution Settings&quot;. When this is enabled, the shortcut will appear in the Direct Share sheet, making it easier to quickly share text with that specific shortcut.</p>
</body>
</html>
4 changes: 2 additions & 2 deletions docs/categories.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Categories can be used to group different shortcuts together into separate tabs

### Managing Categories

You can access the categories editor via the "Categories" option in the dropdown menu in the app's main screen, or by long-pressing on any of the category tabs in the main screen.
You can access the categories editor via the "Categories" option in the dropdown menu in the app's main screen.

### Layout Types

A category's layout type defines how shortcuts within it are displayed. There are currently only 3 options: list, which will display the shortcuts vertically below each other in a list, and 3 different types of grid, where shortcuts are displayed in a grid, similar to Android's home screen.
A category's layout type defines how shortcuts within it are displayed. There are currently only 4 options: list, which will display the shortcuts vertically below each other in a list, and 3 different types of grid, where shortcuts are displayed in a grid, similar to Android's home screen.

### Backgrounds

Expand Down
8 changes: 4 additions & 4 deletions docs/variables.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Variables

Variables allow you to inject pieces of information dynamically into your shortcuts when executing them. A variable consists of a name and a value which is resolved at execution time, based on its type. For some variable types this means that a prompt dialog is shown that asks for a value, others can be resolved without user input. They are global, meaning that they do not belong to a specific shortcut but can be used by all of them.
Variables allow you to inject pieces of information dynamically into your shortcuts when executing them. A variable consists of a name and a value which is resolved at execution time, based on its type. For some variable types this means that a prompt dialog is shown that asks for a value, others can be resolved without user input. They are global, meaning that they do not belong to a specific shortcut but can be used by any of them.

Variables are also particularly useful when combined with the app's [Scripting](scripting.md) capabilities, as it allows you to compute a value using a piece of JavaScript, storing that value into a variable and then use that value as part of the HTTP request.
Variables are also particularly useful when combined with the app's [Scripting](scripting.md) capabilities, as it allows you to compute a value using a piece of JavaScript code, store that value into a variable and then use that value as part of the HTTP request.

For more details on when variables are resolved see the [Execution Flow](execution-flow.md) documentation.

## Using Variables

You can insert a placeholder for a variable into your shortcuts' url, requests parameters, request body, authentication and header fields by clicking the *"{ }"* button next to the input field and selecting a variable.

When executing a shortcut that contains variable placeholders all of them are resolved according to their type.
When executing a shortcut that contains variable placeholders all of them are resolved according to their type. The are resolved in the order in which they appear in the Variables screen, so if you want one variable to be resolved before another, make sure to rearrange them accordingly by dragging.

You can also insert these placeholders into some of your variables, i.e., you can have variables reference other variables, and you can use them when writing [scripts](scripting.md#variables).

Expand All @@ -23,7 +23,7 @@ When creating a variable, you have to select its type. The type dictates how the

A *Static Variable* (formerly called *constant*) stores a static value. A typical use case is to store a piece of information that is shared across multiple shortcuts, such as an authentication token or a domain name. This way it can easily be changed.

It is also possible to change the value of a static variable programmatically before or after a shortcut runs, e.g., store parts of an HTTP response into it. See the [Scripting](scripting.md#variables) documentation for more details.
It is also possible to change the value of a static variable programmatically before or after a shortcut runs, e.g., to store parts of an HTTP response into it. See the [Scripting](scripting.md#variables) documentation for more details.

<a name="multiple-choice"></a>
### Multiple Choice Selection
Expand Down

0 comments on commit 0a8eb53

Please sign in to comment.