Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/colintheshots/MarkdownTwain
A Jetpack Compose UI library for editing Markdown content on Android, based on Markwon
https://github.com/colintheshots/MarkdownTwain
Last synced: 9 days ago
JSON representation
A Jetpack Compose UI library for editing Markdown content on Android, based on Markwon
- Host: GitHub
- URL: https://github.com/colintheshots/MarkdownTwain
- Owner: colintheshots
- License: apache-2.0
- Created: 2023-02-22T19:41:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-22T14:06:51.000Z (7 months ago)
- Last Synced: 2024-05-02T06:03:27.383Z (7 months ago)
- Language: Kotlin
- Size: 20.8 MB
- Stars: 106
- Watchers: 6
- Forks: 5
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - colintheshots/MarkdownTwain - A Jetpack Compose UI library for editing Markdown content on Android, based on Markwon (Kotlin)
README
# 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.
Note: MarkdownTwain was created by Colin Lee while working at Meetup.com. The package was migrated to colintheshots.com along with the change in Meetup ownership. Maven package information has changed. Use the new com.colintheshots name to get the latest updates. Also, I also fixed issues preventing using older artifacts on Maven Central.
## 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
https://user-images.githubusercontent.com/626405/230183141-e41033f1-26ba-44bf-adcb-fac65ba649a3.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
```kotlin
dependencies {
implementation("com.colintheshots:twain:0.3.2")
}
```Groovy
```groovy
dependencies {
implementation 'com.colintheshots:twain:0.3.2'
}
```2. Use the `MarkdownEditor()` or `MarkdownText()` Composables in your Jetpack Compose layouts. There are extra attributes available for customizing the display.
MarkdownEditor
```kotlin
val textFieldValue = rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf("")
}
Card {
MarkdownEditor(
value = textFieldValue.value,
onValueChange = { value ->
textFieldValue.value = textFieldValue.value.copy(text = value)
},
modifier = Modifier.fillMaxWidth()
)
}
```MarkdownText
```kotlin
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](https://github.com/noties/Markwon) library for Android Views. Special thanks to [Dimitry](https://github.com/noties) and all contributors to the Markwon project.