Skip to content

Commit 14dc5ae

Browse files
Playground (#8)
* added ISL playground on railway app * improved docs and styles * added Run in Playground button
1 parent 40030d6 commit 14dc5ae

File tree

78 files changed

+8021
-5
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+8021
-5
lines changed

.dockerignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Git
2+
.git
3+
.gitignore
4+
.github
5+
6+
# IDE
7+
.idea
8+
.vscode
9+
*.iml
10+
*.swp
11+
*.swo
12+
13+
# Build artifacts (we'll rebuild inside Docker)
14+
**/build/
15+
**/dist/
16+
**/node_modules/
17+
**/target/
18+
19+
# Keep only what's needed for playground
20+
!playground/
21+
22+
# Documentation (not needed for runtime)
23+
docs/
24+
*.md
25+
!playground/**/*.md
26+
27+
# Test files
28+
**/test/
29+
**/*test*/
30+
**/*.test.*
31+
32+
# CI/CD
33+
.github/
34+
codecov.yml
35+
36+
# Other modules (not needed for playground)
37+
isl-cmd/
38+
isl-validation/
39+
plugin/
40+
41+
# Keep isl-transform as it's needed
42+
!isl-transform/
43+
44+
# Gradle cache
45+
.gradle/
46+
**/build/
47+
48+
# Logs
49+
*.log
50+
51+
# OS
52+
.DS_Store
53+
Thumbs.db
54+
55+
# Frontend dev files
56+
playground/frontend/.env
57+
playground/frontend/.env.*
58+
playground/frontend/coverage/
59+
60+
# Backend dev files
61+
playground/backend/.env
62+
playground/backend/logs/
63+

Dockerfile

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Build stage
2+
FROM eclipse-temurin:21-jdk AS build
3+
4+
# Install Node.js for frontend build
5+
RUN apt-get update && \
6+
apt-get install -y curl && \
7+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
8+
apt-get install -y nodejs && \
9+
rm -rf /var/lib/apt/lists/*
10+
11+
WORKDIR /app
12+
13+
# Copy the playground directory
14+
COPY playground playground
15+
16+
# Copy gradle wrapper and build files from root
17+
COPY gradlew .
18+
COPY gradlew.bat .
19+
COPY gradle gradle
20+
COPY settings.gradle.kts .
21+
COPY build.gradle.kts .
22+
COPY gradle.properties .
23+
24+
# Copy ISL transform library (needed for backend build)
25+
COPY isl-transform isl-transform
26+
27+
# Build frontend
28+
WORKDIR /app/playground/frontend
29+
RUN if [ -f "package.json" ]; then \
30+
echo "Building frontend..."; \
31+
npm install && npm run build && \
32+
mkdir -p ../backend/src/main/resources/static && \
33+
cp -r dist/* ../backend/src/main/resources/static/ && \
34+
echo "Frontend built successfully"; \
35+
else \
36+
echo "No frontend package.json found, skipping frontend build"; \
37+
fi
38+
39+
# Build backend
40+
WORKDIR /app/playground/backend
41+
RUN chmod +x ../../gradlew && ../../gradlew clean build -x test --no-daemon
42+
43+
# Runtime stage - Use Java 21 JRE
44+
FROM eclipse-temurin:21-jre
45+
46+
WORKDIR /app
47+
48+
# Copy the built JAR
49+
COPY --from=build /app/playground/backend/build/libs/isl-playground-1.0.0.jar /app/app.jar
50+
51+
# Expose port
52+
EXPOSE 8080
53+
54+
# Run with Java 21
55+
CMD ["java", "-jar", "/app/app.jar"]
56+

docs/_data/navigation.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ docs:
8888
url: /dev/release
8989
- title: "Contributing"
9090
url: /dev/contributing
91+
- title: "Playground Integration"
92+
url: /dev/playground-integration
9193

9294
- title: More
9395
children:

docs/_includes/footer/custom.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/components/prism-yaml.min.js"></script>
1111
<!-- Load custom ISL language definition -->
1212
<script src="{{ '/assets/js/prism-isl.js' | relative_url }}"></script>
13+
<!-- Load copy code button script -->
14+
<script src="{{ '/assets/js/copy-code-button.js' | relative_url }}"></script>
15+
<!-- Load playground auto-buttons script -->
16+
<script src="{{ '/assets/js/playground-auto-buttons.js' | relative_url }}"></script>
1317

1418
<!-- Load Lunr.js library if not already loaded by theme -->
1519
<script>

docs/_includes/head/custom.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
<meta property="og:image:width" content="600" />
2626
<meta property="og:image:height" content="315" />
2727

28+
<!-- Favicon -->
29+
<link rel="icon" type="image/svg+xml" href="{{ '/img/favicon.svg' | relative_url }}" />
30+
<link rel="alternate icon" href="{{ '/img/isl_small.png' | relative_url }}" />
31+
<link rel="apple-touch-icon" href="{{ '/img/isl_small.png' | relative_url }}" />
32+
2833
<!-- Prism.js for syntax highlighting with VS Code Dark+ theme -->
2934
<link rel="stylesheet" href="https://unpkg.com/prism-themes/themes/prism-vsc-dark-plus.css" />
3035

docs/assets/css/main.scss

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,39 @@ span.comment::after {
6868
display: inline !important;
6969
margin: 0 !important;
7070
padding: 0 !important;
71+
text-decoration: none !important; /* Remove underline from comments */
72+
border-bottom: 0;
73+
}
74+
75+
/* Remove underline from all comment-related classes */
76+
.token.comment,
77+
.token.prolog,
78+
.token.doctype,
79+
.token.cdata,
80+
code .c,
81+
code .c1,
82+
code .cm,
83+
span.comment {
84+
text-decoration: none !important;
85+
border-bottom: 0;
7186
}
7287

7388
/* Ensure ISL syntax highlighting looks clean */
7489
code[class*="language-"],
7590
pre[class*="language-"] {
7691
.token.comment {
7792
line-height: inherit;
93+
text-decoration: none !important;
94+
border-bottom: 0;
7895
}
7996
}
8097

98+
/* Override Prism colors - change from #db4c69 to #9cdcfe */
99+
code.highlighter-rouge.languange-plaintext,
100+
body :not(pre) > code[class*="language-"] {
101+
color: #9cdcfe !important;
102+
}
103+
81104
/* Increase main content area width */
82105
#main {
83106
@include breakpoint($large) {
@@ -131,3 +154,100 @@ pre[class*="language-"] {
131154
}
132155

133156

157+
/* Playground Button Styles - Overlay on code blocks */
158+
.btn-playground {
159+
position: absolute;
160+
top: 8px;
161+
right: 8px;
162+
z-index: 10;
163+
display: inline-block;
164+
padding: 6px 12px;
165+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
166+
color: white !important;
167+
text-decoration: none !important;
168+
border-radius: 4px;
169+
font-weight: 600;
170+
font-size: 1em;
171+
transition: all 0.2s ease;
172+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
173+
border: none;
174+
cursor: pointer;
175+
opacity: 0.9;
176+
177+
&:hover {
178+
opacity: 1;
179+
transform: translateY(-1px);
180+
box-shadow: 0 4px 10px rgba(102, 126, 234, 0.5);
181+
text-decoration: none !important;
182+
}
183+
184+
&:active {
185+
transform: translateY(0);
186+
}
187+
}
188+
189+
/* Copy Button Styles - Overlay on code blocks */
190+
.btn-copy {
191+
position: absolute;
192+
bottom: 10px;
193+
right: 8px;
194+
z-index: 10;
195+
display: inline-block;
196+
padding: 4px 10px;
197+
background: #3c3c3c;
198+
color: #cccccc !important;
199+
text-decoration: none !important;
200+
border-radius: 4px;
201+
font-weight: 600;
202+
font-size: 0.75em;
203+
transition: all 0.2s ease;
204+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
205+
border: 1px solid #555;
206+
cursor: pointer;
207+
opacity: 0.7;
208+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
209+
210+
&:hover {
211+
opacity: 1;
212+
background: #4c4c4c;
213+
border-color: #777;
214+
transform: translateY(-1px);
215+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
216+
}
217+
218+
&:active {
219+
transform: translateY(0);
220+
}
221+
222+
&.copied {
223+
background: #22c55e;
224+
border-color: #22c55e;
225+
color: white !important;
226+
}
227+
228+
&.error {
229+
background: #ef4444;
230+
border-color: #ef4444;
231+
color: white !important;
232+
}
233+
}
234+
235+
/* Ensure pre blocks have relative positioning for absolute button */
236+
pre {
237+
position: relative;
238+
239+
/* Add padding to top-right to prevent code from hiding behind button */
240+
&:has(.btn-playground) {
241+
padding-top: 2.5em !important;
242+
}
243+
244+
&:has(.btn-copy):not(:has(.btn-playground)) {
245+
padding-top: 2.5em !important;
246+
}
247+
}
248+
249+
/* Remove old container styles - no longer needed */
250+
.playground-button-container {
251+
display: none;
252+
}
253+

0 commit comments

Comments
 (0)