Skip to content

Commit 6079fd3

Browse files
committed
Update docs
1 parent 9d366ef commit 6079fd3

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

docs/architecture.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
# Architecutre
1+
# Architecture
22
Read this page if you want a deeper understanding of how this works (for instance, for the purpose of contributing).
33

4-
- Documentarian takes in a markdwown file and transforms it into HTML.
4+
- When the `generate` command is run, it fetches all your application's routes from Laravel's (or DIngo's) Route facade.
5+
- Next, the RouteMatcher uses the rules in your config to determine what routes to generate documentation for, as well as extract any specific configuration for them. This configuration is passed to the next stages.
6+
- The Generator processes each route. This entails:
7+
- Fetching the route action (controller, method) via Reflection (along with their corresponding docblocks). These are used in the remaining stages below.
8+
- Determining and obtaining info on body parameters, query parameters and headers to be added to the route's documentation.
9+
- Obtaining a sample response.
10+
- The generate command uses information from these parsed routes and other configuration to generate a Markdown file via Blade templating.
11+
- This Markdown file is passed to Documentarian, which transforms it into HTML, CSS and JavaScript assets.
12+
- If enabled, a Postman collection is generated as well.

docs/documenting.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ They will be included in the generated documentation text and example requests.
8484

8585
![](body_params.png)
8686

87-
Note: a random value will be used as the value of each parameter in the example requests. If you'd like to specify an example value, you can do so by adding `Example: your-example` to the end of your description. For instance:
87+
### Example parameters
88+
For each parameter in your request, this package will generate a random value to be used in the example requests. If you'd like to specify an example value, you can do so by adding `Example: your-example` to the end of your description. For instance:
8889

8990
```php
9091
/**
@@ -97,7 +98,7 @@ Note: a random value will be used as the value of each parameter in the example
9798
*/
9899
```
99100

100-
Note: To exclude a particular parameter from the generated examples (for all languages), you can annotate it with `No-example`. For instance:
101+
You can also exclude a particular parameter from the generated examples (for all languages) by annotating it with `No-example`. For instance:
101102
```php
102103
/**
103104
* @queryParam location_id required The id of the location. Example: 1

docs/generating-documentation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ php artisan apidoc:rebuild
5151
- `methods`: an array of the HTTP methods for that route
5252
- `boundUri`: the complete URL for the route, with any url parameters replaced (/users/{id} -> /users/1)
5353
- `headers`: key-value array of headers to be sent with route (according to your configuration)
54-
- `cleanQueryParameters`: key-value array of query parameters (with example values) to be sent with the request
55-
- `cleanBodyParameters`: key-value array of body parameters (with example values) to be sent with the request
54+
- `cleanQueryParameters`: key-value array of query parameters with example values to be sent with the request. Parameters which have been excluded from the example requests (see [Example Parameters](documenting.html#example-parameters)) will not be present here.
55+
- `cleanBodyParameters`: key-value array of body parameters with example values to be sent with the request. Parameters which have been excluded from the example requests (see [Example Parameters](documenting.html#example-parameters)) will not be present here.
5656

5757
- Add the language to the `example_languages` array in the package config.
5858

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Automatically generate your API documentation from your existing Laravel/Lumen/[
99
* [Configuration](config.md)
1010
* [Generating Documentation](generating-documentation.md)
1111
* [Documenting Your API](documenting.md)
12+
* [Internal Architecture](architecture.md)
1213

1314
## Installation
1415
> Note: PHP 7 and Laravel 5.5 or higher are required.

0 commit comments

Comments
 (0)