- Notifications
You must be signed in to change notification settings - Fork0
Markdown renderer for Kotlin Multiplatform Projects (Android, Desktop), using Compose.
License
nonproto/multiplatform-markdown-renderer
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
... a Kotlin Multiplatform Markdown Renderer. (Android, Desktop, ...) powered by Compose Multiplatform
What's included 🚀 •Setup 🛠️ •Usage 🛠️ •License 📓
- Super simple setup
- Cross-platform ready
- Lightweight
Multiplatform
For multiplatform projects specify this single dependency:
dependencies { implementation("com.mikepenz:multiplatform-markdown-renderer:${version}")}JVM
To use the library on JVM, you have to include:
dependencies { implementation("com.mikepenz:multiplatform-markdown-renderer-jvm:${version}")}Android
For Android a special dependency is available:
dependencies { implementation("com.mikepenz:multiplatform-markdown-renderer-android:${version}")}val markdown="""### What's included 🚀- Super simple setup- Cross-platform ready- Lightweight""".trimIndent()//Markdown(markdown)
Advanced Usage
The library offers the ability to modify different behaviour when rendering the markdown.
Markdown( content, colors= markdownColors(text=Color.Red), typography= markdownTypography(h1=MaterialTheme.typography.body1))
// Use the bullet list symbol from the original markdownCompositionLocalProvider(LocalBulletListHandler provides {"$it" }) {Markdown(content)}// Replace the ordered list symbol with `A.)` instead.CompositionLocalProvider(LocalOrderedListHandler provides {"A.)" }) {Markdown(content,Modifier.fillMaxSize().padding(16.dp).verticalScroll(scrollState))}
This project uses JetBrainsmarkdown Multiplatform Markdown processor as dependency to parse the markdown content.
This free, open source software was also made possible by a group of volunteers that put many hours of hard work into it. See theCONTRIBUTORS.md file for details.
Big thanks toErik Hellman and his awesome article onRendering Markdown with Jetpack Compose, and the related sourceMarkdownComposer.
Copyright for portions of the code are held by [Erik Hellman, 2020] as part of projectMarkdownComposer under the MIT license. All other copyright for project multiplatform-markdown-renderer are held by [Mike Penz, 2023] under the Apache License, Version 2.0.
Copyright 2023 Mike PenzLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.About
Markdown renderer for Kotlin Multiplatform Projects (Android, Desktop), using Compose.
Resources
License
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Kotlin96.6%
- Ruby3.4%