Compare commits

...

1 commit

Author SHA1 Message Date
e7aeb1b8a3 Adding new branch for Markdown Testing 2023-07-10 22:00:40 +12:00
4 changed files with 24 additions and 3 deletions

View file

@ -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>

View file

@ -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>

View file

@ -13,6 +13,7 @@ repositories {
} }
dependencies { dependencies {
implementation("org.jetbrains:markdown:0.4.1")
testImplementation(kotlin("test")) testImplementation(kotlin("test"))
} }

View file

@ -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()
} }
} }