A declarative, Kotlin-idiomatic API for writing dynamic console applications.
This release introduces the very powerful grid widget into Kotter.
In other words, you can create tables in Kotter now. :tada:
section {
// A grid with two columns, each with space for 6 characters
grid(Cols(6, 6), characters = GridCharacters.CURVED) {
cell { textLine("Cell1") }
cell { textLine("Cell2") }
cell { textLine("Cell3") }
cell { textLine("Cell4") }
// Jump over cell row=2,col=0
cell(row = 2, col = 1) { textLine("Cell6") }
}
}.run()
Be sure to review the Grid section in the README as there are a bunch of other features discussed in there, such as fit- and star-sized columns, row and column spanning cells, and more.
session
wouldn't correctly shut down its key input processing when finished.
width
value when using the virtual terminal, it now returns the width that the terminal was constructed with, not Int.MAX_VALUE
.Full Changelog: https://github.com/varabyte/kotter/compare/v1.1.1...v1.1.2
HUGE thanks to @grnt426 for their support around grids. They initiated progress on the feature and provided a ton of real-world testing using an impressive project they are working on. I mean, just look at this:
The biggest change of this release is the new multilineInput
method, which lets a user type in input with newlines.
section {
black(isBright = true) { text("Send a text message (press CTRL-D when finished)") }
multilineInput()
}.runUntilInputEntered {
onInputEntered { sendMessage(input.trim()) }
}
You can press arrow keys / home+end / page up+down to navigate around the answer. In order to allow this, the multiline input area always begins on a newline and ends with a newline.
multilineInput
, which is better described above.customFormat
parameter (to input
and mutlilineInput
) which can be used to change text color / add text effects to user input as they type it.
Full Changelog: https://github.com/varabyte/kotter/compare/v1.1.0...v1.1.1
:tada: :tada: :tada: Kotter 1.1.0 introduces Kotlin/Native support. :tada: :tada: :tada:
In other words, you can now target the JVM or you can compile against 64-bit Linux, Mac, or Windows hosts directly via the Kotlin multiplatform plugin. Review the README on how to set this up.
If you have an application that is using v1.0.x, be sure to follow all steps in the migration doc. It should be relatively straightforward.
Hopefully getting close to a v1.1.0 release. Maybe this is the one! :crossed_fingers:
This release adds the following changes:
kotter-app < input.txt
is not allowed)runFor(duration)
extension methods, so you can now write:
section { ... }.runFor(5.seconds)
section { ... }.runForAtLeast(5.seconds) { ... }
runFor
but doesn't aggressively abort in case you're still doing more work after the time runs out.section { ... }.runForAtMost(5.seconds) { ... }
assertMatches
test method, which prints a clear error message if your Kotter output doesn't match what's expected.Two additional fixes in this release:
Note that this release changes K/N targets only. If you are using v1.1.0-rc1 (or rc2) to target the JVM, then this release will be identical.
This release is the same as v1.1.0-rc1 except with one bug fixed: repainting was broken whenever any line ended up being longer than the width of your terminal, leaving old text around. (There was an issue calculating how many lines needed to be erased caused by the fact that one line got broken up into two)
Note that this bug affected K/N targets only. If you are using v1.1.0-rc1 to target the JVM, then this release will be identical.
The 1.1.0 version brings Kotter into the world of multiplatform, adding Kotlin/Native support.
This is a prerelease build, as I'm hoping to get community confirmation, especially about the native targets. But if you're a JVM user, it should be relatively safe to upgrade. |
---|
This means, in addition to JVM :coffee: support, you can also build binaries directly for Windows :window: , Mac :apple: , and Linux :penguin: platforms.
If you are new to Kotter, just jump into the README! If you are a 1.0.x user, you should review the migration steps. (They're not that bad)
This release also introduces a new onShutdownHook
feature (since I had to implement a bunch of work around this for multiplatform anyway). You can read more here if curious.
Finally, a bit overdue, but I added a section to the README about distributing your Kotter application. It's a little minimal at the moment, since it's hard to capture everything relevant about this, but I'm looking for feedback. Feel free to email me if you found it helpful, not helpful, somewhat helpful but missing something, etc.
Thank you!
Very minor release, which reduces the JVM requirement back to 8.
At some point in development, the JVM version got set to 11 for some temporary experimentation I was doing. However, that later ended up getting dropped, but I forgot that I could set the version back down to 8 again.
Otherwise, this release is identical to 1.0.1.
This is a very small release, adding support for CTRL-C on Windows where it didn't previously work.
At this point, Kotter provides a core API for writing dynamic CLIs that is:
Outside of documentation changes, there were a handful of API changes that snuck in since v1.0.0-rc3, gaps I noticed when poring over the API docs:
TextAnim
s no longer implement CharSequence
.
length
means the length of the text for that frame, not the length of the animation.)text(myTextAnim)
in your project, simply right-click on it and import the new extension method that fixes it. Or, change it to text("$myTextAnim")
as another alternative.shiftRight { ... }
method, which takes any text rendered in the block and prepends all lines with spaces.minWidth
property to the justified
method
justified(CENTER, minWidth = 10) { text("Hi") }
paused
propertylooping
parameter when creating animations, so that you can define one-shot animations.totalDuration
, isRunning
, and lastFrame