Skip to content

Latest commit

 

History

History
81 lines (59 loc) · 2.25 KB

README.md

File metadata and controls

81 lines (59 loc) · 2.25 KB

MarkdownTwain

MarkdownTwain is an open source Android software library that provides an easy-to-use syntax highlighting editor and viewer for Markdown text using Jetpack Compose for Android. This library is based upon the existing Markwon library for Android Views.

With MarkdownTwain, developers can easily add a Markdown editor and viewer to their Android applications, allowing users to easily format and style their text with Markdown syntax.

Features

  • Syntax highlighting for Markdown text
  • Preview of formatted text in real-time
  • Easy-to-use editor and viewer components
  • Customizable styling options
  • Based on the popular Markwon library for Android Views

Demo

Screen_recording_20230405_141145.mp4

Usage

To use MarkdownTwain in your Android project, follow these steps:

  1. Add the following dependency to your app's build.gradle.kts or build.gradle file:
Kotlin
dependencies {
    implementation("com.meetup:twain:0.2.2")
}
Groovy
dependencies {
    implementation 'com.meetup:twain:0.2.2'
}
  1. Use the MarkdownEditor() or MarkdownText() Composables in your Jetpack Compose layouts. There are extra attributes available for customizing the display.
MarkdownEditor
    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
    MarkdownText(
        markdown = textFieldValue.value.text,
        modifier = Modifier.fillMaxWidth()
    )

License

MarkdownTwain is licensed under the Apache 2.0 License. See the LICENSE file for details.

Acknowledgments

MarkdownTwain is based upon the Markwon library for Android Views. Special thanks to Dimitry and all contributors to the Markwon project.