Announcing Markdown Twain: A new, Open Source Markdown editor

Colin Lee
Making Meetup
Published in
2 min readApr 21, 2023

We at Meetup are excited to announce the release of Markdown Twain, an open-source library for Android that provides an easy-to-use syntax highlighting editor and viewer for Markdown text using Jetpack Compose for Android.

Our new Meetup for Organizers app was entirely written in Jetpack Compose and Kotlin Multiplatform Mobile. While building the new app, we needed a Markdown editor to allow Meetup organizers to edit rich text descriptions for the events they manage. We discovered that no Markdown Editor already existed for Jetpack Compose. So we wrote our own.

Editing an event description in Meetup for Organizers on Android

With Markdown Twain, developers can easily add a Markdown editor and viewer to their Android applications, allowing people using their apps to easily format and style their text with Markdown syntax. Markdown Twain offers a number of features, including syntax highlighting for Markdown text, real-time preview of formatted text, easy-to-use editor and viewer components, and customizable styling options, and it is based on the popular Markwon library for Android Views.

Check out a demo video to see Markdown Twain in action:

To use Markdown Twain in your Android project, simply follow these steps:

  1. Add the following dependency to your app’s build.gradle.kts or build.gradle file:
dependencies {
implementation("com.meetup:twain:0.2.2") // or the latest version
}
  1. Use the MarkdownEditor() or MarkdownText() Composables in your Jetpack Compose layouts. There are extra attributes available for customizing the display.
val textFieldValue = rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf("")
}
Card {
MarkdownEditor(
value = textFieldValue.value,
onValueChange = { value -> textFieldValue.value = value.copy(text = value.text) },
modifier = Modifier.fillMaxWidth()
)
}
MarkdownText(
markdown = textFieldValue.value.text,
modifier = Modifier.fillMaxWidth()
)

Markdown Twain is licensed under the Apache 2.0 License. For more information, see the LICENSE file. We would like to acknowledge the Markwon library for Android Views and its contributors for providing the foundation for Markdown Twain.

We hope that Markdown Twain will be a useful tool for developers looking to add Markdown editing and viewing capabilities to their Android applications. Please feel free to check out our GitHub repository and provide feedback or contribute to the project.

--

--

Colin Lee
Making Meetup

Doubleplusgood #AndroidDev. Former political nominee. Thoughtcrimes are my own.