Skip to content

Commit

Permalink
Merge pull request #48 from froschdesign/hotfix/docs/missing-installa…
Browse files Browse the repository at this point in the history
…tion-page

Adds missing installation page and updates quick start
  • Loading branch information
froschdesign authored Jan 18, 2024
2 parents 7871fdf + c4362ec commit b8b75be
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: docs-build
on:
release:
types: [published]
repository_dispatch:
types: docs-build
workflow_dispatch:

jobs:
build-deploy:
Expand All @@ -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 }}
5 changes: 5 additions & 0 deletions docs/book/installation.md
Original file line number Diff line number Diff line change
@@ -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
19 changes: 4 additions & 15 deletions docs/book/quick-start.md
Original file line number Diff line number Diff line change
@@ -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:

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'

0 comments on commit b8b75be

Please sign in to comment.