Skip to content

Little library that provide kotlin extension functions for commonmark-java

License

Notifications You must be signed in to change notification settings

OlegKrikun/commonmark-java-ktx

Repository files navigation

commonmark-java-ktx

Little library that provide kotlin extension functions for commonmark-java

Download Kotlin GitHub license

Get

repositories {
    jcenter()
}

dependencies {
    implementation("ru.krikun.commonmark:commonmark-ktx:0.1.2")
}

Usage

"...".parse().renderHtml()
inputStream
    .parse { extensions(extensionList) }
    .renderHtml { extensions(extensionList) }
file
    .parseBuffered(bufferSize = 4 * 1024) { extensions(extensionList) }
    .renderTextContent { extensions(extensionList) }
buildString { 
    ...
    renderHtml(content.parse())
    ...
}
val sequence = sequenceOf<File>(...)

val parser = buildParser()
val renderer = buildTextContentRenderer { stripNewlines(true)}

val result = sequence.map { parser.parse(it) }.map { renderer.render(it) }

Dependencies

Dependency Version
kotlin-jvm 1.4.10
commonmark-java 0.15.2

License

Copyright 2020 OlegKrikun

Licensed 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.0

Unless required by applicable law or agreed to in writing, software
distributed 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 and
limitations under the License.

About

Little library that provide kotlin extension functions for commonmark-java

Topics

Resources

License

Stars

Watchers

Forks

Languages