Skip to content

hholst80/pandoc

Repository files navigation

pandoc codeblock filters

This is an example of Pandoc filters and loginteractive for logging interactive programs as if they where executed from a terminal.

Octave

A = reshape(1:4,[2 2])
v = eig(A)

Python

def isPrime(n):
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            return False
    return True

isPrime(2)
isPrime(4)
for n in range(2,100):
    if isPrime(n):
        print n,

Ruby

def factorial(n)
return 1 if n <= 1
return n * factorial(n - 1)
end
factorial(20)

Releases

No releases published

Packages

No packages published