mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-23 15:16:50 +08:00
Update deps
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
"require": {
|
||||
"php": ">=7.2.0",
|
||||
"ext-json": "*",
|
||||
"dingo/api": "^2.3",
|
||||
"fzaninotto/faker": "^1.8",
|
||||
"illuminate/console": "^5.7|^6.0|^7.0",
|
||||
"illuminate/routing": "^5.7|^6.0|^7.0",
|
||||
@@ -30,7 +31,6 @@
|
||||
"symfony/var-exporter": "^4.0|^5.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"dingo/api": "^2.3",
|
||||
"dms/phpunit-arraysubset-asserts": "^0.1.0",
|
||||
"brianium/paratest": "^4.0",
|
||||
"league/fractal": "^0.19.0",
|
||||
|
||||
@@ -7,7 +7,7 @@ This is the type of documentation output to generate.
|
||||
- `static` will generate a static HTMl page in the `public/docs` folder, so anyone can visit your documentation page by going to {yourapp.domain}/docs.
|
||||
- `laravel` will generate the documentation as a Blade view within the `resources/views/scribe` folder, so you can add routing and authentication.
|
||||
|
||||
> In both instances, the source markdown file will be generated in `resources/docs/source`.
|
||||
> In both instances, the source markdown file will be generated in `resources/docs`.
|
||||
|
||||
## `laravel`
|
||||
If you're using `laravel` type output, this package can automatically set up an endpoint for you to view your generated docs. You can configure this here.
|
||||
|
||||
@@ -23,12 +23,12 @@ The base URL used in the Postman collection will be the value of the `base_url`
|
||||
## Manually modifying the content of the generated documentation
|
||||
If you want to modify the content of your generated documentation without changing the routes, go ahead and edit the generated `index.md` file.
|
||||
|
||||
This file is located in the `source` folder of your `output` directory (see [configuration](config.html#output)), so by default, this is `public/docs/source/index.md`.
|
||||
This file is located in the `source` folder of your `output` directory (see [configuration](config.html#output)), so by default, this is `public/docs/index.md`.
|
||||
|
||||
After editing the markdown file, you can use the `scribe:generate` command to rebuild your documentation into HTML.
|
||||
|
||||
## Automatically add markdown to the beginning or end of the documentation
|
||||
If you wish to automatically add the same content to the docs every time you generate (for instance, an introduction, a disclaimer or an authenticatino guide), you can add a `prepend.md` and/or `append.md` file to the `source` folder in the source output directory (`resources/docs/source`), and they will be added to the generated documentation.
|
||||
If you wish to automatically add the same content to the docs every time you generate (for instance, an introduction, a disclaimer or an authenticatino guide), you can add a `prepend.md` and/or `append.md` file to the `source` folder in the source output directory (`resources/docs`), and they will be added to the generated documentation.
|
||||
|
||||
The contents of `prepend.md` will be added after the front matter and info text, while the contents of `append.md` will be added at the end of the document.
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ class GenerateDocumentationTest extends TestCase
|
||||
]);
|
||||
$this->artisan('scribe:generate');
|
||||
|
||||
$generatedMarkdown = $this->getFileContents(__DIR__ . '/../resources/docs/source/groups/group-a.md');
|
||||
$generatedMarkdown = $this->getFileContents(__DIR__ . '/../resources/docs/groups/group-a.md');
|
||||
$this->assertContainsIgnoringWhitespace('"Authorization": "customAuthToken","Custom-Header":"NotSoCustom"', $generatedMarkdown);
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ class GenerateDocumentationTest extends TestCase
|
||||
config(['scribe.routes.0.prefixes' => ['api/*']]);
|
||||
$this->artisan('scribe:generate');
|
||||
|
||||
$generatedMarkdown = file_get_contents(__DIR__ . '/../resources/docs/source/groups/group-a.md');
|
||||
$generatedMarkdown = file_get_contents(__DIR__ . '/../resources/docs/groups/group-a.md');
|
||||
$this->assertStringContainsString('Лорем ипсум долор сит амет', $generatedMarkdown);
|
||||
}
|
||||
|
||||
@@ -381,8 +381,8 @@ class GenerateDocumentationTest extends TestCase
|
||||
config(['scribe.routes.0.prefixes' => ['api/*']]);
|
||||
$this->artisan('scribe:generate');
|
||||
|
||||
$this->assertFileExists(__DIR__ . '/../resources/docs/source/groups/1-group-1.md');
|
||||
$this->assertFileExists(__DIR__ . '/../resources/docs/source/groups/2-group-2.md');
|
||||
$this->assertFileExists(__DIR__ . '/../resources/docs/source/groups/10-group-10.md');
|
||||
$this->assertFileExists(__DIR__ . '/../resources/docs/groups/1-group-1.md');
|
||||
$this->assertFileExists(__DIR__ . '/../resources/docs/groups/2-group-2.md');
|
||||
$this->assertFileExists(__DIR__ . '/../resources/docs/groups/10-group-10.md');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user