N Language — VS Code Extension v2.6.0Build complete HTML + CSS + JS websites with a single N Language is a frontend DSL that compiles to production-ready HTML. Write clean, readable syntax once — get a full website out. Quick Start
Keyboard Shortcuts
N Language SyntaxEvery Basic Page Structure
Blocks Reference
|
| Shorthand | Expands To |
|---|---|
flex-center |
display:flex; align-items:center; justify-content:center |
flex-col |
display:flex; flex-direction:column |
flex-between |
display:flex; justify-content:space-between |
grid-2 |
display:grid; grid-template-columns:repeat(2,1fr) |
grid-3 |
display:grid; grid-template-columns:repeat(3,1fr) |
grid-4 |
display:grid; grid-template-columns:repeat(4,1fr) |
grid-auto |
Responsive auto-fit grid |
glass |
Glassmorphism effect |
card-shadow |
Soft card box shadow |
shadow-lg |
Large box shadow |
rounded |
border-radius:0.375rem |
rounded-full |
border-radius:9999px |
transition-all |
transition:all 0.3s ease |
gradient-purple |
Purple gradient background |
gradient-blue |
Blue gradient background |
truncate |
Single-line text truncation |
flex-center |
Centered flex container |
sticky-top |
Sticky positioned top |
container-center |
Centered max-width container |
w-full |
width:100% |
h-full |
height:100% |
min-h-screen |
min-height:100vh |
Hover / Focus States
button.hover.background-color = "#5b21b6"
button.hover.transform = "translateY(-2px)"
input.focus.border-color = "var(--primary)"
input.focus.outline = "none"
Scripts Logic Engine
State Management
scripts {
state = "isOpen = false, count = 0, user = null"
}
Event Handling
scripts {
when = "click #submit-btn => validateForm()"
when = "submit #contact-form => e.preventDefault(); sendEmail()"
when = "change #theme-select => applyTheme(this.value)"
}
Data Fetching
scripts {
fetch = "https://jsonplaceholder.typicode.com/posts => posts"
after = "renderPosts(posts)"
}
Timers
scripts {
repeat = "1000 => updateTimer()"
after = "startApp()"
}
Complete Example
head {
title = "My Portfolio"
description = "Developer portfolio built with N Language"
}
links {
font = "Inter"
fontawesome = true
}
style {
theme = black
}
// Navigation
nav {
display = "flex-between"
padding = "1.5rem 2rem"
background-color = "var(--bg-secondary)"
position = "sticky"
top = "0"
z-index = "100"
}
// Hero section
hero {
min-height = "100vh"
display = "flex-center"
flex-direction = "column"
text-align = "center"
padding = "4rem 2rem"
}
heading = "Hi, I'm a Developer"
heading.font-size = "clamp(2rem,5vw,4rem)"
heading.font-weight = "800"
heading.color = "var(--text)"
paragraph = "I build beautiful web experiences."
paragraph.font-size = "1.25rem"
paragraph.color = "var(--text-secondary)"
paragraph.margin-top = "1rem"
button = "View My Work"
button.background-color = "var(--primary)"
button.color = "white"
button.padding = "0.875rem 2rem"
button.border-radius = "var(--radius)"
button.border = "none"
button.cursor = "pointer"
button.margin-top = "2rem"
button.font-size = "1rem"
button.onclick-scroll = "projects"
// Projects section
section {
id = "projects"
padding = "5rem 2rem"
}
h2 = "Projects"
h2.text-align = "center"
h2.margin-bottom = "3rem"
grid {
display = "grid-3"
gap = "2rem"
max-width = "1200px"
margin = "0 auto"
}
// Interactive counter
scripts {
state = "count = 0"
when = "click #counter-btn => count++; document.getElementById('count-display').textContent = count"
}
button = "Count: 0"
button.id = "counter-btn"
button.background-color = "var(--primary)"
button.color = "white"
button.padding = "0.75rem 1.5rem"
button.border-radius = "var(--radius)"
button.border = "none"
button.cursor = "pointer"
span = "0"
span.id = "count-display"
Settings
Configure N Language in VS Code settings:
| Setting | Default | Description |
|---|---|---|
nlang.autoPreview |
true |
Auto-update preview on save |
nlang.outputDir |
"dist" |
Compiled HTML output directory |
nlang.openBrowserOnCompile |
false |
Open in browser after compile |
Snippets
Type these prefixes for quick templates:
| Prefix | Description |
|---|---|
npage |
New page scaffold |
npage-theme |
Page with full theme setup |
nhead |
Head metadata block |
nvars |
CSS variables block |
ntheme |
Apply a theme |
nlinks |
External resources block |
nh |
Heading element |
np |
Paragraph element |
nbtn |
Button element |
nlink |
Link element |
nimg |
Image element |
ninput |
Input field |
ntextarea |
Textarea |
nselect |
Select dropdown |
nform |
Form element |
ncontainer |
Container element |
nhero |
Hero section |
nnav |
Navigation bar |
nfooter |
Footer |
ncard |
Card element |
ngrid |
Grid layout |
nflex |
Flex layout |
nscripts |
Scripts block |
nstate |
State variable |
nwhen |
Event listener |
nafter |
DOM ready handler |
nfetch |
Data fetch |
nrepeat |
Interval timer |
nlog |
Console log |
nhover |
Hover state styles |
nmodal |
Modal dialog |
ncounter |
Interactive counter |
ntoast |
Toast notification |
ntestimonial |
Testimonial card |
npricing |
Pricing card |
nfeatures |
Features grid section |
ncta |
Call to action section |
nportfolio |
Full portfolio template |
nprogress |
Progress bar |
nbadge |
Badge/tag element |
nalert |
Alert box |
nspinner |
Loading spinner |
Website & Documentation
License
MIT © iamristaf