Adding new branch for Markdown Testing
This commit is contained in:
parent
e9c899967d
commit
e7aeb1b8a3
4 changed files with 24 additions and 3 deletions
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
|
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||||
<component name="GradleSettings">
|
<component name="GradleSettings">
|
||||||
<option name="linkedExternalProjectsSettings">
|
<option name="linkedExternalProjectsSettings">
|
||||||
<GradleProjectSettings>
|
<GradleProjectSettings>
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
<component name="FrameworkDetectionExcludesConfiguration">
|
||||||
|
<file type="web" url="file://$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
<component name="ProjectRootManager" version="2" languageLevel="JDK_17" default="true" project-jdk-name="17" project-jdk-type="JavaSDK">
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
<output url="file://$PROJECT_DIR$/out" />
|
||||||
</component>
|
</component>
|
||||||
|
|
|
@ -13,6 +13,7 @@ repositories {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
implementation("org.jetbrains:markdown:0.4.1")
|
||||||
testImplementation(kotlin("test"))
|
testImplementation(kotlin("test"))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,25 @@
|
||||||
package gay.kemonomimi
|
package gay.kemonomimi
|
||||||
|
import java.io.*
|
||||||
|
import org.intellij.markdown.parser.MarkdownParser
|
||||||
|
import org.intellij.markdown.flavours.gfm.GFMFlavourDescriptor
|
||||||
|
import org.intellij.markdown.html.HtmlGenerator
|
||||||
|
|
||||||
object Main {
|
object Main {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
println("Hello World!")
|
val src = "~~Some~~ [example webpage](https://www.example.com)"
|
||||||
println("Program arguments: ${args.joinToString()}")
|
val flavour = GFMFlavourDescriptor()
|
||||||
JvavTest().test()
|
val parsedTree = MarkdownParser(flavour).buildMarkdownTreeFromString(src)
|
||||||
|
val html = HtmlGenerator(src, parsedTree, flavour).generateHtml()
|
||||||
|
println("Original Text: $src")
|
||||||
|
println("HTML Output: $html")
|
||||||
|
write(html)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun write(input: String) {
|
||||||
|
val writer = PrintWriter("test.html")
|
||||||
|
writer.append("<style>.user-del { text-decoration: line-through; }</style>\n")
|
||||||
|
writer.append(input + "\n")
|
||||||
|
writer.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue