computable-pandoc/tests/pass.lit.infos.md

2.1 KiB

Inserts Before Blocks

  • fn1()``fn2()
  • fn3(true)
  • fn4(2.0, 3.1)
  • fn3(n: false)
  • fn4(b: 4, a: 5)

Blocks

All literate blocks should be print on --verbose.

Minimal (Lua by default):

---
id: fn1
...
1 + 2 + 3

With scape:

---
id: fn2
...
"\#x"

With arg:

---
id: fn3
args:
  n: str
...
#n == #n

With lang and args:

---
id: fn4
lang: fennel
args:
  a: 1
  b: 2
...
(* #a #b)

With cmd (ignores lang):

---
id: fn5
cmd: python -E -X utf8
args:
  n: 2
...
#n + #n

With shift (nil by default):

---
id: fn6
shift: true
...
"The literate block is shifted by its eval result."

With wipe (nil by default):

---
id: fn7
wipe: true
...
"This evals but it is wipe from doc."

With typed (nil by default):

---
id: fn4
typed: true
args:
  a: 1
  b: 2
...
#a * #b

With link (nil by default) and alt (optional):

---
id: fn8
lang: graphviz
link: ./graph.png
alt: A graph. 
...
digraph G {
  a -> b;
  b -> c
  c -> a;
}

With img (nil by default) and alt (optional):

---
id: fn9
lang: graphviz
img: ./graph.png
alt: A graph. 
...
digraph G {
  a -> b;
  b -> c
  c -> a;
}

With inner function:

---
id: fn10
args:
  x: 2 
...
#fn1() * x

With inner function with args:

---
id: fn11
args: 
  y: 1
  z: 2
...
#y + #fn4(3, 4) + #z

With inner inner function:

---
id: fn12
args:
  a: 1
...
#a + #fn4(#a, #fn1())

Inserts and Data Types

  • fn3(true)
  • fn3(false)
  • fn3([])
  • fn3([0, 1])
  • fn3({})
  • fn3({"k1": 1, "k2": 2})
  • fn4(3)
  • fn5(1.0)
  • fn5("str")

Messy Inserts

  • fn1( )
  • fn3("\"str\"")
  • fn3( 4)
  • fn3(5 )
  • fn3( 6 )
  • fn3( n: 7)
  • fn3(n: 8 )
  • fn3( n: 9 )
  • fn3(n:10)
  • fn4( a: 6, b: 7)
  • fn4( a: 8 , b: 9)
  • fn4( a: 10 , b: 11)
  • fn4( a: 12 , b: 13)
  • fn4( a: 14 , b: 15 )
  • fn4(a:16,b:17)