Skip to content

Commit 2d3fe2a

Browse files
committed
Support to change the output folder when generating static files
1 parent 181a3af commit 2d3fe2a

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: Uncomment and change it if you need the documentation to be generated in a different 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)
@@ -252,7 +252,7 @@ protected function getMarkdownToAppend(): string
252252

253253
protected function copyAssetsFromSourceFolderToPublicFolder(): void
254254
{
255-
$publicPath = 'public/docs';
255+
$publicPath = $this->config->get('output_folder') ?? 'public/docs';
256256
if (! is_dir($publicPath)) {
257257
mkdir($publicPath, 0777, true);
258258
mkdir("{$publicPath}/css");

0 commit comments

Comments
 (0)