Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Prepared documentation for publication
Browse files Browse the repository at this point in the history
- Converted from bookdown to mkdocs.
- Replaced `--` sequences with `—`
- Added documentation build automation.
  • Loading branch information
weierophinney committed Apr 28, 2016
1 parent 452b01b commit d1f47d5
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 38 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
doc/html/
vendor/
zf-mkdoc-theme/
composer.lock
phpunit.xml
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ cache:
directories:
- $HOME/.composer/cache
- vendor
- $HOME/.local
- zf-mkdoc-theme

env:
global:
- SITE_URL: https://zendframework.github.io/zend-diactoros
- GH_USER_NAME: "Matthew Weier O'Phinney"
- GH_USER_EMAIL: [email protected]
- GH_REF: github.com/zendframework/zend-diactoros.git
- secure: "abqt51VvId/3EvfymODyivOye2YNlTXPMNk297kM3G5bMxB7ILPUwwSTxfMHoiW9BHjJpdKi+IGBF4GKeYElQHdIwleyLow8dTCpUiJS3RogwaTcm2FbwEJDCFbkV4WRm/HHjriji/wBfBmaAJEfYYlLQAHQWTT7AK7dAgQmiAzaItStl2TV5D/XZU9GLNXay3nH0cDygf+g4t6rFcf3VsI5weHb3WhjATfN+mU82XXkwm2z8Pc1IglBYHskdlwUgbsz8ppTdXplXdKjnf6YdxPapYDKd7TecIV3BWtueC2i48rqblPaSWOzx7qMCA/4aJjzEBmuqqSlYXka2SdGPdBPbpGwcKv09e273xqWQ9sF3d8YhEsSrJBpMpgu4RN+ucLRa15Xcj0oF4aVxrFqxtC7wud7hC0pg6q48dY7PlQh/wTO2biuXcGACcGqMcjPgmE3HJYpK5HoWHUBoWi1VHqbTPRx1jIQD1ILibu9WkuTEtdAi5IXSYAmVSknfyZ7UYJuJgOjhmmkMOcYzD5JJuRGEJASzQk1tX5DItX8mH/LIW942bVOQ+fwsmL/Z+tJDnMpJXLd6tXtyYs99lxFSBSSjqNGAG5HUFjVczvQy9GeeDd2p70IA80NuQNjfXrsyQ9tg8d1keNTOpPCJUwZm7S6IEsvrWAGO6lZ+q7DPQk="

matrix:
fast_finish: true
Expand All @@ -17,6 +27,8 @@ matrix:
- php: 5.6
env:
- EXECUTE_COVERAGE=true
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
- PATH="$HOME/.local/bin:$PATH"
- php: 7
- php: hhvm

Expand All @@ -37,6 +49,10 @@ script:
- if [[ $EXECUTE_COVERAGE == 'true' ]]; then composer test-coverage ; fi
- if [[ $EXECUTE_COVERAGE != 'true' ]]; then composer test ; fi
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs ; fi
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi

after_success:
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi

after_script:
- if [[ $EXECUTE_COVERAGE == 'true' ]]; then composer coveralls ; fi
22 changes: 5 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,11 @@ This package supercedes and replaces [phly/http](https://github.com/phly/http).

## Documentation

Documentation is [in the doc tree](doc/), and can be compiled using [bookdown](http://bookdown.io):

```console
$ bookdown doc/bookdown.json
$ php -S 0.0.0.0:8080 -t doc/html/ # then browse to http://localhost:8080/
```

> ### Bookdown
>
> You can install bookdown globally using `composer global require bookdown/bookdown`.
> If you do this, make sure that `$HOME/.composer/vendor/bin` is on your `$PATH`;
> on *nix-like systems, you can do this by adding the following line to your
> `.bashrc` (or preferred shell RC file):
>
> ```bash
> export PATH="$HOME/.composer/vendor/bin:$PATH"
> ```
Documentation is available at:

- https://zendframework.github.io/zend-diactoros/

Source files for documentation are [in the doc/ tree](doc/).

[Master]: https://travis-ci.org/zendframework/zend-diactoros
[Master image]: https://secure.travis-ci.org/zendframework/zend-diactoros.svg?branch=master
Expand Down
15 changes: 8 additions & 7 deletions doc/book/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class Request
}
```

Requests are immutable. Any methods that would change state -- those prefixed with `with` and
`without` -- all return a new instance with the changes requested.
Requests are immutable. Any methods that would change state — those prefixed with `with` and
`without` — all return a new instance with the changes requested.

## ServerRequest Message

Expand All @@ -45,8 +45,8 @@ class ServerRequest
}
```

The `ServerRequest` is immutable. Any methods that would change state -- those prefixed with `with`
and `without` -- all return a new instance with the changes requested. Server parameters are
The `ServerRequest` is immutable. Any methods that would change state — those prefixed with `with`
and `without` — all return a new instance with the changes requested. Server parameters are
considered completely immutable, however, as they cannot be recalculated, and, rather, is a source
for other values.

Expand All @@ -71,7 +71,7 @@ class Response
```

Like the `Request` and `ServerRequest`, responses are immutable. Any methods that would change state
-- those prefixed with `with` and `without` -- all return a new instance with the changes requested.
— those prefixed with `with` and `without` — all return a new instance with the changes requested.

### StringResponse (factory)

Expand Down Expand Up @@ -145,8 +145,9 @@ class Uri
}
```

Like the various message objects, URIs are immutable. Any methods that would change state -- those
prefixed with `with` and `without` -- all return a new instance with the changes requested.
Like the various message objects, URIs are immutable. Any methods that would
change state — those
prefixed with `with` and `without` — all return a new instance with the changes requested.

## Stream

Expand Down
10 changes: 10 additions & 0 deletions doc/book/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<div class="container">
<div class="jumbotron">
<h1>zend-diactoros</h1>

<p>PSR-7 HTTP message implementation.</p>

<pre><code class="language-bash">$ composer require zendframework/zend-diactoros</code></pre>
</div>
</div>

1 change: 1 addition & 0 deletions doc/book/index.md
2 changes: 1 addition & 1 deletion doc/book/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ For server-side applications, you will create a `ServerRequest` instance, and po

A client will _send_ a request, and _return_ a response. As a developer, you will _create_ and
_populate_ the request, and then _introspect_ the response. Both requests and responses are
immutable; if you make changes -- e.g., by calling setter methods -- you must capture the return
immutable; if you make changes &mdash; e.g., by calling setter methods &mdash; you must capture the return
value, as it is a new instance.

```php
Expand Down
13 changes: 0 additions & 13 deletions doc/bookdown.json

This file was deleted.

16 changes: 16 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
docs_dir: doc/book
site_dir: doc/html
pages:
- index.md
- Overview: overview.md
- Installation: install.md
- Usage: usage.md
- Reference:
- "Custom Responses": custom-responses.md
- "Emitting Responses": emitting-responses.md
- Serialization: serialization.md
- API: api.md
site_name: zend-diactoros
site_description: 'zend-diactoros: PSR-7 HTTP message implementation'
repo_url: 'https://github.com/zendframework/zend-diactoros'
copyright: 'Copyright (c) 2016 <a href="http://www.zend.com/">Zend Technologies USA Inc.</a>'

0 comments on commit d1f47d5

Please sign in to comment.