Browse Source

Rename route.blade.php to endpoint.blade.php

shalvah 5 years ago
parent
commit
834941984b

+ 1 - 1
docs/customization.md

@@ -107,7 +107,7 @@ The following Blade files are present in the `partials` directory:
    - `$groupDescription`, and
    - `$routes`, an array containing routes in that group. Each item here contains the route information described in [the plugin API](plugins.html#api), plus an `output` item that contains the Markdown for that route.
    
-- `route.blade.php`: This is the template for a single endpoint. For each endpoint, it gets rendered and passed back to the `Writer` class, which sets it as the `output` key in the `$route` variable before passing to the group template. It has access to the following variables:
+- `endpoint.blade.php`: This is the template for a single endpoint. For each endpoint, it gets rendered and passed back to the `Writer` class, which sets it as the `output` key in the `$route` variable before passing to the group template. It has access to the following variables:
    - `$settings` (the same settings variable passed to frontmatter),
    - `$route`: an array which contains the information extracted from the various stages (see [the plugin API](plugins.html#api) for details).
    

+ 4 - 0
docs/helpful-tips.md

@@ -4,5 +4,9 @@
 Also check out our [community wiki](https://github.com/knuckleswtf/scribe/wiki/Helpful-strategies-(snippets)) for a list of helpful extraction strategies.
 
 ## Use a separate env for generating documentation
+- Response calls
+- Factory
+
+## Use your test database/ docs user
 
 ## Minimize usage of route groups

+ 2 - 2
docs/migrating.md

@@ -54,10 +54,10 @@ It's a new package with a different name, so a few things have changed. This sec
 
 - Replace all occurrences of `Mpociot\ApiDoc\Extracting\Strategies\RequestHeaders` with `Knuckles\Scribe\Extracting\Strategies\Headers`
 - Replace all occurrences of `Mpociot\ApiDoc` with `Knuckles\Scribe`
-- For strategies, change the type of the `$method` argument to the `__invoke` method from `ReflectionMethod` to `ReflectionFunctionAbstract`. It's a superclass, so every other thing should work fine.
+- For strategies, change the type of the `$method` argument to the `__invoke` method from `ReflectionMethod` to `ReflectionFunctionAbstract` to enable support for Closure routes. It's a superclass of `ReflectionMethod`, so every other thing should work fine.
 - For each strategy, add a `public $stage` property and set it to the name of the stage the strategy belongs to. If you have a constructor defined, remove the `$stage` argument from it. 
 - The `requestHeaders` stage has been renamed to `headers`.
-- If you've published the views, you'll note that they are now in a different format. See the documentation on [customising the views](customization.html#changing-the-markdown-templates) to learn the new look.
+- If you've published the views, you'll note that they are now in a different format. See the documentation on [customising the views](customization.html#changing-the-markdown-templates) to see how things are organised now.
 
 
 That should be all. Head on to the [list of new features](./whats-new.html) to see what's new. If you come across anything we've missed, please send in a PR!

+ 1 - 1
docs/plugins.md

@@ -180,7 +180,7 @@ To use your strategy, you need to register it in the `strategies` key in the `sc
 ```
 
 ```eval_rst
-.. Tip:: You can also install strategies from Packagist via :code:`composer require` and then register them here. 
+.. Tip:: You can also publish your strategy to Packagist. Then others can install them via :code:`composer require` and register them in their own configs. 
 ```
 
 And we're done! Now, when we run `php artisan scribe:generate`, all our GET routes that end with `.index` will have the pagination parameters added.

+ 0 - 0
resources/views/partials/route.blade.php → resources/views/partials/endpoint.blade.php


+ 3 - 3
src/Writing/Writer.php

@@ -114,7 +114,7 @@ class Writer
 
         $this->fetchLastTimeWeModifiedFilesFromTrackingFile();
 
-        $this->writeRoutesMarkdownFile($parsedRoutes, $settings);
+        $this->writeEndpointsMarkdownFile($parsedRoutes, $settings);
         $this->writeIndexMarkdownFile($settings);
         $this->writeAuthMarkdownFile();
 
@@ -130,7 +130,7 @@ class Writer
                 $hasRequestOptions = !empty($route['headers'])
                     || !empty($route['cleanQueryParameters'])
                     || !empty($route['cleanBodyParameters']);
-                $route['output'] = (string)view('scribe::partials.route')
+                $route['output'] = (string)view('scribe::partials.endpoint')
                     ->with('hasRequestOptions', $hasRequestOptions)
                     ->with('route', $route)
                     ->with('settings', $settings)
@@ -296,7 +296,7 @@ class Writer
         $this->writeFile($authMarkdownFile, $authMarkdown);
     }
 
-    protected function writeRoutesMarkdownFile(Collection $parsedRoutes, array $settings): void
+    protected function writeEndpointsMarkdownFile(Collection $parsedRoutes, array $settings): void
     {
         if (!is_dir($this->sourceOutputPath . '/groups')) {
             mkdir($this->sourceOutputPath . '/groups', 0777, true);