浏览代码

Merge pull request #370 from shalvah/v3

Updates to the `update` command
Shalvah A 6 年之前
父节点
当前提交
4ad680c5e6
共有 2 个文件被更改,包括 7 次插入9 次删除
  1. 2 2
      README.md
  2. 5 7
      src/Commands/UpdateDocumentation.php

+ 2 - 2
README.md

@@ -269,10 +269,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.

+ 5 - 7
src/Commands/UpdateDocumentation.php

@@ -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);