Skip to content

Commit 69da38c

Browse files
authored
Merge pull request #4 from rahulshishodia/example-app
added demo app and few fixes
2 parents 8e994c5 + fc14be2 commit 69da38c

39 files changed

Lines changed: 1731 additions & 184 deletions

File tree

.github/workflows/gradle.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ jobs:
5555
MAVEN_PUBLISH_USERNAME: ${{ secrets.MAVEN_PUBLISH_USERNAME }}
5656
MAVEN_PUBLISH_PASSWORD: ${{ secrets.MAVEN_PUBLISH_PASSWORD }}
5757
MAVEN_PUBLISH_URL: ${{ secrets.MAVEN_PUBLISH_SNAPSHOT_URL }}
58-
working-directory: .
59-
run: ./gradlew publish
58+
working-directory: ./plugin
59+
run: ../gradlew publish

build.gradle

Lines changed: 42 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,22 @@ buildscript {
66
includeVersionByRegex 'org[.]apache[.]((grails)|(groovy)).*', '.*', '.*-SNAPSHOT'
77
}
88
}
9+
maven {
10+
url = 'https://central.sonatype.com/repository/maven-snapshots'
11+
content {
12+
includeVersionByRegex 'cloud[.]wondrify', '.*', '.*-SNAPSHOT'
13+
}
14+
}
915
maven { url = 'https://repo.grails.org/grails/restricted' }
1016
}
1117
dependencies {
1218
classpath platform("org.apache.grails:grails-bom:$grailsVersion")
13-
classpath "org.apache.grails:grails-gradle-plugins"
19+
classpath 'org.apache.grails:grails-gradle-plugins'
20+
classpath 'org.apache.grails.gradle:grails-publish'
21+
classpath 'cloud.wondrify:asset-pipeline-gradle'
1422
}
1523
}
1624

17-
plugins {
18-
id "java-library"
19-
id "idea"
20-
id "eclipse"
21-
id "maven-publish"
22-
}
23-
24-
apply plugin: 'org.apache.grails.gradle.grails-plugin'
25-
apply plugin: "org.apache.grails.gradle.grails-publish"
26-
2725
// Define this in ~/.gradle/gradle.properties
2826
ext {
2927
useMavenLocal = project.findProperty('useMavenLocal') ?: false
@@ -48,56 +46,43 @@ allprojects {
4846
}
4947
}
5048

51-
version projectVersion
52-
group 'org.grails.plugins'
53-
54-
compileJava.options.release = 17
49+
version = projectVersion
50+
group = "org.grails.plugins"
5551

56-
dependencies {
57-
implementation platform("org.apache.grails:grails-bom:$grailsVersion")
58-
compileOnly 'org.apache.grails:grails-core'
59-
compileOnly 'org.apache.grails.views:grails-web-taglib'
52+
subprojects { Project project ->
53+
project.version = rootProject.version
54+
project.group = rootProject.group
6055

61-
implementation 'com.vladsch.flexmark:flexmark-all:0.64.8'
56+
tasks.withType(Test).configureEach {
57+
useJUnitPlatform()
6258

63-
console 'org.apache.grails:grails-console'
64-
65-
testImplementation 'org.apache.grails:grails-testing-support-web'
66-
testImplementation "org.spockframework:spock-core"
67-
}
68-
69-
tasks.withType(Test).configureEach {
70-
useJUnitPlatform()
71-
72-
testLogging {
73-
showStandardStreams = true
74-
exceptionFormat = 'full'
59+
testLogging {
60+
showStandardStreams = true
61+
exceptionFormat = 'full'
62+
}
7563
}
76-
}
7764

78-
grailsPublish {
79-
githubSlug = 'grails-plugins/grails-markdown'
80-
license {
81-
name = 'Apache-2.0'
65+
if (project.name.endsWith('grails-markdown')) {
66+
apply plugin: "org.apache.grails.gradle.grails-publish"
67+
grailsPublish {
68+
githubSlug = 'grails-plugins/grails-markdown'
69+
license {
70+
name = 'Apache-2.0'
71+
}
72+
title = "Grails Markdown Plugin"
73+
desc = "Grails Markdown Plugin for Grails 7+"
74+
developers = [
75+
robertoschwald: "Robert Oschwald",
76+
longwa : "Aaron Long",
77+
elkr : "Elmar Kretzer",
78+
jamesfredley : "James Fredley",
79+
jdaugherty : "James Daugherty",
80+
rahulshishodia: "Rahul Shishodia",
81+
sbglasius : "Søren Berg Glasius"
82+
]
83+
websiteUrl = "https://github.com/grails-plugins/grails-markdown"
84+
issueTrackerUrl = "https://github.com/grails-plugins/grails-markdown/issues"
85+
vcsUrl = "https://github.com/grails-plugins/grails-markdown"
86+
}
8287
}
83-
title = "Grails Markdown Plugin"
84-
desc = "Grails Markdown Plugin for Grails 7+"
85-
developers = [
86-
robertoschwald: "Robert Oschwald",
87-
longwa : "Aaron Long",
88-
elkr : "Elmar Kretzer",
89-
jamesfredley : "James Fredley",
90-
jdaugherty : "James Daugherty",
91-
rahulshishodia: "Rahul Shishodia",
92-
sbglasius : "Søren Berg Glasius"
93-
]
94-
websiteUrl = "https://github.com/grails-plugins/grails-markdown"
95-
issueTrackerUrl = "https://github.com/grails-plugins/grails-markdown/issues"
96-
vcsUrl = "https://github.com/grails-plugins/grails-markdown"
97-
}
98-
99-
bootJar.enabled = false
100-
101-
grails {
102-
springDependencyManagement = false
10388
}

example/build.gradle

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
plugins {
2+
id 'eclipse'
3+
id 'idea'
4+
id 'war'
5+
}
6+
7+
apply plugin: "org.apache.grails.gradle.grails-web"
8+
apply plugin: "org.apache.grails.gradle.grails-gsp"
9+
apply plugin: 'cloud.wondrify.asset-pipeline'
10+
11+
assets {
12+
minifyJs = true
13+
minifyCss = true
14+
}
15+
16+
configurations {
17+
developmentOnly
18+
runtimeClasspath {
19+
extendsFrom developmentOnly
20+
}
21+
}
22+
23+
grails {
24+
plugins {
25+
implementation project(':grails-markdown')
26+
}
27+
}
28+
29+
dependencies {
30+
developmentOnly("org.springframework.boot:spring-boot-devtools")
31+
32+
// Spring dependencies
33+
implementation "org.springframework.boot:spring-boot-starter-logging"
34+
implementation "org.springframework.boot:spring-boot-starter-validation"
35+
implementation "org.springframework.boot:spring-boot-autoconfigure"
36+
implementation "org.springframework.boot:spring-boot-starter-tomcat"
37+
38+
// Grails Dependencies
39+
implementation "org.apache.grails:grails-web-boot"
40+
implementation "org.apache.grails:grails-logging"
41+
implementation "org.apache.grails:grails-rest-transforms"
42+
implementation "org.apache.grails:grails-databinding"
43+
implementation "org.apache.grails.i18n:grails-i18n"
44+
implementation "org.apache.grails:grails-services"
45+
implementation "org.apache.grails:grails-url-mappings"
46+
implementation "org.apache.grails:grails-interceptors"
47+
implementation "org.apache.grails:grails-gsp"
48+
implementation "org.apache.grails:grails-layout"
49+
50+
// Database
51+
implementation "org.apache.grails:grails-data-hibernate5"
52+
53+
// H2 Database
54+
runtimeOnly "com.h2database:h2"
55+
56+
// asset pipeline
57+
runtimeOnly "cloud.wondrify:asset-pipeline-grails"
58+
}
59+
60+
// https://github.com/apache/grails-core/issues/15321
61+
tasks.withType(GroovyCompile).configureEach {
62+
groovyOptions.optimizationOptions.indy = false
63+
}
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
.editor-container {
2+
display: grid;
3+
grid-template-columns: 1fr 1fr;
4+
gap: 1.5rem;
5+
}
6+
7+
@media (max-width: 768px) {
8+
.editor-container {
9+
grid-template-columns: 1fr;
10+
}
11+
}
12+
13+
.editor-pane {
14+
display: flex;
15+
flex-direction: column;
16+
height: 100%;
17+
}
18+
19+
.editor-pane .form-group {
20+
flex: 1;
21+
display: flex;
22+
flex-direction: column;
23+
}
24+
25+
.editor-pane textarea {
26+
flex: 1;
27+
width: 100%;
28+
box-sizing: border-box;
29+
min-height: 500px;
30+
height: 500px;
31+
resize: vertical;
32+
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Courier New', monospace;
33+
font-size: 14px;
34+
line-height: 1.6;
35+
padding: 1rem;
36+
border: 1px solid #ddd;
37+
border-radius: 8px;
38+
background: #fafafa;
39+
}
40+
41+
.preview-pane {
42+
background: white;
43+
padding: 1.5rem;
44+
border-radius: 8px;
45+
border: 1px solid #ddd;
46+
min-height: 500px;
47+
height: 500px;
48+
overflow-y: auto;
49+
display: flex;
50+
flex-direction: column;
51+
}
52+
53+
.preview-pane h3 {
54+
margin-top: 0;
55+
color: #2c3e50;
56+
border-bottom: 2px solid #3498db;
57+
padding-bottom: 0.5rem;
58+
margin-bottom: 1rem;
59+
flex-shrink: 0;
60+
}
61+
62+
.preview-content {
63+
flex: 1;
64+
overflow-y: auto;
65+
}
66+
67+
.help-text {
68+
font-size: 0.9rem;
69+
color: #7f8c8d;
70+
margin-top: 0.5rem;
71+
}
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
info:
2+
app:
3+
name: '@info.app.name@'
4+
version: '@info.app.version@'
5+
grailsVersion: '@info.app.grailsVersion@'
6+
grails:
7+
views:
8+
default:
9+
codec: html
10+
gsp:
11+
encoding: UTF-8
12+
htmlcodec: xml
13+
codecs:
14+
expression: html
15+
scriptlet: html
16+
taglib: none
17+
staticparts: none
18+
mime:
19+
disable:
20+
accept:
21+
header:
22+
userAgents:
23+
- Gecko
24+
- WebKit
25+
- Presto
26+
- Trident
27+
types:
28+
all: '*/*'
29+
atom: application/atom+xml
30+
css: text/css
31+
csv: text/csv
32+
form: application/x-www-form-urlencoded
33+
html:
34+
- text/html
35+
- application/xhtml+xml
36+
js: text/javascript
37+
json:
38+
- application/json
39+
- text/json
40+
multipartForm: multipart/form-data
41+
pdf: application/pdf
42+
rss: application/rss+xml
43+
text: text/plain
44+
hal:
45+
- application/hal+json
46+
- application/hal+xml
47+
xml:
48+
- text/xml
49+
- application/xml
50+
codegen:
51+
defaultPackage: com.example
52+
profile: web
53+
dataSource:
54+
driverClassName: org.h2.Driver
55+
username: sa
56+
password: ''
57+
pooled: true
58+
jmxExport: true
59+
environments:
60+
development:
61+
dataSource:
62+
dbCreate: create-drop
63+
url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1
64+
test:
65+
dataSource:
66+
dbCreate: update
67+
url: jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1
68+
production:
69+
dataSource:
70+
dbCreate: none
71+
url: jdbc:h2:./prodDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
72+
hibernate:
73+
cache:
74+
queries: false
75+
use_second_level_cache: false
76+
use_query_cache: false
77+
markdown:
78+
hardwraps: true
79+
autoLinks: true
80+
tables: true
81+
fencedCodeBlocks: true
82+
abbreviations: true
83+
definitionLists: true
84+
smartQuotes: true
85+
smartPunctuation: true

0 commit comments

Comments
 (0)