Skip to content

Latest commit

 

History

History
53 lines (36 loc) · 1.19 KB

literate.java.md

File metadata and controls

53 lines (36 loc) · 1.19 KB

Java literate example

This is an example of Java programming, in the style promoted by Knuth called literate programming. The text is encoded using Markdown.

More about literate programming:

The program

The simplest Java program:

public class literate {
    public static void main(String[] args) {
        System.out.println("That's all Folks!");
    }
}

Fancy, doensn't it?

How to evaluate?

Simply run this command in the Shell:

$ ./run-md literate.java.md 
>>> Running: literate.java.md
That's all Folks!

How to publish?

Install MarkDown processors:

MANAGER=yum
which dnf >/dev/null 2>&1 && MANAGER=dnf
which apt-get >/dev/null 2>&1 && MANAGER=apt-get
sudo $MANAGER -y install pandoc texlive

and execute make build in this directory! HTML and PDF output formats are generated. Check with any HTML browser and PDF viewer:

elinks literate.java.html
evince literate.java.pdf

That's all Folks!