Code

This is just a test with syntax highlighting and some examples made by Rouge. It still renders wrong and I don’t know why, but I think it is my very old CSS stylesheet that should be refactored to a more modern style…

Bash

         #!/bin/bash

echo "Hello World!";

      

C

         #include <stdio.h>
int main() {
   // printf() displays the string inside quotation
   printf("Hello, World!");
   return 0;
}

      

JSON

         
            {
            
  
            "firstName"
            :
             
            "John"
            ,
            
  
            "lastName"
            :
             
            "Smith"
            ,
            
  
            "age"
            :
             
            25
            

            }
            

         
      

Perl

         #!/usr/bin/env perl

use warnings;
print "a: ";
my $a = "foo";
print $a;

      

PHP

         <?php
echo "Hello World!";
?>

      

Python

         #!/usr/bin/env python

def hello(name):
  print("Hello ", name)

hello("World")

      

Ruby

         class Greeter
  def initialize(name="World")
    @name = name
  end

  def say_hi
    puts "Hi #{@name}!"
  end
end

      

Rust

         use core::*;

fn main() {
    for ["Alice", "Bob", "Carol"].each |&name| {
        do task::spawn {
            let v = rand::Rng().shuffle([1, 2, 3]);
            for v.each |&num| {
                io::print(fmt!("%s says: '%d'\n", name, num))
            }
        }
    }
}

      

SQL

         SELECT * FROM `users` WHERE `user`.`id` = 1

      

Graphviz

I am testing Grapphviz diagrams here… For now it seems stable and ready to use…

SSAAS->AaBBS->BbDDA->DcB->DdCC
AABBA->Bdirect
bbccc->b0.6eec->e0.6aaa->b0.2a->c0.4e->b0.7e->e0.1

Comments