0% found this document useful (0 votes)
3 views

highlight html

This document is an HTML template demonstrating the use of Highlight.js for syntax highlighting in various programming languages. It includes examples in JavaScript, Python, Java, and C++. The document links to external CSS and JavaScript files to style and enable the highlighting functionality.

Uploaded by

jidangamer26
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

highlight html

This document is an HTML template demonstrating the use of Highlight.js for syntax highlighting in various programming languages. It includes examples in JavaScript, Python, Java, and C++. The document links to external CSS and JavaScript files to style and enable the highlighting functionality.

Uploaded by

jidangamer26
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html lang="id">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Highlight.js - Semua Bahasa</title>

<!-- CSS Tema Highlight.js (Ganti jika mau) -->


<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/
vs2015.min.css">

<!-- Library Highlight.js -->


<script
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"><
/script>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/languages/
all.min.js"></script>

<!-- Inisialisasi Highlight.js -->


<script>hljs.highlightAll();</script>
</head>
<body>
<h2>Contoh Highlight.js - Semua Bahasa</h2>

<!-- Kode tanpa menentukan bahasa (auto detect) -->


<pre><code>
function sayHello() {
console.log("Hello, World!");
}
</code></pre>

<!-- Kode dengan bahasa tertentu -->


<pre><code class="language-python">
def say_hello():
print("Hello, World!")
</code></pre>

<pre><code class="language-java">
public class Main {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
</code></pre>

<pre><code class="language-cpp">
#include &lt;iostream&gt;
using namespace std;

int main() {
cout << "Hello, World!" << endl;
return 0;
}
</code></pre>

<div class="code">
</div>

</body>
</html>

You might also like