From 42e0d7970603b60c1ca45f44fad052c2320fc079 Mon Sep 17 00:00:00 2001 From: Gregory Amerson Date: Wed, 5 Apr 2023 16:55:05 -0500 Subject: [PATCH] LPS-179609 add liferay-sample-static-content sample --- .../liferay-sample-workspace/.gitignore | 3 +-- .../build.gradle | 27 +++++++++++++++++++ .../client-extension.yaml | 7 +++++ .../src/sample.markdown | 14 ++++++++++ .../configs/local/portal-ext.properties | 4 ++- 5 files changed, 52 insertions(+), 3 deletions(-) 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/.gitignore b/workspaces/liferay-sample-workspace/.gitignore index 8638aeb16c2dcb..eaba5be3855737 100644 --- a/workspaces/liferay-sample-workspace/.gitignore +++ b/workspaces/liferay-sample-workspace/.gitignore @@ -1,8 +1,7 @@ -.DS_Store /bundles /poshi/poshi-ext.properties bin build dist node_modules -node_modules_cache \ No newline at end of file +node_modules_cache 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..e4d2a794fdaf5c --- /dev/null +++ b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/build.gradle @@ -0,0 +1,27 @@ +import com.vladsch.flexmark.html.HtmlRenderer +import com.vladsch.flexmark.parser.Parser + +buildscript { + dependencies { + classpath group: "com.vladsch.flexmark", name: "flexmark-all", version: "0.64.0" + } + + repositories { + mavenCentral() + } +} + +task flexmark + +flexmark { + File inputFile = project.file("src/sample.markdown") + inputs.file(inputFile) + + File outputFile = project.file("${project.buildDir}/sample.html") + outputs.file(outputFile) + + doLast { + outputFile.parentFile.mkdirs() + outputFile.text = HtmlRenderer.builder().build().render(Parser.builder().build().parse(inputFile.text)) + } +} \ 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..3d6488662445db --- /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..3c949156cd96d1 --- /dev/null +++ b/workspaces/liferay-sample-workspace/client-extensions/liferay-sample-static-content/src/sample.markdown @@ -0,0 +1,14 @@ +# 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 diff --git a/workspaces/liferay-sample-workspace/configs/local/portal-ext.properties b/workspaces/liferay-sample-workspace/configs/local/portal-ext.properties index 5f326a61f0e6f7..c2e1f7f4647271 100644 --- a/workspaces/liferay-sample-workspace/configs/local/portal-ext.properties +++ b/workspaces/liferay-sample-workspace/configs/local/portal-ext.properties @@ -6,4 +6,6 @@ #jdbc.default.username=root #jdbc.default.password= -feature.flag.LPS-166479=true \ No newline at end of file +feature.flag.LPS-166479=true + +feature.flag.LPS-177027=true \ No newline at end of file