update lua doc to html generator
This commit is contained in:
parent
165ae0863a
commit
22b1a0b6ae
@ -125,6 +125,15 @@ function luafn2class ($lua) {
|
|||||||
return substr ($lua, 0, strrpos ($lua, ':'));
|
return substr ($lua, 0, strrpos ($lua, ':'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function luafn2name ($lua) {
|
||||||
|
$fn = strrpos ($lua, ':');
|
||||||
|
if ($fn !== 0 && strlen($lua) > $fn + 1) {
|
||||||
|
return substr ($lua, $fn + 1);
|
||||||
|
}
|
||||||
|
my_die ('invalid class prefix: '. $name);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkclass ($b) {
|
function checkclass ($b) {
|
||||||
global $classlist;
|
global $classlist;
|
||||||
if (!isset ($classlist[luafn2class ($b['lua'])])) {
|
if (!isset ($classlist[luafn2class ($b['lua'])])) {
|
||||||
@ -249,6 +258,26 @@ foreach ($doc as $b) {
|
|||||||
'ret' => arg2lua (datatype ($b['ldec']))
|
'ret' => arg2lua (datatype ($b['ldec']))
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case "Static C Function":
|
||||||
|
checkclass ($b);
|
||||||
|
if (strpos ($b['lua'], 'ARDOUR:DataType:') === 0) {
|
||||||
|
# special case ARDOUR:DataType convenience c'tor
|
||||||
|
$args = array ();
|
||||||
|
$ret = array (luafn2class ($b['lua']) => 0);
|
||||||
|
$canon = 'ARDOUR::LuaAPI::datatype_ctor_'.strtolower (luafn2name ($b['lua'])).'(lua_State*)';
|
||||||
|
} else {
|
||||||
|
my_die ('unhandled Static C: ' . print_r($b, true));
|
||||||
|
}
|
||||||
|
$classlist[luafn2class ($b['lua'])]['func'][] = array (
|
||||||
|
'bind' => $b,
|
||||||
|
'name' => $b['lua'],
|
||||||
|
'args' => $args,
|
||||||
|
'ret' => $ret,
|
||||||
|
'ref' => false,
|
||||||
|
'ext' => false,
|
||||||
|
'cand' => $canon
|
||||||
|
);
|
||||||
|
break;
|
||||||
case "C Function":
|
case "C Function":
|
||||||
# we required C functions to be in a class namespace
|
# we required C functions to be in a class namespace
|
||||||
case "Ext C Function":
|
case "Ext C Function":
|
||||||
@ -257,9 +286,8 @@ foreach ($doc as $b) {
|
|||||||
$ret = array ('...' => 0);
|
$ret = array ('...' => 0);
|
||||||
$ns = luafn2class ($b['lua']);
|
$ns = luafn2class ($b['lua']);
|
||||||
$cls = $classlist[$ns];
|
$cls = $classlist[$ns];
|
||||||
## std::Vector std::List types
|
|
||||||
if (preg_match ('/.*<([^>]*)[ ]*>/', $cls['ldec'], $templ)) {
|
if (preg_match ('/.*<([^>]*)[ ]*>/', $cls['ldec'], $templ)) {
|
||||||
// XXX -> move to C-source
|
# std::vector, std::list types
|
||||||
switch (stripclass($ns, $b['lua'])) {
|
switch (stripclass($ns, $b['lua'])) {
|
||||||
case 'add':
|
case 'add':
|
||||||
#$args = array (array ('LuaTable {'.$templ[1].'}' => 0));
|
#$args = array (array ('LuaTable {'.$templ[1].'}' => 0));
|
||||||
@ -278,6 +306,7 @@ foreach ($doc as $b) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (strpos ($cls['type'], ' Array') !== false) {
|
} else if (strpos ($cls['type'], ' Array') !== false) {
|
||||||
|
# catches C:FloatArray, C:IntArray
|
||||||
$templ = preg_replace ('/[&*]*$/', '', $cls['ldec']);
|
$templ = preg_replace ('/[&*]*$/', '', $cls['ldec']);
|
||||||
switch (stripclass($ns, $b['lua'])) {
|
switch (stripclass($ns, $b['lua'])) {
|
||||||
case 'array':
|
case 'array':
|
||||||
|
18
tools/update_luadoc.sh
Executable file
18
tools/update_luadoc.sh
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
## ardour needs to be configured with --luadoc and build should be up-to date.
|
||||||
|
|
||||||
|
cd `dirname $0`
|
||||||
|
set -e
|
||||||
|
test -f ../libs/ardour/ardour/ardour.h
|
||||||
|
test -e ../gtk2_ardour/arluadoc
|
||||||
|
test -e ../build/gtk2_ardour/luadoc
|
||||||
|
|
||||||
|
# generate ../doc/luadoc.json.gz
|
||||||
|
../gtk2_ardour/arluadoc
|
||||||
|
|
||||||
|
# generate ../doc/ardourapi.json.gz
|
||||||
|
./doxy2json/ardourdoc.sh
|
||||||
|
|
||||||
|
php fmt-luadoc.php > /tmp/luadoc.html
|
||||||
|
# ^^ needs manual copy to ardour-manual
|
||||||
|
ls -l /tmp/luadoc.html
|
Loading…
Reference in New Issue
Block a user