Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 1.15 KB

literate.c.md

File metadata and controls

55 lines (37 loc) · 1.15 KB

C literate example

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

More about literate programming:

The program

The simplest C program:

#include <stdio.h>

int main(int argc, char **argv)
{
    printf("That's all Folks!\n");
    return 0;
}

Fancy, doensn't it?

How to evaluate?

Simply run this command in the Shell:

$ ./run-md literate.c.md 
>>> Running: literate.c.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.c.html
evince literate.c.pdf

That's all Folks!