Skip to content

Latest commit

 

History

History
94 lines (80 loc) · 1.4 KB

File metadata and controls

94 lines (80 loc) · 1.4 KB

Ruby example

Inline Ruby code
=begin
This program will
print "Hello world".
=end

puts 'Hello world'

Java example

Inline Java code
/**
 * This is a Java "Hello world" example.
 * @param args arguments
 *
 * @since 1.3
 */
public class Test {
  public static void main(String[] args) {
    System.out.println("Hello World!"); (1)
  }
}
  1. This is where the fun happens

Groovy example

Included Groovy code (from code_snippets/groovy.groovy)
link:code_snippets/groovy.groovy[role=include]

Scala example

Inline Scala code
/**
 * This is a simple scala example
 */
object HelloWorld {
  def main(args: Array[String]) {
    println("Hello, world!")
  }
}

HTML example

Inline HTML code
<HTML>
   <head>
      <title>
         A Small Hello
      </title>
   </head>
    <body>
       <h1>Hi</h1>
       <div class="hello">This is very minimal "hello world" HTML document.</div>
    </body>
</HTML>

JavaScript example

Inline JavaScript code
if (console.log) {
  // greeting silently
  console.log('Hello World!!')
} else {
  // greeting in a pop up window
  alert('Hello World!')
}

CoffeeScript example

Included CoffeeScript code (from code_snippets/coffeeScript.coffee)
link:code_snippets/coffeeScript.coffee[role=include]