Commit b809f93b by Carsten Brandt

ensure apidoc works with relative paths

parent a92a4179
......@@ -51,11 +51,11 @@ class ApiController extends BaseController
} else {
$guideUrl = './';
$renderer->guideUrl = $targetDir;
}
if (file_exists($renderer->generateGuideUrl('README.md'))) {
$renderer->guideUrl = $guideUrl;
} else {
$renderer->guideUrl = null;
if (file_exists($renderer->generateGuideUrl('README.md'))) {
$renderer->guideUrl = $guideUrl;
} else {
$renderer->guideUrl = null;
}
}
// search for files to process
......
......@@ -47,8 +47,14 @@ class GuideController extends BaseController
// setup reference to apidoc
if ($this->apiDocs !== null) {
$renderer->apiUrl = $this->apiDocs;
$renderer->apiContext = $this->loadContext($this->apiDocs);
$path = $this->apiDocs;
$renderer->apiUrl = $path;
// use relative paths relative to targetDir
if (strncmp($path, '.', 1) === 0) {
$renderer->apiContext = $this->loadContext("$targetDir/$path");
} else {
$renderer->apiContext = $this->loadContext($path);
}
} elseif (file_exists($targetDir . '/cache/apidoc.data')) {
$renderer->apiUrl = './';
$renderer->apiContext = $this->loadContext($targetDir);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment