karma-lang 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -0
- package/TAGS_GUIDE.md +601 -0
- package/about.karma +4 -0
- package/components/card.karma +6 -0
- package/home.karma +5 -0
- package/karma-ai.js +454 -0
- package/karma-cli.js +41 -0
- package/karma-compiler.js +721 -0
- package/karma-runtime.js +44 -0
- package/karma-v1.0.0.zip +0 -0
- package/karma-validator.js +470 -0
- package/package.json +8 -0
- package/test.karma +4 -0
package/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
Karma v1.0.0
|
|
2
|
+
Simple by default. Powerful only when needed.
|
|
3
|
+
The core stays boring. Advanced features are optional and opt-in.
|
|
4
|
+
|
|
5
|
+
What Is Karma:
|
|
6
|
+
|
|
7
|
+
Karma is a small, readable language and toolset for building simple, stable, page-based websites without heavy frameworks, endless configuration, or boilerplate fatigue.
|
|
8
|
+
It’s for developers who want to ship a clean page, understand it later, and move on.
|
|
9
|
+
No hype. No magic. Just calm, predictable tools.
|
|
10
|
+
|
|
11
|
+
Why Karma Exists:
|
|
12
|
+
|
|
13
|
+
Modern web tooling often adds complexity faster than it adds value.
|
|
14
|
+
Karma takes the opposite approach.
|
|
15
|
+
Karma exists to:
|
|
16
|
+
Reduce mental load during development
|
|
17
|
+
Prioritize readability over clever abstractions
|
|
18
|
+
Remove repetition and unnecessary boilerplate
|
|
19
|
+
Stay predictable and file-based
|
|
20
|
+
Remain beginner-friendly without blocking growth
|
|
21
|
+
The goal is not power at all costs.
|
|
22
|
+
The goal is clarity first.
|
|
23
|
+
|
|
24
|
+
What Karma Is (v1.0.0):
|
|
25
|
+
|
|
26
|
+
A stable core for building page-based websites
|
|
27
|
+
File-based and predictable
|
|
28
|
+
Opinionated by design
|
|
29
|
+
Calm, boring, and intentional
|
|
30
|
+
|
|
31
|
+
What Karma Is Not:
|
|
32
|
+
A plugin marketplace
|
|
33
|
+
A heavy framework
|
|
34
|
+
A dashboard-driven system
|
|
35
|
+
An “everything at once” platform
|
|
36
|
+
Those things may come later — only if explicitly enabled.
|
|
37
|
+
|
|
38
|
+
Who Karma Is For:
|
|
39
|
+
|
|
40
|
+
Developers who want simple websites without constant setup
|
|
41
|
+
People who value clear, readable code
|
|
42
|
+
Beginners who don’t want to be punished by their tools
|
|
43
|
+
Builders who prefer fewer decisions and fewer dependencies
|
|
44
|
+
|
|
45
|
+
Who Karma Is Not For:
|
|
46
|
+
Complex web applications
|
|
47
|
+
Feature-heavy dashboards
|
|
48
|
+
Plugin-driven ecosystems
|
|
49
|
+
|
|
50
|
+
Installation:
|
|
51
|
+
|
|
52
|
+
Karma runs locally using Node.js and compiles .karma files into usable output.
|
|
53
|
+
|
|
54
|
+
1. Clone the repository
|
|
55
|
+
Copy code
|
|
56
|
+
Bash
|
|
57
|
+
git clone https://github.com/Mrs-bonds/karma-lang.git
|
|
58
|
+
cd karma-lang
|
|
59
|
+
|
|
60
|
+
2. Install dependencies
|
|
61
|
+
Copy code
|
|
62
|
+
Bash
|
|
63
|
+
npm install
|
|
64
|
+
Usage
|
|
65
|
+
Compile a .karma file
|
|
66
|
+
Copy code
|
|
67
|
+
Bash
|
|
68
|
+
node karma-compiler.js path/to/file.karma
|
|
69
|
+
Compiled output is written to the configured destination.
|
|
70
|
+
Run the runtime
|
|
71
|
+
Copy code
|
|
72
|
+
Bash
|
|
73
|
+
node karma-runtime.js
|
|
74
|
+
Sample Files
|
|
75
|
+
|
|
76
|
+
test.karma — demonstrates basic logic handling
|
|
77
|
+
home.karma — example of a simple webpage
|
|
78
|
+
|
|
79
|
+
Roadmap Philosophy
|
|
80
|
+
Karma follows one rule:
|
|
81
|
+
Start simple. Add power only when needed.
|
|
82
|
+
The core will remain stable.
|
|
83
|
+
Advanced features will always be optional and opt-in.
|
package/TAGS_GUIDE.md
ADDED
|
@@ -0,0 +1,601 @@
|
|
|
1
|
+
````markdown
|
|
2
|
+
# Karma Tags Guide
|
|
3
|
+
|
|
4
|
+
Complete reference for all available Karma tags. Each tag compiles to semantic HTML with built-in styling.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Core Tags
|
|
9
|
+
|
|
10
|
+
### PAGE
|
|
11
|
+
Container for all page content. Required on every `.karma` file.
|
|
12
|
+
|
|
13
|
+
```karma
|
|
14
|
+
<PAGE TITLE="My Page" LAYOUT="main" BRAND="Company" TAGLINE="Tagline here">
|
|
15
|
+
<!-- Your content goes here -->
|
|
16
|
+
</PAGE>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Attributes:**
|
|
20
|
+
- `TITLE` (required) — Page title shown in browser tab
|
|
21
|
+
- `LAYOUT` (optional) — Layout template name (requires `--pro` flag)
|
|
22
|
+
- Any custom attributes become available to layouts as `{{ATTRIBUTE_NAME}}`
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Typography
|
|
27
|
+
|
|
28
|
+
### HEADING
|
|
29
|
+
Semantic headings with automatic sizing.
|
|
30
|
+
|
|
31
|
+
```karma
|
|
32
|
+
<HEADING TEXT="My Title" LEVEL="1" />
|
|
33
|
+
<HEADING TEXT="Subtitle" LEVEL="2" SIZE="large" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**Attributes:**
|
|
37
|
+
- `TEXT` — Heading content
|
|
38
|
+
- `LEVEL` — 1-6 (default: 2)
|
|
39
|
+
- `SIZE` — Optional: `large` for extra emphasis
|
|
40
|
+
|
|
41
|
+
**Example Output:**
|
|
42
|
+
```html
|
|
43
|
+
<h1 class="k-heading k-heading-1">My Title</h1>
|
|
44
|
+
<h2 class="k-heading k-heading-2 k-heading-large">Subtitle</h2>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
### PARA
|
|
50
|
+
Paragraph text block.
|
|
51
|
+
|
|
52
|
+
```karma
|
|
53
|
+
<PARA TEXT="This is a paragraph of text." />
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Attributes:**
|
|
57
|
+
- `TEXT` — Paragraph content
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Layout & Containers
|
|
62
|
+
|
|
63
|
+
### SECTION
|
|
64
|
+
Flexible container for grouping content.
|
|
65
|
+
|
|
66
|
+
```karma
|
|
67
|
+
<SECTION TITLE="Section Title" BG="dark" PADDING="20px">
|
|
68
|
+
<PARA TEXT="Content inside section" />
|
|
69
|
+
</SECTION>
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Attributes:**
|
|
73
|
+
- `TITLE` — Optional section heading
|
|
74
|
+
- `BG` — Background: `default`, `dark`, or `light` (default: default)
|
|
75
|
+
- `PADDING` — CSS padding value (default: 16px)
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
### GRID
|
|
80
|
+
Multi-column layout system. Automatically responsive.
|
|
81
|
+
|
|
82
|
+
```karma
|
|
83
|
+
<GRID COLS="3" GAP="20px">
|
|
84
|
+
<Card title="Card 1">Content</Card>
|
|
85
|
+
<Card title="Card 2">Content</Card>
|
|
86
|
+
<Card title="Card 3">Content</Card>
|
|
87
|
+
</GRID>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Attributes:**
|
|
91
|
+
- `COLS` — Number of columns: 1-4 (default: 2)
|
|
92
|
+
- `GAP` — Space between items in CSS units (default: 14px)
|
|
93
|
+
|
|
94
|
+
**Responsive Behavior:**
|
|
95
|
+
- 3-4 columns → 2 columns on tablets (max-width: 768px)
|
|
96
|
+
- All columns → 1 column on mobile (max-width: 520px)
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Information & Messaging
|
|
101
|
+
|
|
102
|
+
### BADGE
|
|
103
|
+
Small label or tag for categorization.
|
|
104
|
+
|
|
105
|
+
```karma
|
|
106
|
+
<BADGE TEXT="New" TYPE="success" />
|
|
107
|
+
<BADGE TEXT="Alert" TYPE="warning" />
|
|
108
|
+
<BADGE TEXT="Error" TYPE="error" />
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Attributes:**
|
|
112
|
+
- `TEXT` — Badge text
|
|
113
|
+
- `TYPE` — `default`, `success`, `warning`, or `error` (default: default)
|
|
114
|
+
|
|
115
|
+
**Usage Example:**
|
|
116
|
+
```karma
|
|
117
|
+
<HEADING TEXT="Product Features" />
|
|
118
|
+
<BADGE TEXT="v2.0" /> <BADGE TEXT="New" TYPE="success" />
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
### TAGS
|
|
124
|
+
Display multiple tags in a row.
|
|
125
|
+
|
|
126
|
+
```karma
|
|
127
|
+
<TAGS LIST="react, javascript, web, frontend" />
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Attributes:**
|
|
131
|
+
- `LIST` — Comma-separated tags
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### ALERT
|
|
136
|
+
Highlighted callout message with icon and type.
|
|
137
|
+
|
|
138
|
+
```karma
|
|
139
|
+
<ALERT TEXT="Success! Your form was submitted." TYPE="success" />
|
|
140
|
+
<ALERT TEXT="Warning: This action cannot be undone." TYPE="warning" />
|
|
141
|
+
<ALERT TEXT="Error occurred. Please try again." TYPE="error" />
|
|
142
|
+
<ALERT TEXT="FYI: Here's some useful information." TYPE="info" />
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
**Attributes:**
|
|
146
|
+
- `TEXT` — Alert message
|
|
147
|
+
- `TYPE` — `info`, `success`, `warning`, or `error` (default: info)
|
|
148
|
+
|
|
149
|
+
**Icons:**
|
|
150
|
+
- info: ℹ️
|
|
151
|
+
- success: ✅
|
|
152
|
+
- warning: ⚠️
|
|
153
|
+
- error: ❌
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## Media & Rich Content
|
|
158
|
+
|
|
159
|
+
### IMAGE
|
|
160
|
+
Image display with multiple variants.
|
|
161
|
+
|
|
162
|
+
```karma
|
|
163
|
+
<IMAGE SRC="photo.jpg" ALT="Description" TITLE="Photo" CAPTION="Optional caption" />
|
|
164
|
+
<IMAGE SRC="photo.jpg" VARIANT="split" POSITION="right" />
|
|
165
|
+
<IMAGE SRC="hero.jpg" VARIANT="hero" />
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Attributes:**
|
|
169
|
+
- `SRC` — Image URL
|
|
170
|
+
- `ALT` — Alt text for accessibility
|
|
171
|
+
- `TITLE` — Optional heading above image
|
|
172
|
+
- `CAPTION` — Caption below image
|
|
173
|
+
- `VARIANT` — `card` (default), `split`, or `hero`
|
|
174
|
+
- `POSITION` — `left` or `right` (for split variant)
|
|
175
|
+
- `LINK` — Optional URL to open on click
|
|
176
|
+
|
|
177
|
+
**Variants:**
|
|
178
|
+
- `card` — Boxed image with border
|
|
179
|
+
- `split` — Side-by-side image and text layout
|
|
180
|
+
- `hero` — Full-width image with dark overlay
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### VIDEO
|
|
185
|
+
Embed videos from file or URL.
|
|
186
|
+
|
|
187
|
+
```karma
|
|
188
|
+
<VIDEO SRC="video.mp4" TITLE="My Video" />
|
|
189
|
+
<VIDEO URL="https://youtube.com/embed/..." TITLE="YouTube Video" />
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Attributes:**
|
|
193
|
+
- `SRC` — Path to local video file
|
|
194
|
+
- `URL` — Embed URL (e.g., YouTube iframe URL)
|
|
195
|
+
- `TITLE` — Video heading
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### CODE
|
|
200
|
+
Display code snippets with syntax highlighting support.
|
|
201
|
+
|
|
202
|
+
```karma
|
|
203
|
+
<CODE TEXT="console.log('Hello');" LANG="javascript" TITLE="Example" />
|
|
204
|
+
<CODE TEXT="npm install karma-lang" LANG="bash" />
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Attributes:**
|
|
208
|
+
- `TEXT` — Code content
|
|
209
|
+
- `LANG` — Language: `javascript`, `bash`, `html`, etc. (default: plaintext)
|
|
210
|
+
- `TITLE` — Optional code block heading
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
### QUOTE
|
|
215
|
+
Blockquote with author and role.
|
|
216
|
+
|
|
217
|
+
```karma
|
|
218
|
+
<QUOTE TEXT="The best way to predict the future is to invent it." AUTHOR="Alan Kay" ROLE="Computer Scientist" />
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
**Attributes:**
|
|
222
|
+
- `TEXT` — Quote text
|
|
223
|
+
- `AUTHOR` — Who said it
|
|
224
|
+
- `ROLE` — Author's title/role
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Navigation & Links
|
|
229
|
+
|
|
230
|
+
### NAV
|
|
231
|
+
Navigation menu with link items.
|
|
232
|
+
|
|
233
|
+
```karma
|
|
234
|
+
<NAV LINKS="Home:home.karma, About:about.karma, Contact:contact.karma" TITLE="Menu" />
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Attributes:**
|
|
238
|
+
- `LINKS` — Comma-separated pairs: `Label:URL`
|
|
239
|
+
- `TITLE` — Optional menu heading
|
|
240
|
+
- `TYPE` — Menu style: `bar` (default)
|
|
241
|
+
- `POSITION` — `top` (default)
|
|
242
|
+
|
|
243
|
+
**Format:**
|
|
244
|
+
```
|
|
245
|
+
LINKS="Home:home.karma, About:about.karma, Blog:https://example.com"
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
### LINK
|
|
251
|
+
Individual button/link element.
|
|
252
|
+
|
|
253
|
+
```karma
|
|
254
|
+
<LINK TEXT="Click Me" HREF="page.karma" VARIANT="primary" />
|
|
255
|
+
<LINK TEXT="Secondary" HREF="#" VARIANT="secondary" />
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Attributes:**
|
|
259
|
+
- `TEXT` — Link text
|
|
260
|
+
- `HREF` — URL (`.karma` files auto-convert to `.html`)
|
|
261
|
+
- `VARIANT` — `primary` (default) or `secondary`
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
### EMAIL
|
|
266
|
+
Email link.
|
|
267
|
+
|
|
268
|
+
```karma
|
|
269
|
+
<EMAIL TO="hello@example.com" TEXT="Send Email" SUBJECT="Hello" BODY="Message body" />
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
**Attributes:**
|
|
273
|
+
- `TO` — Email address
|
|
274
|
+
- `TEXT` — Link text (default: "Email")
|
|
275
|
+
- `SUBJECT` — Pre-filled subject line
|
|
276
|
+
- `BODY` — Pre-filled message body
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
### PHONE
|
|
281
|
+
Phone link (tel: protocol).
|
|
282
|
+
|
|
283
|
+
```karma
|
|
284
|
+
<PHONE NUMBER="+1 206 555 0123" TEXT="Call Us" />
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Attributes:**
|
|
288
|
+
- `NUMBER` — Phone number
|
|
289
|
+
- `TEXT` — Link text (default: "Call")
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## Forms & Data
|
|
294
|
+
|
|
295
|
+
### FORM
|
|
296
|
+
Auto-generated form with fields.
|
|
297
|
+
|
|
298
|
+
```karma
|
|
299
|
+
<FORM TITLE="Contact Us" FIELDS="name, email, message" SUBMIT="Send" />
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Attributes:**
|
|
303
|
+
- `TITLE` — Form heading
|
|
304
|
+
- `FIELDS` — Comma-separated field names
|
|
305
|
+
- `SUBMIT` — Submit button text
|
|
306
|
+
|
|
307
|
+
**Special Field Names:**
|
|
308
|
+
- `message` or `notes` → renders as `<textarea>`
|
|
309
|
+
- All others → `<input type="text">`
|
|
310
|
+
|
|
311
|
+
**Note:** This is a placeholder form. Connect it to a backend with custom JavaScript in your layout.
|
|
312
|
+
|
|
313
|
+
---
|
|
314
|
+
|
|
315
|
+
### TABLE
|
|
316
|
+
Data table with customizable rows/columns.
|
|
317
|
+
|
|
318
|
+
```karma
|
|
319
|
+
<TABLE TITLE="Sales Data" COLS="4" ROWS="5" />
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**Attributes:**
|
|
323
|
+
- `TITLE` — Table heading
|
|
324
|
+
- `COLS` — Number of columns (2-6, default: 3)
|
|
325
|
+
- `ROWS` — Number of rows (2-10, default: 2)
|
|
326
|
+
|
|
327
|
+
---
|
|
328
|
+
|
|
329
|
+
## Interactive Elements
|
|
330
|
+
|
|
331
|
+
### COLLAPSE
|
|
332
|
+
Expandable/collapsible section.
|
|
333
|
+
|
|
334
|
+
```karma
|
|
335
|
+
<COLLAPSE TITLE="Click to expand" OPEN="false">
|
|
336
|
+
<PARA TEXT="Hidden content that expands on click" />
|
|
337
|
+
</COLLAPSE>
|
|
338
|
+
|
|
339
|
+
<COLLAPSE TITLE="Already open" OPEN="true">
|
|
340
|
+
<PARA TEXT="This section starts expanded" />
|
|
341
|
+
</COLLAPSE>
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
**Attributes:**
|
|
345
|
+
- `TITLE` — Section heading
|
|
346
|
+
- `OPEN` — `true` or `false` (default: false)
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Dashboard & Stats
|
|
351
|
+
|
|
352
|
+
### STAT
|
|
353
|
+
Dashboard statistic box.
|
|
354
|
+
|
|
355
|
+
```karma
|
|
356
|
+
<STAT VALUE="1,234" LABEL="Total Users" ICON="👥" />
|
|
357
|
+
<STAT VALUE="98%" LABEL="Uptime" ICON="✅" />
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
**Attributes:**
|
|
361
|
+
- `VALUE` — The statistic value
|
|
362
|
+
- `LABEL` — What it represents
|
|
363
|
+
- `ICON` — Emoji or symbol
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
### PROGRESS
|
|
368
|
+
Progress bar with value.
|
|
369
|
+
|
|
370
|
+
```karma
|
|
371
|
+
<PROGRESS VALUE="75" LABEL="75% Complete" COLOR="blue" />
|
|
372
|
+
<PROGRESS VALUE="100" LABEL="Done" COLOR="green" />
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
**Attributes:**
|
|
376
|
+
- `VALUE` — 0-100 (default: 50)
|
|
377
|
+
- `LABEL` — Text to display (default: percentage)
|
|
378
|
+
- `COLOR` — `blue` (default), `green`, or `red`
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
## Timeline
|
|
383
|
+
|
|
384
|
+
### TIMELINE
|
|
385
|
+
Container for chronological events.
|
|
386
|
+
|
|
387
|
+
```karma
|
|
388
|
+
<TIMELINE TITLE="Project History">
|
|
389
|
+
<TIMELINE-ITEM DATE="Jan 2024" TITLE="Started" TEXT="Project kickoff meeting" />
|
|
390
|
+
<TIMELINE-ITEM DATE="Mar 2024" TITLE="Beta Launch" TEXT="Released beta version" />
|
|
391
|
+
<TIMELINE-ITEM DATE="Jun 2024" TITLE="v1.0 Live" TEXT="Official release" />
|
|
392
|
+
</TIMELINE>
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
---
|
|
396
|
+
|
|
397
|
+
### TIMELINE-ITEM
|
|
398
|
+
Individual timeline entry.
|
|
399
|
+
|
|
400
|
+
```karma
|
|
401
|
+
<TIMELINE-ITEM DATE="December 2024" TITLE="Milestone Reached" TEXT="Shipped new features to production" />
|
|
402
|
+
```
|
|
403
|
+
|
|
404
|
+
**Attributes:**
|
|
405
|
+
- `DATE` — Date or time period
|
|
406
|
+
- `TITLE` — Event name
|
|
407
|
+
- `TEXT` — Event description
|
|
408
|
+
|
|
409
|
+
---
|
|
410
|
+
|
|
411
|
+
## Complete Example
|
|
412
|
+
|
|
413
|
+
```karma
|
|
414
|
+
import "components/card.karma"
|
|
415
|
+
|
|
416
|
+
<PAGE TITLE="Product Dashboard" BRAND="MyApp" TAGLINE="Analytics & Insights">
|
|
417
|
+
<HEADING TEXT="Dashboard Overview" LEVEL="1" />
|
|
418
|
+
|
|
419
|
+
<GRID COLS="3">
|
|
420
|
+
<STAT VALUE="12,434" LABEL="Active Users" ICON="👥" />
|
|
421
|
+
<STAT VALUE="$45,231" LABEL="Revenue" ICON="💰" />
|
|
422
|
+
<STAT VALUE="98%" LABEL="Uptime" ICON="✅" />
|
|
423
|
+
</GRID>
|
|
424
|
+
|
|
425
|
+
<SECTION TITLE="Recent Activity" BG="dark">
|
|
426
|
+
<ALERT TEXT="Server maintenance scheduled for Sunday 2am" TYPE="warning" />
|
|
427
|
+
|
|
428
|
+
<TIMELINE TITLE="Updates">
|
|
429
|
+
<TIMELINE-ITEM DATE="Today" TITLE="New Feature" TEXT="Dark mode support added" />
|
|
430
|
+
<TIMELINE-ITEM DATE="Yesterday" TITLE="Bug Fix" TEXT="Fixed login issue" />
|
|
431
|
+
</TIMELINE>
|
|
432
|
+
</SECTION>
|
|
433
|
+
|
|
434
|
+
<SECTION TITLE="Resources">
|
|
435
|
+
<TAGS LIST="documentation, tutorials, api, community" />
|
|
436
|
+
|
|
437
|
+
<GRID COLS="2">
|
|
438
|
+
<Card title="Getting Started">
|
|
439
|
+
<PARA TEXT="New? Start here with our guide." />
|
|
440
|
+
<LINK TEXT="Learn More" HREF="docs.karma" />
|
|
441
|
+
</Card>
|
|
442
|
+
|
|
443
|
+
<Card title="API Reference">
|
|
444
|
+
<PARA TEXT="Complete API documentation." />
|
|
445
|
+
<LINK TEXT="View Docs" HREF="api.karma" />
|
|
446
|
+
</Card>
|
|
447
|
+
</GRID>
|
|
448
|
+
</SECTION>
|
|
449
|
+
|
|
450
|
+
<SECTION TITLE="Code Example">
|
|
451
|
+
<CODE TEXT="const karma = require('karma-lang');" LANG="javascript" TITLE="Installation" />
|
|
452
|
+
</SECTION>
|
|
453
|
+
|
|
454
|
+
<QUOTE TEXT="Simple tools lead to better code." AUTHOR="You" ROLE="Developer" />
|
|
455
|
+
</PAGE>
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
---
|
|
459
|
+
|
|
460
|
+
## Styling & Customization
|
|
461
|
+
|
|
462
|
+
All Karma tags use CSS classes that you can override in custom layouts:
|
|
463
|
+
|
|
464
|
+
```html
|
|
465
|
+
<!-- layouts/main.html -->
|
|
466
|
+
<!doctype html>
|
|
467
|
+
<html>
|
|
468
|
+
<head>
|
|
469
|
+
{{style}}
|
|
470
|
+
<style>
|
|
471
|
+
/* Override default colors */
|
|
472
|
+
:root {
|
|
473
|
+
--k-bg: #1a1a1a;
|
|
474
|
+
--k-card: #2d2d2d;
|
|
475
|
+
--k-border: #444;
|
|
476
|
+
--k-text: #f0f0f0;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
/* Custom button styling */
|
|
480
|
+
.k-btn {
|
|
481
|
+
border-radius: 24px;
|
|
482
|
+
font-size: 1.1rem;
|
|
483
|
+
}
|
|
484
|
+
</style>
|
|
485
|
+
</head>
|
|
486
|
+
<body>
|
|
487
|
+
{{content}}
|
|
488
|
+
</body>
|
|
489
|
+
</html>
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
---
|
|
493
|
+
|
|
494
|
+
## Tag Availability
|
|
495
|
+
|
|
496
|
+
| Tag | Version | Status |
|
|
497
|
+
|-----|---------|--------|
|
|
498
|
+
| PAGE | 1.0 | Core |
|
|
499
|
+
| HEADING | 1.7 | New |
|
|
500
|
+
| PARA | 1.0 | Core |
|
|
501
|
+
| IMAGE | 1.0 | Core |
|
|
502
|
+
| VIDEO | 1.0 | Core |
|
|
503
|
+
| LINK | 1.0 | Core |
|
|
504
|
+
| NAV | 1.0 | Core |
|
|
505
|
+
| TABLE | 1.0 | Core |
|
|
506
|
+
| FORM | 1.0 | Core |
|
|
507
|
+
| EMAIL | 1.0 | Core |
|
|
508
|
+
| PHONE | 1.0 | Core |
|
|
509
|
+
| SECTION | 1.7 | New |
|
|
510
|
+
| GRID | 1.7 | New |
|
|
511
|
+
| BADGE | 1.7 | New |
|
|
512
|
+
| TAGS | 1.7 | New |
|
|
513
|
+
| ALERT | 1.7 | New |
|
|
514
|
+
| CODE | 1.7 | New |
|
|
515
|
+
| COLLAPSE | 1.7 | New |
|
|
516
|
+
| TIMELINE | 1.7 | New |
|
|
517
|
+
| TIMELINE-ITEM | 1.7 | New |
|
|
518
|
+
| STAT | 1.7 | New |
|
|
519
|
+
| QUOTE | 1.7 | New |
|
|
520
|
+
| PROGRESS | 1.7 | New |
|
|
521
|
+
|
|
522
|
+
---
|
|
523
|
+
|
|
524
|
+
## Component Library
|
|
525
|
+
|
|
526
|
+
Create reusable components:
|
|
527
|
+
|
|
528
|
+
```karma
|
|
529
|
+
// components/features.karma
|
|
530
|
+
component Feature(icon, title) {
|
|
531
|
+
<div class="feature">
|
|
532
|
+
<div class="feature-icon">{{icon}}</div>
|
|
533
|
+
<h3>{{title}}</h3>
|
|
534
|
+
<slot/>
|
|
535
|
+
</div>
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
Use in your pages:
|
|
540
|
+
|
|
541
|
+
```karma
|
|
542
|
+
import "components/features.karma"
|
|
543
|
+
|
|
544
|
+
<PAGE TITLE="Features">
|
|
545
|
+
<GRID COLS="3">
|
|
546
|
+
<Feature icon="⚡" title="Fast">
|
|
547
|
+
<PARA TEXT="Lightning quick builds and deploys." />
|
|
548
|
+
</Feature>
|
|
549
|
+
|
|
550
|
+
<Feature icon="🔒" title="Secure">
|
|
551
|
+
<PARA TEXT="Production-ready security features." />
|
|
552
|
+
</Feature>
|
|
553
|
+
|
|
554
|
+
<Feature icon="📦" title="Simple">
|
|
555
|
+
<PARA TEXT="No complex configuration needed." />
|
|
556
|
+
</Feature>
|
|
557
|
+
</GRID>
|
|
558
|
+
</PAGE>
|
|
559
|
+
```
|
|
560
|
+
|
|
561
|
+
---
|
|
562
|
+
|
|
563
|
+
## Tips & Tricks
|
|
564
|
+
|
|
565
|
+
1. **Auto-linking**: `.karma` extensions automatically convert to `.html`
|
|
566
|
+
```karma
|
|
567
|
+
<LINK HREF="about.karma" /> <!-- becomes: about.html -->
|
|
568
|
+
```
|
|
569
|
+
|
|
570
|
+
2. **Nested Grids**: Create complex layouts
|
|
571
|
+
```karma
|
|
572
|
+
<GRID COLS="2">
|
|
573
|
+
<SECTION>
|
|
574
|
+
<GRID COLS="2">
|
|
575
|
+
<STAT VALUE="10" LABEL="A" />
|
|
576
|
+
<STAT VALUE="20" LABEL="B" />
|
|
577
|
+
</GRID>
|
|
578
|
+
</SECTION>
|
|
579
|
+
</GRID>
|
|
580
|
+
```
|
|
581
|
+
|
|
582
|
+
3. **Responsive Images**:
|
|
583
|
+
```karma
|
|
584
|
+
<IMAGE SRC="big.jpg" VARIANT="hero" /> <!-- Full width on mobile -->
|
|
585
|
+
<IMAGE SRC="pic.jpg" VARIANT="split" POSITION="right" /> <!-- Stacks on mobile -->
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
4. **Accessible Links**:
|
|
589
|
+
```karma
|
|
590
|
+
<EMAIL TO="help@example.com" TEXT="Get Help" />
|
|
591
|
+
<PHONE NUMBER="+1 555 0123" TEXT="Call Support" />
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
---
|
|
595
|
+
|
|
596
|
+
## Need Help?
|
|
597
|
+
|
|
598
|
+
- 📖 Read the [README](README.md)
|
|
599
|
+
- 🐛 Report issues on [GitHub](https://github.com/Mrs-bonds/karma-lang)
|
|
600
|
+
- 💬 Discussions & questions in [GitHub Discussions](https://github.com/Mrs-bonds/karma-lang/discussions)
|
|
601
|
+
````
|
package/about.karma
ADDED