From b9047281771af59bc9dc5c6380321c3cfc81f1c0 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Tue, 22 Mar 2022 02:27:51 +0430 Subject: wip --- spring-front/public/index.css | 37 +++++++++++++++++++++++++++ spring-front/public/index.html | 29 +++++++++++++++++++++ spring-front/public/index.js | 16 ++++++++++++ src/main/java/com/terminaldweller/doc/Md.java | 21 +++++++++++++++ 4 files changed, 103 insertions(+) create mode 100644 spring-front/public/index.css create mode 100644 spring-front/public/index.html create mode 100644 spring-front/public/index.js create mode 100644 src/main/java/com/terminaldweller/doc/Md.java diff --git a/spring-front/public/index.css b/spring-front/public/index.css new file mode 100644 index 0000000..c23fdc6 --- /dev/null +++ b/spring-front/public/index.css @@ -0,0 +1,37 @@ +body { + color: #005f87; + background: #000000; + font-family: "DejaVuSansMono NF", Helvetica, monospace; +} + +.article{$ + text-align: left; + padding: 2%; + border-style: solid; + position: relative; + white-space: -moz-pre-wrap !important; + color: #005f87; + background: #000000; + font-family: "DejaVuSansMono NF", Helvetica, monospace; + overflow-wrap: break-word; + float: left; + /* width: 78%; */ + width: 95%; +} + +a { + color: #005f87; + text-decoration: none; +} + +hr { + color: #005f87; +} + +.left-footer { + float: left; +} + +.right-footer { + float: right; +} diff --git a/spring-front/public/index.html b/spring-front/public/index.html new file mode 100644 index 0000000..c74140d --- /dev/null +++ b/spring-front/public/index.html @@ -0,0 +1,29 @@ + + + + + + + + + + RTLMD + + + +
+ + diff --git a/spring-front/public/index.js b/spring-front/public/index.js new file mode 100644 index 0000000..e6b507f --- /dev/null +++ b/spring-front/public/index.js @@ -0,0 +1,16 @@ +import React from "react"; +import ReactDOM from "react-dom"; + +const page = ( +
+

my awesome website in react

+

REasons

+
    +
  1. one
  2. +
  3. two
  4. +
  5. three
  6. +
  7. four
  8. +
+
+); +ReactDOM.render(page, document.getElementById("root")); diff --git a/src/main/java/com/terminaldweller/doc/Md.java b/src/main/java/com/terminaldweller/doc/Md.java new file mode 100644 index 0000000..be0c447 --- /dev/null +++ b/src/main/java/com/terminaldweller/doc/Md.java @@ -0,0 +1,21 @@ +package com.terminaldweller.doc; + +import org.commonmark.node.Node; +import org.commonmark.parser.Parser; +import org.commonmark.renderer.html.HtmlRenderer; + +/** The markdown class which provides the markdown parser. */ +public class Md { + /** + * Parses a markdown string and returns the result in html. + * + * @param markdown the string containing the markdown string. + * @return the rendered markdown document in html. + */ + public String mdparseService(String markdown) { + Parser parser = parser.builder().build(); + Node document = parser.parse(markdown); + HtmlRenderer renderer = HtmlRenderer.builder().build(); + return renderer.render(document); + } +} -- cgit v1.2.3