Please refer to the following official website for instructions on how to display code titles:
rockchalkwushock/rehype-code-titles: Rehype plugin for parsing code blocks and adding titles to code blocks
JavaScript
function factorial(n) {
if (n === 0) {
return 1;
} else {
return n * factorial(n - 1);
}
}
console.log(factorial(5)); // Output: 120
CSS
/* Styles for a button */
.button {
background-color: #3498db;
border: none;
color: white;
padding: 12px 24px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
html
<!DOCTYPE html>
<html>
<head>
<title>My Website</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Welcome to my website!</h1>
<p>Here is some text.</p>
<script src="script.js"></script>
</body>
</html>