diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index f47870d..73b2006 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -3,8 +3,7 @@ name: docs-build on: release: types: [published] - repository_dispatch: - types: docs-build + workflow_dispatch: jobs: build-deploy: @@ -13,5 +12,5 @@ jobs: - name: Build Docs uses: laminas/documentation-theme/github-actions/docs@master env: - DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }} - "GITHUB_TOKEN": ${{ secrets.GITHUB_TOKEN }} + DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/docs/book/installation.md b/docs/book/installation.md new file mode 100644 index 0000000..be1198c --- /dev/null +++ b/docs/book/installation.md @@ -0,0 +1,5 @@ +# This Is Only a Placeholder + +The content of this page can be found under: + +https://github.com/laminas/documentation-theme/blob/master/theme/pages/installation.html diff --git a/docs/book/quick-start.md b/docs/book/quick-start.md index ebee60a..4cae8ae 100644 --- a/docs/book/quick-start.md +++ b/docs/book/quick-start.md @@ -1,16 +1,5 @@ # Quick Start -## Installation - -To install this package in your application, use -[Composer](https://getcomposer.org): - -```bash -$ composer require mezzio/mezzio-problem-details -``` - -## Usage - This package provides three primary mechanisms for creating and returning Problem Details responses: @@ -23,7 +12,7 @@ Problem Details responses: exceptions as problem details responses using the `ProblemDetailsResponseFactory`. -### ProblemDetailsResponseFactory +## ProblemDetailsResponseFactory If you are using [Mezzio](https://docs.mezzio.dev/mezzio/) and have installed [laminas-component-installer](https://docs.laminas.dev/laminas-component-installer) @@ -148,7 +137,7 @@ The above modifies the original example to add validation and, on failed validation, return a custom response that includes the validation failure messages. -### Custom Exceptions +## Custom Exceptions In the above examples, we have a `DomainException` that is used to create a Problem Details response. By default, in production mode, the factory will use @@ -236,7 +225,7 @@ class DomainException extends PhpDomainException implements ProblemDetailsExcept The data present in the generated exception will then be used by the `ProblemDetailsResponseFactory` to generate full Problem Details. -### Error handling +## Error handling When writing APIs, you may not want to handle every error or exception manually, or may not be aware of problems in your code that might lead to them. In such @@ -281,7 +270,7 @@ $app->post('/api/domain/transaction', [ ]); ``` -### Not Found handling +## Not Found handling When writing APIs you may also want 404 responses be in the accepted content-type. This package provides `ProblemDetailsNotFoundHandler` which will return a diff --git a/mkdocs.yml b/mkdocs.yml index eb13556..8bda464 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -3,6 +3,7 @@ site_dir: docs/html nav: - Home: index.md - Introduction: intro.md + - Installation: installation.md - "Quick Start": quick-start.md - Reference: - "Generating Responses": response.md @@ -15,3 +16,5 @@ site_description: 'Problem Details for PSR-7 HTTP APIs addressing the RFC 7807 s repo_url: 'https://github.com/mezzio/mezzio-problem-details' extra: project: Mezzio + installation: + config_provider_class: 'Mezzio\ProblemDetails\ConfigProvider'