Syntax Highlighting Test
Python
def greet(name: str) -> str:
return f"Hello, {name}!"
numbers = [1, 2, 3, 4, 5]
squared = [x ** 2 for x in numbers]
print(squared)
JavaScript
const greet = (name) => {
return `Hello, ${name}!`;
};
const numbers = [1, 2, 3, 4, 5];
const squared = numbers.map(x => x ** 2);
console.log(squared);
HTML
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>테스트</title>
</head>
<body>
<h1 class="title">안녕하세요</h1>
<button onclick="alert('클릭!')">클릭</button>
</body>
</html>
CSS
.container {
display: flex;
justify-content: center;
background-color: #1f2937;
padding: 20px;
}
.title:hover {
color: #3b82f6;
transform: scale(1.1);
}
Bash
#!/bin/bash
echo "Hello, World!"
for i in {1..5}; do
echo "Number: $i"
done
if [ -f "file.txt" ]; then
cat file.txt
fi
JSON
{
"name": "JNU E-book",
"version": "1.0.0",
"features": ["markdown", "pdf", "syntax-highlighting"],
"published": true
}
SQL
SELECT u.name, COUNT(b.id) as book_count
FROM users u
LEFT JOIN books b ON u.id = b.user_id
WHERE u.is_active = true
GROUP BY u.id
ORDER BY book_count DESC;
Java
public class HelloWorld {
public static void main(String[] args) {
String name = "World";
System.out.println("Hello, " + name + "!");
int[] numbers = {1, 2, 3, 4, 5};
for (int n : numbers) {
System.out.println(n * n);
}
}
}