Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio
> require "diagtex"
> storenode {TeX="a", tag="a", x=100, y=100}
> storenode {TeX="b", tag="b", x=140, y=100}
> = nodes
{ 1={"TeX"="a", "noden"=1, "tag"="a", "x"=100, "y"=100},
  2={"TeX"="b", "noden"=2, "tag"="b", "x"=140, "y"=100},
  "a"={"TeX"="a", "noden"=1, "tag"="a", "x"=100, "y"=100},
  "b"={"TeX"="b", "noden"=2, "tag"="b", "x"=140, "y"=100}
}
> storearrow(DxyArrow {from="a", to="b", shape="|->",
>>                      slide="5pt", label="up", placement="a"})
> storearrow(DxyArrow {from="a", to="b", shape=".>"})
> storearrow(DxyPlace {nodes["a"]})
> storearrow(DxyLiteral {"literal foobar"})
> = arrows
{ 1={"arrown"=1, "from"="a", "label"="up", "placement"="a", "shape"="|->", "slide"="5pt", "to"="b"},
  2={"arrown"=2, "from"="a", "shape"=".>", "to"="b"},
  3={1={"TeX"="a", "noden"=1, "tag"="a", "x"=100, "y"=100}, "arrown"=3},
  4={1="literal foobar", "arrown"=4}
}
> print(arrow_to_TeX(arrows[1]))
\morphism(0,0)|a|/{@{|->}@<5pt>}/<600,0>[{a}`{b};{up}]
> print(arrows[2]:TeX())
\morphism(0,0)/.>/<600,0>[{a}`{b};]
> print(arrows[3]:TeX())
\place(0,0)[{{a}}]
> print(arrows[4]:TeX())
literal foobar
> print(arrows_to_TeX())
  \morphism(0,0)|a|/{@{|->}@<5pt>}/<600,0>[{a}`{b};{up}]
  \morphism(0,0)/.>/<600,0>[{a}`{b};]
  \place(0,0)[{{a}}]
  literal foobar

> print(arrows_to_defdiag("??", "  % foo"))
\defdiag{??}{  % foo
  \morphism(0,0)|a|/{@{|->}@<5pt>}/<600,0>[{a}`{b};{up}]
  \morphism(0,0)/.>/<600,0>[{a}`{b};]
  \place(0,0)[{{a}}]
  literal foobar
}
> 
>