From 85d5083233aa55a9433fb60b00c8f21babd1c90d Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Tue, 28 Mar 2023 11:02:30 -0500 Subject: [PATCH] LPS-179609 add liferay-sample-static-content client extension --- .../build.gradle | 23 +++++++++++++++++++ .../client-extension.yaml | 7 ++++++ .../src/sample.markdown | 13 +++++++++++ 3 files changed, 43 insertions(+) create mode 100644 workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/build.gradle create mode 100644 workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/client-extension.yaml create mode 100644 workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/src/sample.markdown diff --git a/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/build.gradle b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/build.gradle new file mode 100644 index 00000000000000..b26e86f11bc4b3 --- /dev/null +++ b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/build.gradle @@ -0,0 +1,23 @@ +buildscript { + dependencies { + classpath 'com.vladsch.flexmark:flexmark-all:0.64.0' + } + repositories { + mavenCentral() + } +} + +task flexmark { + def inputFile = project.file("src/sample.markdown") + def outputFile = project.file("${project.buildDir}/sample.html") + inputs.file(inputFile) + outputs.file(outputFile) + + doLast { + def parser = com.vladsch.flexmark.parser.Parser.builder().build() + def document = parser.parse(inputFile.text) + def renderer = com.vladsch.flexmark.html.HtmlRenderer.builder().build() + outputFile.parentFile.mkdirs() + outputFile.text = renderer.render(document) + } +} \ No newline at end of file diff --git a/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/client-extension.yaml b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/client-extension.yaml new file mode 100644 index 00000000000000..5ed31a09e70e40 --- /dev/null +++ b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/client-extension.yaml @@ -0,0 +1,7 @@ +assemble: + - fromTask: flexmark + into: static +liferay-sample-static-content: + name: Liferay Sample Static Content + type: staticContent + url: sample.html \ No newline at end of file diff --git a/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/src/sample.markdown b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/src/sample.markdown new file mode 100644 index 00000000000000..dcdd4422d02264 --- /dev/null +++ b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/src/sample.markdown @@ -0,0 +1,13 @@ +# Sample Heading + +This is a [link](https://www.liferay.com) to a html document. + +## Sample Second Heading + +- This is a list item +- This is another list item + +### Sample Third Heading + +1. This is a numbered list item +1. This is another numbered list item \ No newline at end of file