Cover Image for Syntax Highlighting
Syntax Highlighting

powered by highlight.js

Apparently highlight.js needs document and next.js does not have document? not sure what happenend there 😵 as on date 20,2020 16:01

Its working 🎉 Updated with the following gist

python2

1
print "Hello, World!"

python3

1
print("Hello, World!")

html

1
2
3
4
5
<html>
  <body>
    Hello, World!
  </body>
</html>

ruby

1
puts "Hello, World!"

r

1
cat("Hello world\n")

php

1
2
3
<?php
    echo 'Hello, World!';
?>

css

1
2
3
body:before {
  content: "Hello World";
}

scss

1
2
3
body:before {
  content: "Hello World";
}

javascript

1
<script language="JavaScript">document.write('Hello, World!');</script>

java

1
2
3
4
5
public class HelloWorld {
 public static void main(String[] args) {
 System.out.println("Hello, World!");
 }
}

c

1
2
3
4
5
6
7
#include <stdio.h>

/* Hello */
int main(void) {
  printf("Hello, World!");
  return 0;
}

c++

1
2
3
4
5
6
#include <iostream>

int main()
{
  std::cout << "Hello, World!\n";
}

c

1
2
3
4
5
6
7
8
using System;
class HelloWorld
{
   public static void Main()
   {
      System.Console.WriteLine("Hello, World!");
    }
}