Skip to content

Commit b35300b

Browse files
authored
Merge pull request #730 from ramsesmoreno/master
Support to change the output folder when generating static files
2 parents 771ab73 + f6f3eea commit b35300b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config/apidoc.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
*/
1010
'type' => 'static',
1111

12+
/*
13+
* Static output folder: HTML documentation and assets will be generated in this folder.
14+
*/
15+
'output_folder' => 'public/docs',
16+
1217
/*
1318
* Settings for `laravel` type output.
1419
*/

src/Writing/Writer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function __construct(Command $output, DocumentationConfig $config = null,
6666
$this->documentarian = new Documentarian();
6767
$this->isStatic = $this->config->get('type') === 'static';
6868
$this->sourceOutputPath = 'resources/docs';
69-
$this->outputPath = $this->isStatic ? 'public/docs' : 'resources/views/apidoc';
69+
$this->outputPath = $this->isStatic ? ($this->config->get('output_folder') ?? 'public/docs') : 'resources/views/apidoc';
7070
}
7171

7272
public function writeDocs(Collection $routes)
@@ -257,7 +257,7 @@ protected function getMarkdownToAppend(): string
257257

258258
protected function copyAssetsFromSourceFolderToPublicFolder(): void
259259
{
260-
$publicPath = 'public/docs';
260+
$publicPath = $this->config->get('output_folder') ?? 'public/docs';
261261
if (! is_dir($publicPath)) {
262262
mkdir($publicPath, 0777, true);
263263
mkdir("{$publicPath}/css");

0 commit comments

Comments
 (0)