Skip to content

Commit 5e1c083

Browse files
committed
Add the --include-path option for the documentation generation.
This follows some recent commits to the Blueprint repo. By default the include path is the root directory.
1 parent 9f69781 commit 5e1c083

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Console/Command/Docs.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ class Docs extends Command
5454
*/
5555
protected $signature = 'api:docs {--name= : Name of the generated documentation}
5656
{--use-version= : Version of the documentation to be generated}
57-
{--output-file= : Output the generated documentation to a file}';
57+
{--output-file= : Output the generated documentation to a file}
58+
{--include-path= : Path where included documentation files are located}';
5859

5960
/**
6061
* The console command description.
@@ -92,7 +93,7 @@ public function __construct(Router $router, Blueprint $blueprint, Writer $writer
9293
*/
9394
public function handle()
9495
{
95-
$contents = $this->blueprint->generate($this->getControllers(), $this->getDocName(), $this->getVersion());
96+
$contents = $this->blueprint->generate($this->getControllers(), $this->getDocName(), $this->getVersion(), $this->getIncludePath());
9697

9798
if ($file = $this->option('output-file')) {
9899
$this->writer->write($contents, $file);
@@ -121,6 +122,16 @@ protected function getDocName()
121122
return $name;
122123
}
123124

125+
/**
126+
* Get the include path for documentation files.
127+
*
128+
* @return string
129+
*/
130+
protected function getIncludePath()
131+
{
132+
return rtrim($this->laravel['path.base'].'/'.$this->option('include-path'), '/');
133+
}
134+
124135
/**
125136
* Get the documentation version.
126137
*

0 commit comments

Comments
 (0)