Mordant Versions Save

Multiplatform text styling for Kotlin command-line applications

2.5.0

3 weeks ago

This release adds support for linuxArm64 and wasmJs targets.

2.4.0

2 months ago

This release includes a complete rewrite of the progress bar system. The new system is more performant and flexible, and allows for more complex progress animations. The old progress bar APIs are deprecated, but will continue to work.

See the documentation website for more information.

Added

  • New implementation of progress bars with a number of improvements:
    • Support for animating multiple progress bars at the same time.
    • New mordant-coroutines modules with extensions for animating with coroutines instead of threads.
    • Any widget can be added to a progress layout, not just the built-in cell types
    • Added compact style to timeRemaining cells.
    • Added marquee cell that can scroll text that is larger than a fixed width.
    • Added timeElapsed cell that shows the time elapsed since the start of the animation.
  • Added Viewport widget that can crop or pad another widget to a fixed size, and scroll it within that size.
  • Added precision parameter to completed progress cell that controls the number of decimal places shown.
  • Animations now automatically handle the terminal resizing, although on some terminals partially drawn frames may be visible. Due to a bug in JNI, the terminal size isn't automatically updated on JVM on macOS.
  • Added TableBuilder.addPaddingWidthToFixedWidth option to control how padding is added to fixed width columns.

Changed

  • Animations now never add a trailing newline while they're running. They always add one once the animation is stopped. The trailingLinebreak parameter is deprecated. This allows full screen animations without a blank line at the bottom.

Fixed

  • Vertical layout now correctly pads non-text cells when align is set to TextAlign.LEFT
  • Fixed exception when hiding the cursor on browsers on JS target.
  • Update internal code generation to be compatible with the latest versions of R8 (#161)

2.3.0

3 months ago

Added

  • Vararg constructors for UnorderedList and OrderedList
  • UnorderedList and OrderedList now support being empty
  • Added optional terminal frame to TerminalRecorder.outputAsHtml

Changed

  • When setting conflicting styles on a Table or its cells, the innermost style now takes precedence (i.e. if you set different styles on the whole table and a cell, the style applied to the cell will be used).

Fixed

  • Updated bundled proguard rules (#130)

2.2.0

7 months ago

Added

  • Added ColumnWidth.Custom that allows more control over column width behavior in tables. (#109)
  • Added showPulse parameter to ProgressLayout.progressBar, allowing you to disable the pulse animation for a bar.
  • Added support for detecting terminal capabilities on mintty. Thanks to @sschuberth for the contribution. (#127)

Changed

  • Update Kotlin to 1.9
  • Use the native C API when building a native image on GraalVM, which reduces binary size and removes the need to reflection. Thanks to @hubvd for the contribution (#119)

2.1.0

9 months ago

Added

  • Added ConfirmationPrompt that asks the user to enter the same value twice, which is commonly used for password inputs.

2.0.1

10 months ago

Added

  • Include metadata in JVM jars to support GraalVM native-image.

Fixed

  • Fix animations printing an extra frame after stop is called when running in the IntelliJ console. (#105)

2.0.0

10 months ago

Mordant 2.0.0 is stable and future releases will follow Semantic Versioning.

Changes from 2.0.0-beta14

Deprecated

  • Deprecated TerminalColors is favor of TextColors and Terminal.theme

2.0.0-beta14

10 months ago

Added

  • Terminal.rawPrint which allows you to print ANSI codes manually. (#91)
  • Option to disable trailing line breaks on animations.
  • Terminal.print, println, and rawPrint now accept a stderr parameter that will print to stderr (if available).

Changed

  • Fix typo in enum name: renamed Borders.TOM_BOTTOM to Borders.TOP_BOTTOM. (#100)
  • The terminal cursor will now be hidden when progressAnimation is running.

Removed

  • Removed TerminalRecorder.currentContent. Use stdout(), stderr() or output() instead.
  • Removed Terminal.forStdErr() and TerminalInterface.forStdErr(). Use Terminal.println(stderr=true) instead.

2.0.0-beta13

1 year ago

Added

  • Add Animation.stop() to stop an animation without clearing it. (#95)
  • Animations now support resuming after a call to stop or clear. (#94)
  • TextStyles.reset, TextStyles.resetForeground, and TextStyles.resetBackground to clear existing styles.

Fixed

  • Fix TerminalInfo.interactive not including outputInteractive
  • Fix prompts on JS targets that were broken by KT-55817

Changed

  • Source-incompatible change: All boolean fields on TextStyle are now nullable. A null field indicates no change to the previous value when adding or nesting styles.
  • verticalLayout{} now defaults TextAlign.NONE, meaning it won't add any trailing whitespace to lines. You can return to the old behavior with align = TextAlign.LEFT.
  • When nesting styles, the outer style will now override inner styles at the start of a string. (e.g. red(blue("x")) == red("x"))
  • Definition List terms and entries can now be empty

2.0.0-beta12

1 year ago

Fixed

  • Switch back to calling stty for detectTerminalSize on macOS. (#86)
  • OverflowWrap is now properly ignored when using a non-wrapping Whitespace value.
  • Fix exception in ProgressBar when its width is 1 character (#75)