upd(codegen): follow golang standard pkg layout

This commit is contained in:
Tit Petric
2018-11-25 11:41:46 +01:00
parent 52359771e9
commit 6a3fd9bc3b
25 changed files with 23 additions and 17 deletions
+4 -3
View File
@@ -21,14 +21,14 @@ $cleanUp = function($contents) {
foreach ($apis as $k => $api) {
$entrypoint = $api['entrypoint'];
$filename_md = $dirname . "/src/" . $entrypoint . "/index.md";
$filename_md = $api['dirname'] . $entrypoint . "/index.md";
if (file_exists($filename_md)) {
$api['description'] = file_get_contents($filename_md);
}
foreach ($api['apis'] as $key => $call) {
$name = $call['name'];
$filename_md = $dirname . "/src/" . $entrypoint . "/" . $name . ".md";
$filename_md = $api['dirname'] . $entrypoint . "/" . $name . ".md";
if (file_exists($filename_md)) {
$call['description'] = file_get_contents($filename_md);
}
@@ -40,4 +40,5 @@ foreach ($apis as $k => $api) {
$tpl->load("README.tpl");
$tpl->assign("apis", $apis);
file_put_contents($dirname . "/README.md", $cleanUp($tpl->get()));
file_put_contents($dirname . "README.md", $cleanUp($tpl->get()));
echo $dirname . "README.md\n";