This file uses 2 files: [[use, math.md]] and [[use, mnt:c, cstd.md]], write [[file.x, out.out]] as [[=c.fun1]]

Example of Literate Programming in Markdown

Code 1

Two variables, [[myv]]: int v1 and int v2. This example shows using of external file also. Test if variable is negative looks like [[c.isneg]]: if ($x < 0). So, we can write absolute function [[c.fun1]]:

[[=c.hh.0, file:GUI]]
[[=myv.*, join:;\n]];
int fun1(int a) {
    [[=c.isneg, x:a]] {
        a += 100;
        return -a;
    }
    else
        return a;
}
[[=min]]
[[=max]]
[[=c.hh.1]]

last line