Skip to content

Commit ac91a72

Browse files
authored
Merge pull request #4 from nullscript-lang/dev
Dev
2 parents 835aab3 + 597a87f commit ac91a72

21 files changed

Lines changed: 1038 additions & 860 deletions

.vitepress/components/NullScriptPlayground.vue

Lines changed: 0 additions & 614 deletions
This file was deleted.

.vitepress/components/playground.vue

Lines changed: 662 additions & 0 deletions
Large diffs are not rendered by default.

.vitepress/config.ts

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,53 @@ export default defineConfig({
55
description:
66
"A fun parody programming language that transpiles to JavaScript",
77
base: "/",
8+
appearance: true,
9+
srcDir: "src",
10+
assetsDir: "assets",
811
head: [
9-
["link", { rel: "icon", href: "/logo.png" }],
10-
["link", { rel: "apple-touch-icon", href: "/logo.png" }],
12+
["link", { rel: "icon", href: "/assets/logo.png" }],
13+
["link", { rel: "apple-touch-icon", href: "/assets/logo.png" }],
14+
// Open Graph / Facebook
15+
["meta", { property: "og:type", content: "website" }],
16+
[
17+
"meta",
18+
{
19+
property: "og:title",
20+
content: "NullScript - JavaScript with Attitude",
21+
},
22+
],
23+
[
24+
"meta",
25+
{
26+
property: "og:description",
27+
content:
28+
"A fun parody programming language that transpiles to JavaScript",
29+
},
30+
],
31+
["meta", { property: "og:image", content: "/assets/og-image.png" }],
32+
["meta", { property: "og:url", content: "https://nullscript.js.org" }],
33+
// Twitter
34+
["meta", { name: "twitter:card", content: "summary_large_image" }],
35+
[
36+
"meta",
37+
{
38+
name: "twitter:title",
39+
content: "NullScript - JavaScript with Attitude",
40+
},
41+
],
42+
[
43+
"meta",
44+
{
45+
name: "twitter:description",
46+
content:
47+
"A fun parody programming language that transpiles to JavaScript",
48+
},
49+
],
50+
["meta", { name: "twitter:image", content: "/assets/og-image.png" }],
1151
],
1252
themeConfig: {
1353
logo: {
14-
src: "/logo.png",
54+
src: "/assets/logo.png",
1555
alt: "NullScript Logo",
1656
style: {
1757
borderRadius: "10%",

.vitepress/theme/custom.css

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
:root {
2+
--vp-c-brand-1: #f7df1e;
3+
--vp-c-brand-2: #e6c800;
4+
--vp-button-brand-bg: #f7df1e;
5+
--vp-button-brand-hover-bg: #e6c800;
6+
--vp-button-brand-text: #000;
7+
--vp-button-brand-hover-text: #000;
8+
--vp-code-bg: #f7df1e;
9+
--vp-code-color: #000;
10+
}
11+
12+
.dark {
13+
--vp-c-neutral-1: #000;
14+
--vp-code-bg: #333;
15+
--vp-code-color: #f7df1e;
16+
}
17+
18+
/* Custom scrollbar */
19+
::-webkit-scrollbar {
20+
width: 6px;
21+
}
22+
23+
::-webkit-scrollbar-track {
24+
background: var(--vp-c-bg-soft);
25+
border-radius: 3px;
26+
}
27+
28+
::-webkit-scrollbar-thumb {
29+
background: var(--vp-c-brand);
30+
border-radius: 3px;
31+
transition: background 0.2s ease;
32+
}
33+
34+
::-webkit-scrollbar-thumb:hover {
35+
background: var(--vp-c-brand-light);
36+
}
37+
38+
/* Custom animations */
39+
@keyframes fadeInUp {
40+
from {
41+
opacity: 0;
42+
transform: translateY(20px);
43+
}
44+
to {
45+
opacity: 1;
46+
transform: translateY(0);
47+
}
48+
}
49+
50+
.VPHome .VPHomeHero .container .main {
51+
animation: fadeInUp 0.6s ease-out;
52+
}

.vitepress/theme/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import DefaultTheme from "vitepress/theme";
2-
import NullScriptPlayground from "../components/NullScriptPlayground.vue";
2+
import Playground from "../components/playground.vue";
3+
import "./custom.css";
34

45
export default {
56
...DefaultTheme,
67
enhanceApp({ app }) {
7-
app.component("NullScriptPlayground", NullScriptPlayground);
8+
app.component("Playground", Playground);
89
},
910
};

README.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ nullscript run hello.ns
4040
```
4141

4242
Output:
43+
4344
```
4445
Hello, World! Welcome to NullScript! 🎭
4546
```
@@ -50,19 +51,19 @@ Hello, World! Welcome to NullScript! 🎭
5051

5152
NullScript replaces traditional JavaScript keywords with more expressive alternatives:
5253

53-
| JavaScript | NullScript | Description |
54-
|------------|------------|-------------|
55-
| `function` | `run` | Define a function |
56-
| `const` | `fixed` | Constant variable |
57-
| `let` | `let` | Mutable variable |
58-
| `console.log` | `speak.say` | Print to console |
59-
| `console.error` | `speak.scream` | Print error |
60-
| `if` | `whatever` | Conditional statement |
61-
| `else` | `otherwise` | Else clause |
62-
| `true` | `yes` | Boolean true |
63-
| `false` | `no` | Boolean false |
64-
| `class` | `model` | Define a class |
65-
| `new` | `fresh` | Create instance |
54+
| JavaScript | NullScript | Description |
55+
| --------------- | -------------- | --------------------- |
56+
| `function` | `run` | Define a function |
57+
| `const` | `fixed` | Constant variable |
58+
| `let` | `let` | Mutable variable |
59+
| `console.log` | `speak.say` | Print to console |
60+
| `console.error` | `speak.scream` | Print error |
61+
| `if` | `whatever` | Conditional statement |
62+
| `else` | `otherwise` | Else clause |
63+
| `true` | `yes` | Boolean true |
64+
| `false` | `no` | Boolean false |
65+
| `class` | `model` | Define a class |
66+
| `new` | `fresh` | Create instance |
6667

6768
### Basic Syntax Examples
6869

@@ -226,6 +227,7 @@ speak.say(`Result: ${sum}`);
226227
### Module System
227228

228229
**math.ns**
230+
229231
```nullscript
230232
fixed PI = 3.14159;
231233
@@ -241,6 +243,7 @@ share { PI, calculateArea, calculateCircumference };
241243
```
242244

243245
**main.ns**
246+
244247
```nullscript
245248
use { calculateArea, calculateCircumference } from './math.ns';
246249
@@ -303,14 +306,14 @@ run later fetchAndFormatData() {
303306

304307
```javascript
305308
// Import compiled NullScript module
306-
import { greet, calculateSum } from './compiled/utils.js';
309+
import { greet, calculateSum } from "./compiled/utils.js";
307310

308311
// Use NullScript functions in JavaScript
309312
const message = greet("JavaScript Developer");
310313
const sum = calculateSum(10, 20);
311314

312315
console.log(message); // Output from NullScript function
313-
console.log(sum); // Output from NullScript function
316+
console.log(sum); // Output from NullScript function
314317
```
315318

316319
## 🎯 Why Choose NullScript?
@@ -334,11 +337,11 @@ console.log(sum); // Output from NullScript function
334337

335338
## 📚 Documentation
336339

337-
- **[Getting Started Guide](./guide/getting-started.md)** - Complete setup and first steps
338-
- **[Language Reference](./reference/keywords.md)** - Full keyword mapping and syntax
339-
- **[Examples](./examples/basic.md)** - More code examples and patterns
340-
- **[CLI Documentation](./cli/usage.md)** - Complete command-line interface guide
341-
- **[Interactive Playground](./playground.md)** - Try NullScript in your browser
340+
- **[Getting Started Guide](./src/guide/getting-started.md)** - Complete setup and first steps
341+
- **[Language Reference](./src/reference/keywords.md)** - Full keyword mapping and syntax
342+
- **[Examples](./src/examples/basic.md)** - More code examples and patterns
343+
- **[CLI Documentation](./src/cli/usage.md)** - Complete command-line interface guide
344+
- **[Interactive Playground](./src/playground.md)** - Try NullScript in your browser
342345

343346
## 🤝 Contributing
344347

@@ -366,4 +369,4 @@ NullScript embraces the joy of coding while maintaining the power and flexibilit
366369

367370
**Ready to add some attitude to your JavaScript?** 🚀
368371

369-
[Get Started](./guide/getting-started.md) | [Try the Playground](./playground.md) | [View Examples](./examples/basic.md)
372+
[Get Started](./src/guide/getting-started.md) | [Try the Playground](./src/playground.md) | [View Examples](./src/examples/basic.md)

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@
77
"dev": "vitepress dev",
88
"build": "vitepress build",
99
"preview": "vitepress preview",
10-
"clean": "rm -rf .vitepress/dist"
10+
"clean": "rm -rf .vitepress/dist",
11+
"format": "prettier --write \"**/*.{js,json,md,vue}\""
1112
},
1213
"dependencies": {
1314
"vitepress": "^1.0.0-rc.36",
1415
"vue": "^3.3.13"
1516
},
1617
"devDependencies": {
1718
"@types/node": "^20.10.6",
18-
"gh-pages": "^6.3.0"
19+
"gh-pages": "^6.3.0",
20+
"prettier": "^3.6.2"
1921
},
2022
"keywords": [
2123
"nullscript",
@@ -28,5 +30,5 @@
2830
"type": "git",
2931
"url": "https://github.com/nullscript-lang/nullscript-docs.git"
3032
},
31-
"homepage": "https://nullscript-lang.github.io/nullscript/"
33+
"homepage": "https://nullscript.js.org"
3234
}

0 commit comments

Comments
 (0)