mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-24 05:46:15 +08:00
Updates to the update command
- Renamed to 'rebuild' - Uses config option rather than command-line flag
This commit is contained in:
@@ -274,10 +274,10 @@ APP_URL=http://yourapp.app
|
||||
If you want to modify the content of your generated documentation, go ahead and edit the generated `index.md` file.
|
||||
The default location of this file is: `public/docs/source/index.md`.
|
||||
|
||||
After editing the markdown file, use the `apidoc:update` command to rebuild your documentation as a static HTML file.
|
||||
After editing the markdown file, use the `apidoc:rebuild` command to rebuild your documentation as a static HTML file.
|
||||
|
||||
```sh
|
||||
$ php artisan apidoc:update
|
||||
$ php artisan apidoc:rebuild
|
||||
```
|
||||
|
||||
As an optional parameter, you can use `--location` to tell the update command where your documentation can be found.
|
||||
|
||||
@@ -12,16 +12,14 @@ class UpdateDocumentation extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'apidoc:update
|
||||
{--location=public/docs : The documentation location}
|
||||
';
|
||||
protected $signature = 'apidoc:rebuild';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Update and rebuild your API documentation from your markdown file.';
|
||||
protected $description = 'Rebuild your API documentation from your markdown file.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
@@ -40,16 +38,16 @@ class UpdateDocumentation extends Command
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$outputPath = $this->option('location');
|
||||
$outputPath = config('apidoc.output');
|
||||
|
||||
$documentarian = new Documentarian();
|
||||
|
||||
if (! is_dir($outputPath)) {
|
||||
$this->error('There is no generated documentation available at '.$outputPath.'.');
|
||||
$this->error('There is no existing documentation available at '.$outputPath.'.');
|
||||
|
||||
return false;
|
||||
}
|
||||
$this->info('Updating API HTML code');
|
||||
$this->info('Rebuilding API HTML code from '.$outputPath.'/source/index.md');
|
||||
|
||||
$documentarian->generate($outputPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user