Skip to content

Commit

Permalink
Updated changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
Waboodoo committed Dec 18, 2024
1 parent 372bab8 commit e025030
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 62 deletions.
15 changes: 12 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
## Version 3.21.0

### Improvements
- Homescreen widgets can now be reconfigured without needing to be removed and re-added
- The size of the icon on home screen widgets can now be reduced
- It is now possible to select whether IPv4 or IPv6 should be used for a shortcut's hostname (thanks [menendezeldemente](https://github.com/menendezeldemente))
- You can now send simple HTTP requests directly from Scripting with the newly added `sendHttpRequest` function

### Bugfixes
- The circle icon in the icon picker now has the correct aspect ratio

### Miscellaneous
- The size of the app has been reduced

## Version 3.20.0

Expand Down Expand Up @@ -91,7 +100,7 @@

### Bugfixes
- Fixed a crash that would happen on some devices when deleting characters in Scripting fields or the cURL import
- Homescreen shortcuts are now properly disabled when the respective shortcut is deleted
- Home screen shortcuts are now properly disabled when the respective shortcut is deleted

## Version 3.13.0

Expand Down Expand Up @@ -329,7 +338,7 @@ A lot of things were added, changed and reworked in this version. It is very lik

### Removed
- The app no longer supports different themes and instead just uses one default theme.
- It is no longer possible to use the homescreen's wallpaper as the background for a category. This has the advantage that the app no longer requires the permission to access the file system.
- It is no longer possible to use the home screen's wallpaper as the background for a category. This has the advantage that the app no longer requires the permission to access the file system.

## Version 2.31.0

Expand Down Expand Up @@ -1376,7 +1385,7 @@ as a call-to-action for translators. Help me translate everything!

## Version 1.10.1

- Shortcuts are removed from homescreen when deleted in app
- Shortcuts are removed from home screen when deleted in app
- Fixed a crash when saving shortcuts

## Version 1.10.0
Expand Down
31 changes: 26 additions & 5 deletions HTTPShortcuts/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -340,29 +340,49 @@ dependencies {
testImplementation(libs.kotlinx.coroutines.test)
}

fun generateHtmlFromMarkdown(inputFile: String, outputFile: String, templateFile: String, mutate: String.() -> String = { this }) {
fun generateHtmlFromMarkdown(
inputFile: String,
outputFile: String,
templateFile: String,
processMarkdown: String.() -> String = { this },
processHtml: String.() -> String = { this },
) {
val changelogMarkdown = File("../$inputFile").readText()
.processMarkdown()
val template = File(templateFile).readText()
val flavour = GFMFlavourDescriptor()
val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(changelogMarkdown)
val html = HtmlGenerator(changelogMarkdown, parsedTree, flavour)
.generateHtml()
.removePrefix("<body>")
.removeSuffix("</body>")
.mutate()
.processHtml()
File("app/src/main/assets/$outputFile").writeText(
template.replace("<!-- CONTENT -->", html)
)
}

tasks.register("syncChangeLog") {
description = "copies the CHANGELOG.md file's content into the app so it can be displayed"
val maxSections = 10

doFirst {
generateHtmlFromMarkdown(
inputFile = "CHANGELOG.md",
outputFile = "changelog.html",
templateFile = "changelog_template.html",
processMarkdown = {
var sections = 0
lineSequence()
.takeWhile { line ->
if (line.startsWith("## ")) {
sections++
}
sections <= maxSections
}
.joinToString(separator = "\n")
.plus("\nFor older versions, check the [full changelog](https://github.com/Waboodoo/HTTP-Shortcuts/blob/develop/CHANGELOG.md).")
},
)
}
}
Expand Down Expand Up @@ -392,9 +412,10 @@ tasks.register("syncDocumentation") {
inputFile = "docs/$fileName.md",
outputFile = "docs/$fileName.html",
templateFile = "documentation_template.html",
) {
replace("src=\"../assets/documentation/", "src=\"file:///android_asset/docs/assets/")
}
processHtml = {
replace("src=\"../assets/documentation/", "src=\"file:///android_asset/docs/assets/")
},
)
}
}
}
52 changes: 1 addition & 51 deletions HTTPShortcuts/app/src/main/assets/changelog.html

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions HTTPShortcuts/app/src/main/assets/docs/scripting.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,7 @@
</code></pre><p>For this function to work, location services need to be enabled and the app needs to be granted the permission to access the device's location. This is a technical limitation imposed by the Android OS. See also the <a href="permissions.md">Permissions</a> page for details.</p><p><a name="wol"></a></p><h3>Wake-on-LAN</h3><p>You can use the <code>wakeOnLan</code> function to send a magic packet to turn on another device on your network. The first parameter has to be the MAC-address of the device. As the optional second parameter, you can pass the network/broadcast address to be used, and as the third parameter you can define the port.</p><pre><code class="language-js">wakeOnLan('01-23-45-67-89-ab');

wakeOnLan('01-23-45-67-89-ab', '255.255.255.255', 9);
</code></pre><p><a name="send-http-request"></a></p><h3>Send HTTP request</h3><p>The <code>sendHttpRequest</code> function allows you to send a simple HTTP request. The first parameter is the URL, the second (optional) parameter provides additional options. Currently, the only supported is &quot;method&quot;, which is used to set the HTTP method.
The function returns an object which includes a <code>status</code> field, which has the value &quot;success&quot;, &quot;httpError&quot; or &quot;networkError&quot;. If it is &quot;networkError&quot;, you can check the field <code>networkError</code> for details. Otherwise, you can check the <code>response</code> field for the HTTP response.</p><blockquote><p>If you need more options, consider creating a dedicated HTTP Shortcut for your request and invoking it using <a href="enqueueShortcut">#trigger-shortcut</a> or <a href="executeShortcut">#execute-shortcut</a> instead.</p></blockquote><pre><code class="language-js">const result = sendHttpRequest(
</code></pre><p><a name="send-http-request"></a></p><h3>Send HTTP request</h3><p>The <code>sendHttpRequest</code> function allows you to send a simple HTTP request. The first parameter is the URL, the second (optional) parameter provides additional options. Currently, the only supported option is &quot;method&quot;, which is used to set the HTTP method.</p><p>The function returns an object which includes a <code>status</code> field, which has the value &quot;success&quot;, &quot;httpError&quot; or &quot;networkError&quot;. If it is &quot;networkError&quot;, you can check the field <code>networkError</code> for details. Otherwise, you can check the <code>response</code> field for the HTTP response object. It includes fields <code>body</code>, <code>headers</code>, <code>cookies</code> and <code>statusCode</code>.</p><blockquote><p>If you need more options, consider creating a dedicated HTTP Shortcut for your request and invoking it using <a href="#trigger-shortcut">enqueueShortcut</a> or <a href="#execute-shortcut">executeShortcut</a> instead.</p></blockquote><pre><code class="language-js">const result = sendHttpRequest(
&quot;https://example.com&quot;,
{
method: &quot;POST&quot;,
Expand All @@ -240,7 +239,7 @@
} else if (result.status == &quot;httpError&quot;) {
alert(&quot;Failed with status code &quot; + result.response.statusCode);
} else {
alert(&quot;Failed with network error: &quot; + result.networkError;
alert(&quot;Failed with network error: &quot; + result.networkError);
}
</code></pre><p><a name="send-mqtt-message"></a></p><h3>Send MQTT message</h3><p>The <code>sendMqttMessages</code> function allows you to connect to an MQTT broker, send (i.e. publish) one or more messages to it, and then disconnect again. The first parameter is the URI of the server/broker, the second (optional) parameter provides options for the connection (e.g. username and password) and the third parameter is a list of all the messages that should be sent.</p><pre><code class="language-js">sendMQTTMessages(
&quot;tcp://192.168.0.42:1234&quot;,
Expand Down

0 comments on commit e025030

Please sign in to comment.