diff --git a/.gitignore b/.gitignore index d3db2080..53e74c8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ doc/html/ vendor/ +zf-mkdoc-theme/ clover.xml composer.lock coveralls-upload.json +zf-mkdoc-theme.tgz diff --git a/.travis.yml b/.travis.yml index 139d6beb..8b82d792 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,17 @@ language: php cache: directories: - $HOME/.composer/cache + - $HOME/.local - vendor + - zf-mkdoc-theme + +env: + global: + - SITE_URL: https://zendframework.github.io/zend-expressive + - GH_USER_NAME: "Matthew Weier O'Phinney" + - GH_USER_EMAIL: matthew@weierophinney.net + - GH_REF: github.com/zendframework/zend-expressive.git + - secure: "C3RfQG69KAbqQqyQAgF6LhPvIpy5zSk0XnILvGEbcDoB36gg6/OcEHFCfFGdDZdSc3itDwwt65eiCVvKC4K5deuvqbCR1gAHAacYpW4jDV4fVaO40eiqZmQ7BZ1LHBQssJsa46yd0lwMmnj7V1Gya8MhD7ga5LINUe6ZxGzgo2Y3XRSWUzYcIiiGbCXXTgix8yG4de+Z5batsx0aT+99E0+U0DVB+DGoVaWRNwOY0UNdggTaKG0ahPJczlMsMsXyafop7LVAsYdIvaYoOMC8gshB/tket+q0b+61i9zaDtQv+x0oWvkobyDksr24jYkLAKMMQGFBq1cVJElVbNHSdtY0dLunpnQn9iaZ8PW8IhIw83YeyR9KPgbX3bF9SRt+Eay2j/YB2RbNK5BG2c/NeidnflMjcjPEhA4Ab6f0N1vy9wex5w/FAJUrhpfQB6AZgIJ/wovnJJAvF1etBSfZ0CYA+oAzYRRFQXo5Eq+lxvX5mQ2w2+sv6sUBS0IoP+1+JKzR98k2pi+q+4HhVVPH28aRfr8PTR/YRCmcUK68H7OKWf8h1vuJYjtN3V5FBOhlej8N9cYqQUBj4YpITqYP0PdzE1iUOoDpZVBMlWqxYw1vKhNiWusMCdJlI1psGWNs9t7hrMpJCg9eRWCe16akEoRrZGreU53ekFZpgeEQgGI=" matrix: fast_finish: true @@ -13,36 +23,41 @@ matrix: - php: 5.5 env: - EXECUTE_CS_CHECK=true - - EXECUTE_DOC_CHECK=true - php: 5.6 env: - EXECUTE_TEST_COVERALLS=true + - DEPLOY_DOCS=true - php: 7 - - php: hhvm + - php: hhvm allow_failures: - php: hhvm before_install: + - export PATH="$HOME/.local/bin:$PATH" - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - composer self-update - - if [[ $EXECUTE_DOC_CHECK == 'true' ]]; then composer require --dev --no-update phly/bookdown2mkdocs ; fi - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls:dev-master ; fi install: - travis_retry composer install --no-interaction - composer info -i -before_script: - - if [[ $EXECUTE_DOC_CHECK == 'true' ]]; then cp mkdocs.yml mkdocs.yml.orig ; fi - script: - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer test-coverage ; fi - if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then composer test ; fi - if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs ; fi - - if [[ $EXECUTE_DOC_CHECK == 'true' ]]; then make mkdocs ; diff mkdocs.yml mkdocs.yml.orig ; return $? ; fi after_script: - if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer coveralls ; fi +after_success: + - export DEPLOY=$(if [[ $DEPLOY_DOCS == 'true' && $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n "true" ; else echo -n "false" ; fi) + - export NEEDS_THEME=$([ -d zf-mkdoc-theme/theme ] ; result=$? ; if (( result == 0 )); then echo -n "false"; else echo -n "true" ; fi) + - if [[ $DEPLOY == "true" ]]; then pip install --user mkdocs ; fi + - if [[ $DEPLOY == "true" ]]; then pip install --user pymdown-extensions ; fi + - if [[ $DEPLOY == "true" && $NEEDS_THEME == "true" ]]; then echo "Downloading zf-mkdoc-theme" ; $(if [[ ! -d zf-mkdoc-theme ]];then mkdir zf-mkdoc-theme ; fi) ; $(curl -s -L https://github.com/zendframework/zf-mkdoc-theme/releases/latest | egrep -o '/zendframework/zf-mkdoc-theme/archive/[0-9]*\.[0-9]*\.[0-9]*.tar.gz' | head -n1 | wget -O zf-mkdoc-theme.tgz --base=https://github.com/ -i -) ; $(cd zf-mkdoc-theme ; tar xzf ../zf-mkdoc-theme.tgz --strip-components=1) ; echo "Finished downloading and installing zf-mkdoc-theme" ; fi + - export CAN_DEPLOY=$([ -f zf-mkdoc-theme/deploy.sh ] ; result=$? ; if (( result == 0 )); then echo -n "true"; else echo -n "false" ; fi) + - if [[ $DEPLOY == "true" && $CAN_DEPLOY == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; else echo "Missing deployment script" ; fi + notifications: email: true diff --git a/Makefile b/Makefile deleted file mode 100644 index 56d507c0..00000000 --- a/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# zend-expressive Makefile -# -# Primary purpose is for generating the mkdocs.yml from the bookdown.json -# sources. -# -# Configurable variables: -# - BOOKDOWN2MKDOCS - specify the path to the executable; defaults to -# ./vendor/bin/bookdown2mkdocs -# -# Available targets: -# - mkdocs - regenerate mkdocs.yml -# - all - synonym for mkdocs target - -BOOKDOWN2MKDOCS?=$(CURDIR)/vendor/bin/bookdown2mkdocs.php - -.PHONY : all mkdocs bookdown2mkdocs - -all : mkdocs - -mkdocs : - @echo "Generating mkdocs.yml from bookdown.json..." - -$(BOOKDOWN2MKDOCS) convert --site-name=zend-expressive --repo-url=https://github.com/zendframework/zend-expressive --copyright-url=http://www.zend.com/ --copyright-author="Zend Technologies USA Inc." - @echo "[DONE] Generating mkdocs.yml from bookdown.json" diff --git a/README.md b/README.md index 4a3f0507..b1d09716 100644 --- a/README.md +++ b/README.md @@ -83,20 +83,14 @@ documentation. ## Documentation -Documentation is [in the doc tree](doc/), and can be compiled using [bookdown](http://bookdown.io): +Documentation is [in the doc tree](doc/book/), and can be compiled using [mkdocs](http://www.mkdocs.org): ```bash -$ bookdown doc/bookdown.json -$ php -S 0.0.0.0:8080 -t doc/html/ # then browse to http://localhost:8080/ +$ mkdocs build ``` -> ### 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`. - Additionally, public-facing, browseable documentation is available at -http://zend-expressive.rtfd.org. +https://zendframework.github.io/zend-expressive/ ## Architecture diff --git a/doc/book/container/bookdown.json b/doc/book/container/bookdown.json deleted file mode 100644 index f3ec1bbc..00000000 --- a/doc/book/container/bookdown.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "title": "Containers", - "content": [ - {"Introduction": "intro.md"}, - {"Container Factories": "factories.md"}, - {"Using zend-servicemanager": "zend-servicemanager.md"}, - {"Using Pimple": "pimple.md"}, - {"Using Aura.Di": "aura-di.md"} - ] -} diff --git a/doc/book/cookbook/bookdown.json b/doc/book/cookbook/bookdown.json deleted file mode 100644 index 52cb5269..00000000 --- a/doc/book/cookbook/bookdown.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "title": "Cookbook", - "content": [ - {"Prepending a common path to all routes": "common-prefix-for-routes.md"}, - {"Route-specific middleware pipelines": "route-specific-pipeline.md"}, - {"Setting custom 404 page handling": "custom-404-page-handling.md"}, - {"Registering custom view helpers when using zend-view": "using-custom-view-helpers.md"}, - {"Using zend-form view helpers": "using-zend-form-view-helpers.md"}, - {"Using Expressive from a subdirectory": "using-a-base-path.md"}, - {"Building modular applications": "modular-layout.md"}, - {"Setting a locale based on a routing parameter": "setting-locale-depending-routing-parameter.md"}, - {"Setting a locale without a routing parameter": "setting-locale-without-routing-parameter.md"}, - {"Enabling debug toolbars": "debug-toolbars.md"}, - {"Handling multiple routes in a single class": "using-routed-middleware-class-as-controller.md"} - ] -} diff --git a/doc/book/cookbook/common-prefix-for-routes.md b/doc/book/cookbook/common-prefix-for-routes.md index 5a8e2bf8..e04f5f7b 100644 --- a/doc/book/cookbook/common-prefix-for-routes.md +++ b/doc/book/cookbook/common-prefix-for-routes.md @@ -19,7 +19,7 @@ As your application progresses, you may have a mixture of different content, and the above segregated under the path `/api`. This is essentially the same problem as addressed in the -["Segregating your application to a subpath"](../usage-examples.md#segregating-your-application-to-a-subpath) example. +["Segregating your application to a subpath"](../reference/usage-examples.md#segregating-your-application-to-a-subpath) example. To accomplish it: diff --git a/doc/book/cookbook/custom-404-page-handling.md b/doc/book/cookbook/custom-404-page-handling.md index 04ea4ade..89937bc7 100644 --- a/doc/book/cookbook/custom-404-page-handling.md +++ b/doc/book/cookbook/custom-404-page-handling.md @@ -1,7 +1,7 @@ # How can I set custom 404 page handling? In some cases, you may want to handle 404 errors separately from the -[final handler](../error-handling.md). This can be done by registering +[final handler](../features/error-handling.md). This can be done by registering middleware that operates late — specifically, after the routing middleware. Such middleware will be executed if no other middleware has executed, and/or when all other middleware calls `return $next()` @@ -78,7 +78,7 @@ that does not rely on the final handler. ## Registering custom 404 handlers We can register either `Application\NotFound` class above as service in the -[service container](../container/intro.md). In the case of the second approach, +[service container](../features/container/intro.md). In the case of the second approach, you would also need to provide a factory for creating the middleware (to ensure you inject the template renderer). diff --git a/doc/book/application.md b/doc/book/features/application.md similarity index 100% rename from doc/book/application.md rename to doc/book/features/application.md diff --git a/doc/book/container/aura-di.md b/doc/book/features/container/aura-di.md similarity index 100% rename from doc/book/container/aura-di.md rename to doc/book/features/container/aura-di.md diff --git a/doc/book/container/factories.md b/doc/book/features/container/factories.md similarity index 100% rename from doc/book/container/factories.md rename to doc/book/features/container/factories.md diff --git a/doc/book/container/intro.md b/doc/book/features/container/intro.md similarity index 100% rename from doc/book/container/intro.md rename to doc/book/features/container/intro.md diff --git a/doc/book/container/pimple.md b/doc/book/features/container/pimple.md similarity index 100% rename from doc/book/container/pimple.md rename to doc/book/features/container/pimple.md diff --git a/doc/book/container/zend-servicemanager.md b/doc/book/features/container/zend-servicemanager.md similarity index 100% rename from doc/book/container/zend-servicemanager.md rename to doc/book/features/container/zend-servicemanager.md diff --git a/doc/book/emitters.md b/doc/book/features/emitters.md similarity index 100% rename from doc/book/emitters.md rename to doc/book/features/emitters.md diff --git a/doc/book/error-handling.md b/doc/book/features/error-handling.md similarity index 100% rename from doc/book/error-handling.md rename to doc/book/features/error-handling.md diff --git a/doc/book/helpers/body-parse.md b/doc/book/features/helpers/body-parse.md similarity index 100% rename from doc/book/helpers/body-parse.md rename to doc/book/features/helpers/body-parse.md diff --git a/doc/book/helpers/intro.md b/doc/book/features/helpers/intro.md similarity index 100% rename from doc/book/helpers/intro.md rename to doc/book/features/helpers/intro.md diff --git a/doc/book/helpers/server-url-helper.md b/doc/book/features/helpers/server-url-helper.md similarity index 100% rename from doc/book/helpers/server-url-helper.md rename to doc/book/features/helpers/server-url-helper.md diff --git a/doc/book/helpers/url-helper.md b/doc/book/features/helpers/url-helper.md similarity index 100% rename from doc/book/helpers/url-helper.md rename to doc/book/features/helpers/url-helper.md diff --git a/doc/book/router/aura.md b/doc/book/features/router/aura.md similarity index 100% rename from doc/book/router/aura.md rename to doc/book/features/router/aura.md diff --git a/doc/book/router/fast-route.md b/doc/book/features/router/fast-route.md similarity index 100% rename from doc/book/router/fast-route.md rename to doc/book/features/router/fast-route.md diff --git a/doc/book/router/interface.md b/doc/book/features/router/interface.md similarity index 100% rename from doc/book/router/interface.md rename to doc/book/features/router/interface.md diff --git a/doc/book/router/intro.md b/doc/book/features/router/intro.md similarity index 100% rename from doc/book/router/intro.md rename to doc/book/features/router/intro.md diff --git a/doc/book/router/piping.md b/doc/book/features/router/piping.md similarity index 100% rename from doc/book/router/piping.md rename to doc/book/features/router/piping.md diff --git a/doc/book/router/result-observers.md b/doc/book/features/router/result-observers.md similarity index 100% rename from doc/book/router/result-observers.md rename to doc/book/features/router/result-observers.md diff --git a/doc/book/router/uri-generation.md b/doc/book/features/router/uri-generation.md similarity index 100% rename from doc/book/router/uri-generation.md rename to doc/book/features/router/uri-generation.md diff --git a/doc/book/router/zf2.md b/doc/book/features/router/zf2.md similarity index 100% rename from doc/book/router/zf2.md rename to doc/book/features/router/zf2.md diff --git a/doc/book/template/interface.md b/doc/book/features/template/interface.md similarity index 100% rename from doc/book/template/interface.md rename to doc/book/features/template/interface.md diff --git a/doc/book/template/intro.md b/doc/book/features/template/intro.md similarity index 100% rename from doc/book/template/intro.md rename to doc/book/features/template/intro.md diff --git a/doc/book/template/middleware.md b/doc/book/features/template/middleware.md similarity index 100% rename from doc/book/template/middleware.md rename to doc/book/features/template/middleware.md diff --git a/doc/book/template/plates.md b/doc/book/features/template/plates.md similarity index 100% rename from doc/book/template/plates.md rename to doc/book/features/template/plates.md diff --git a/doc/book/template/twig.md b/doc/book/features/template/twig.md similarity index 100% rename from doc/book/template/twig.md rename to doc/book/features/template/twig.md diff --git a/doc/book/template/zend-view.md b/doc/book/features/template/zend-view.md similarity index 100% rename from doc/book/template/zend-view.md rename to doc/book/features/template/zend-view.md diff --git a/doc/book/features.md b/doc/book/getting-started/features.md similarity index 97% rename from doc/book/features.md rename to doc/book/getting-started/features.md index 9f39ea76..1ecd4bd7 100644 --- a/doc/book/features.md +++ b/doc/book/getting-started/features.md @@ -69,7 +69,7 @@ features it provides include: Below is a diagram detailing the workflow used by Expressive. -![Expressive Architectural Flow](images/architecture.png) +![Expressive Architectural Flow](../images/architecture.png) The `Application` acts as an "onion"; in the diagram above, the top is the outer-most layer of the onion, while the bottom is the inner-most. @@ -151,7 +151,7 @@ will execute in one of two conditions: - routed middleware called on the next middleware instead of returning a response. As such, the largest use case for such middleware is for error handling. -One possibility is for [providing custom 404 handling](cookbook/custom-404-page-handling.md), +One possibility is for [providing custom 404 handling](../cookbook/custom-404-page-handling.md), or handling application-specific error conditions (such as authentication or authorization failures). diff --git a/doc/book/quick-start-skeleton.md b/doc/book/getting-started/skeleton.md similarity index 97% rename from doc/book/quick-start-skeleton.md rename to doc/book/getting-started/skeleton.md index 601289c5..a51638a9 100644 --- a/doc/book/quick-start-skeleton.md +++ b/doc/book/getting-started/skeleton.md @@ -271,7 +271,7 @@ Congratulations! You've now created your application, and started writing middleware! It's time to start learning about the rest of the features of Expressive: -- [Containers](container/intro.md) -- [Routing](router/intro.md) -- [Templating](template/intro.md) -- [Error Handling](error-handling.md) +- [Containers](../features/container/intro.md) +- [Routing](../features/router/intro.md) +- [Templating](../features/template/intro.md) +- [Error Handling](../features/error-handling.md) diff --git a/doc/book/quick-start.md b/doc/book/getting-started/standalone.md similarity index 90% rename from doc/book/quick-start.md rename to doc/book/getting-started/standalone.md index 12bf701a..936f8c58 100644 --- a/doc/book/quick-start.md +++ b/doc/book/getting-started/standalone.md @@ -2,7 +2,7 @@ Expressive allows you to get started at your own pace. You can start with the simplest example, detailed below, or move on to a more structured, -configuration-driven approach as detailed in the [use case examples](usage-examples.md). +configuration-driven approach as detailed in the [use case examples](../reference/usage-examples.md). ## 1. Create a new project directory @@ -113,10 +113,10 @@ http://localhost:8080/ to see if your application responds correctly! At this point, you have a working zend-expressive application, that responds to a single route. From here, you may want to read up on: -- [Applications](application.md) -- [Containers](container/intro.md) -- [Routing](router/intro.md) -- [Templating](template/intro.md) -- [Error Handling](error-handling.md) +- [Applications](../features/application.md) +- [Containers](../features/container/intro.md) +- [Routing](../features/router/intro.md) +- [Templating](../features/template/intro.md) +- [Error Handling](../features/error-handling.md) -Additionally, we have more [use case examples](usage-examples.md). +Additionally, we have more [use case examples](../reference/usage-examples.md). diff --git a/doc/book/helpers/bookdown.json b/doc/book/helpers/bookdown.json deleted file mode 100644 index 61f2c583..00000000 --- a/doc/book/helpers/bookdown.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "title": "Helpers", - "content": [ - {"Introduction": "intro.md"}, - {"UrlHelper": "url-helper.md"}, - {"ServerUrlHelper": "server-url-helper.md"}, - {"Body Parsing Middleware": "body-parse.md"} - ] -} diff --git a/doc/book/images/checkmark.png b/doc/book/images/checkmark.png new file mode 100644 index 00000000..e2107e55 Binary files /dev/null and b/doc/book/images/checkmark.png differ diff --git a/doc/book/images/installer.png b/doc/book/images/installer.png new file mode 100644 index 00000000..c662e24b Binary files /dev/null and b/doc/book/images/installer.png differ diff --git a/doc/book/images/lambda.png b/doc/book/images/lambda.png new file mode 100644 index 00000000..f17f9e0a Binary files /dev/null and b/doc/book/images/lambda.png differ diff --git a/doc/book/images/nodes.png b/doc/book/images/nodes.png new file mode 100644 index 00000000..84f2566f Binary files /dev/null and b/doc/book/images/nodes.png differ diff --git a/doc/book/images/pencil.png b/doc/book/images/pencil.png new file mode 100644 index 00000000..3313b44a Binary files /dev/null and b/doc/book/images/pencil.png differ diff --git a/doc/book/images/syringe.png b/doc/book/images/syringe.png new file mode 100644 index 00000000..969ed4e8 Binary files /dev/null and b/doc/book/images/syringe.png differ diff --git a/doc/book/images/warning.png b/doc/book/images/warning.png new file mode 100644 index 00000000..b43e2890 Binary files /dev/null and b/doc/book/images/warning.png differ diff --git a/doc/book/index.html b/doc/book/index.html new file mode 100644 index 00000000..01595ca9 --- /dev/null +++ b/doc/book/index.html @@ -0,0 +1,171 @@ +
+
+

Expressive

+ +

PSR-7 Middleware in Minutes

+
+
+ +
+
+
+
+ PSR-7
+ +

PSR-7

+ +

+ Built to consume PSR-7! +

+
+
+ +
+
+ Middleware
+ +

Middleware

+ +

+ Create middleware + applications, using as many layers as you want, and the architecture + your project needs. +

+
+
+ +
+
+ Routing
+ +

Routing

+ +

+ Route requests to middleware using the routing library of your choice. +

+
+
+
+ +
+
+
+ Dependency Injection
+ +

Dependency Injection

+ +

+ Make your code flexible and robust, using the + dependency injection container of your choice. +

+
+
+ +
+
+ Templating
+ +

Templating

+ +

+ Create templated responses, using + a variety of template engines. +

+
+
+ +
+
+ Error Handling
+ +

Error Handling

+ +

+ Handle errors gracefully, using + templated error pages, whoops, + or your own solution! +

+
+
+
+
+ +
+
+

Get Started Now!

+ +

Installation is only a Composer command away!

+ +

+$ composer create-project -s rc zendframework/zend-expressive-skeleton expressive
+    
+ +

Choose what you want

+ +

+ Expressive provides interfaces for routing and templating, letting you + choose what to use, and how you want to implement it. +

+ +

+ Our unique installer allows you to select your choices when starting + your project! +

+ +
+
+ Expressive Installer
+
+ + +
+ +

Applications, Simplified

+ +
+
+

Write middleware:

+ +

+$pathMiddleware = function (
+    ServerRequestInterface $request,
+    ResponseInterface $response,
+    callable $next
+) {
+    $uri  = $request->getUri();
+    $path = $uri->getPath();
+
+    $response->getBody()->write('You visited ' . $path);
+    return $next($request, $response->withHeader('X-Path', $path));
+};
+    
+ +

And add it to an application:

+ +

+$app->get('/path', $pathMiddleware);
+          
+
+ + +
+
+
+ +
+
+

Learn more

+ + + +

Or use the menu to navigate to the section you're interested in.

+
+
diff --git a/doc/book/index.md b/doc/book/index.md deleted file mode 120000 index fe840054..00000000 --- a/doc/book/index.md +++ /dev/null @@ -1 +0,0 @@ -../../README.md \ No newline at end of file diff --git a/doc/book/index.md b/doc/book/index.md new file mode 100644 index 00000000..fb64eb90 --- /dev/null +++ b/doc/book/index.md @@ -0,0 +1,30 @@ +# Expressive: PSR-7 Middleware in Minutes + +Expressive builds on [Stratigility](https://github.com/zendframework/zend-stratigility) +to provide a minimalist [PSR-7](http://www.php-fig.org/psr/psr-7/) middleware +framework for PHP, with the following features: + +- Routing. Choose your own router; we support: + - [Aura.Router](https://github.com/auraphp/Aura.Router) + - [FastRoute](https://github.com/nikic/FastRoute) + - [ZF2's MVC router](https://github.com/zendframework/zend-mvc) +- DI Containers, via [container-interop](https://github.com/container-interop/container-interop). + All middleware composed in Expressive may be retrieved from the composed + container. +- Optionally, templating. We support: + - [Plates](http://platesphp.com/) + - [Twig](http://twig.sensiolabs.org/) + - [ZF2's PhpRenderer](https://github.com/zendframework/zend-view) +- Error handling. Create templated error pages, or use tools like + [whoops](https://github.com/filp/whoops) for debugging purposes. +- Nested middleware applications. Write an application, and compose it later + in another, optionally under a separate subpath. +- [Simplfied installation](getting-started/skeleton.md). Our custom + [Composer](https://getcomposer.org)-based installer prompts you for your + initial stack choices, giving you exactly the base you want to start from. + +Essentially, Expressive allows *you* to develop using the tools *you* prefer, +and provides minimal structure and facilities to ease your development. + +[Keep reading](getting-started/features.md), and get started writing your first +middleware application today! diff --git a/doc/book/migration/bookdown.json b/doc/book/migration/bookdown.json deleted file mode 100644 index 3dc87476..00000000 --- a/doc/book/migration/bookdown.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "title": "Migration", - "content": [ - {"From RC5 and Earlier": "rc-to-v1.md"} - ] -} - diff --git a/doc/book/expressive-projects.md b/doc/book/reference/expressive-projects.md similarity index 100% rename from doc/book/expressive-projects.md rename to doc/book/reference/expressive-projects.md diff --git a/doc/book/migration/rc-to-v1.md b/doc/book/reference/migration/rc-to-v1.md similarity index 100% rename from doc/book/migration/rc-to-v1.md rename to doc/book/reference/migration/rc-to-v1.md diff --git a/doc/book/usage-examples.md b/doc/book/reference/usage-examples.md similarity index 98% rename from doc/book/usage-examples.md rename to doc/book/reference/usage-examples.md index c033534e..9fa99993 100644 --- a/doc/book/usage-examples.md +++ b/doc/book/reference/usage-examples.md @@ -18,7 +18,7 @@ In all examples, the assumption is the following directory structure: We assume also that: -- You have installed zend-expressive per the [installation instructions](index.md#installation). +- You have installed zend-expressive per the [installation instructions](../index.md#installation). - `public/` will be the document root of your application. - Your own classes are under `src/` with the top-level namespace `Application`, and you have configured [autoloading](https://getcomposer.org/doc/01-basic-usage.md#autoloading) in your `composer.json` for those classes. @@ -59,7 +59,7 @@ We assume also that: ### Routing -As noted in the [Application documentation](application.md#adding-routable-middleware), +As noted in the [Application documentation](../features/application.md#adding-routable-middleware), routing is abstracted and can be accomplished by calling any of the following methods: @@ -241,7 +241,7 @@ $app->run(); This is a nice way to encapsulate the application creation. You could then potentially move all service configuration to another file! (We already -[document an ApplicationFactory for exactly this scenario.](container/factories.md#applicationfactory)) +[document an ApplicationFactory for exactly this scenario.](../features/container/factories.md#applicationfactory)) ## Hello World using a Configuration-Driven Container diff --git a/doc/book/router/bookdown.json b/doc/book/router/bookdown.json deleted file mode 100644 index 24195bd6..00000000 --- a/doc/book/router/bookdown.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "title": "Routing Adapters", - "content": [ - {"Introduction": "intro.md"}, - {"Routing Interface": "interface.md"}, - {"URI Generation": "uri-generation.md"}, - {"Route Result Observers": "result-observers.md"}, - {"Routing vs Piping": "piping.md"}, - {"Using Aura": "aura.md"}, - {"Using FastRoute": "fast-route.md"}, - {"Using the ZF2 Router": "zf2.md"} - ] -} diff --git a/doc/book/template/bookdown.json b/doc/book/template/bookdown.json deleted file mode 100644 index b21e50ed..00000000 --- a/doc/book/template/bookdown.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "title": "Templating", - "content": [ - {"Introduction": "intro.md"}, - {"Template Renderer Interface": "interface.md"}, - {"Templated Middleware": "middleware.md"}, - {"Using Plates": "plates.md"}, - {"Using Twig": "twig.md"}, - {"Using zend-view": "zend-view.md"} - ] -} diff --git a/doc/bookdown.json b/doc/bookdown.json deleted file mode 100644 index 85a1d28d..00000000 --- a/doc/bookdown.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "title": "zend-expressive: PSR-7 Middleware Microframework", - "content": [ - {"Intro": "../README.md"}, - {"Overview and Features": "book/features.md"}, - {"Quick Start: Skeleton + Installer": "book/quick-start-skeleton.md"}, - {"Quick Start: Standalone": "book/quick-start.md"}, - {"Applications": "book/application.md"}, - "book/container/bookdown.json", - "book/router/bookdown.json", - "book/template/bookdown.json", - {"Error Handling": "book/error-handling.md"}, - "book/helpers/bookdown.json", - {"Emitters": "book/emitters.md"}, - {"Examples": "book/usage-examples.md"}, - "book/cookbook/bookdown.json", - {"Expressive Projects": "book/expressive-projects.md"}, - "book/migration/bookdown.json" - ], - "target": "./html" -} diff --git a/mkdocs.yml b/mkdocs.yml index 0a3b85ff..669656c7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -2,21 +2,59 @@ docs_dir: doc/book site_dir: doc/html pages: - index.md - - { 'Overview and Features': features.md } - - { 'Quick Start: Skeleton + Installer': quick-start-skeleton.md } - - { 'Quick Start: Standalone': quick-start.md } - - { Applications: application.md } - - { Containers: [{ Introduction: container/intro.md }, { 'Container Factories': container/factories.md }, { 'Using zend-servicemanager': container/zend-servicemanager.md }, { 'Using Pimple': container/pimple.md }, { 'Using Aura.Di': container/aura-di.md }] } - - { 'Routing Adapters': [{ Introduction: router/intro.md }, { 'Routing Interface': router/interface.md }, { 'URI Generation': router/uri-generation.md }, { 'Route Result Observers': router/result-observers.md }, { 'Routing vs Piping': router/piping.md }, { 'Using Aura': router/aura.md }, { 'Using FastRoute': router/fast-route.md }, { 'Using the ZF2 Router': router/zf2.md }] } - - { Templating: [{ Introduction: template/intro.md }, { 'Template Renderer Interface': template/interface.md }, { 'Templated Middleware': template/middleware.md }, { 'Using Plates': template/plates.md }, { 'Using Twig': template/twig.md }, { 'Using zend-view': template/zend-view.md }] } - - { 'Error Handling': error-handling.md } - - { Helpers: [{ Introduction: helpers/intro.md }, { UrlHelper: helpers/url-helper.md }, { ServerUrlHelper: helpers/server-url-helper.md }, { 'Body Parsing Middleware': helpers/body-parse.md }] } - - { Emitters: emitters.md } - - { Examples: usage-examples.md } - - { Cookbook: [{ 'Prepending a common path to all routes': cookbook/common-prefix-for-routes.md }, { 'Route-specific middleware pipelines': cookbook/route-specific-pipeline.md }, { 'Setting custom 404 page handling': cookbook/custom-404-page-handling.md }, { 'Registering custom view helpers when using zend-view': cookbook/using-custom-view-helpers.md }, { 'Using zend-form view helpers': cookbook/using-zend-form-view-helpers.md }, { 'Using Expressive from a subdirectory': cookbook/using-a-base-path.md }, { 'Building modular applications': cookbook/modular-layout.md }, { 'Setting a locale based on a routing parameter': cookbook/setting-locale-depending-routing-parameter.md }, { 'Setting a locale without a routing parameter': cookbook/setting-locale-without-routing-parameter.md }, { 'Enabling debug toolbars': cookbook/debug-toolbars.md }, { 'Handling multiple routes in a single class': cookbook/using-routed-middleware-class-as-controller.md }] } - - { 'Expressive Projects': expressive-projects.md } - - { Migration: [{ 'From RC5 and Earlier': migration/rc-to-v1.md }] } -site_name: zend-expressive + - 'Getting Started': + - 'Overview and Features': getting-started/features.md + - 'Quick Start: Standalone': getting-started/standalone.md + - 'Quick Start: Skeleton Installer': getting-started/skeleton.md + - Features: + - Applications: features/application.md + - Containers: + - Introduction: features/container/intro.md + - 'Container Factories': features/container/factories.md + - 'Using zend-servicemanager': features/container/zend-servicemanager.md + - 'Using Pimple': features/container/pimple.md + - 'Using Aura.Di': features/container/aura-di.md + - 'Routing Adapters': + - Introduction: features/router/intro.md + - 'Routing Interface': features/router/interface.md + - 'URI Generation': features/router/uri-generation.md + - 'Route Result Observers': features/router/result-observers.md + - 'Routing vs Piping': features/router/piping.md + - 'Using Aura': features/router/aura.md + - 'Using FastRoute': features/router/fast-route.md + - 'Using the ZF2 Router': features/router/zf2.md + - Templating: + - Introduction: features/template/intro.md + - 'Template Renderer Interface': features/template/interface.md + - 'Templated Middleware': features/template/middleware.md + - 'Using Plates': features/template/plates.md + - 'Using Twig': features/template/twig.md + - 'Using zend-view': features/template/zend-view.md + - 'Error Handling': features/error-handling.md + - Helpers: + - Introduction: features/helpers/intro.md + - UrlHelper: features/helpers/url-helper.md + - ServerUrlHelper: features/helpers/server-url-helper.md + - 'Body Parsing Middleware': features/helpers/body-parse.md + - Emitters: features/emitters.md + - Cookbook: + - 'Prepending a common path to all routes': cookbook/common-prefix-for-routes.md + - 'Route-specific middleware pipelines': cookbook/route-specific-pipeline.md + - 'Setting custom 404 page handling': cookbook/custom-404-page-handling.md + - 'Registering custom view helpers when using zend-view': cookbook/using-custom-view-helpers.md + - 'Using zend-form view helpers': cookbook/using-zend-form-view-helpers.md + - 'Using Expressive from a subdirectory': cookbook/using-a-base-path.md + - 'Building modular applications': cookbook/modular-layout.md + - 'Setting a locale based on a routing parameter': cookbook/setting-locale-depending-routing-parameter.md + - 'Setting a locale without a routing parameter': cookbook/setting-locale-without-routing-parameter.md + - 'Enabling debug toolbars': cookbook/debug-toolbars.md + - 'Handling multiple routes in a single class': cookbook/using-routed-middleware-class-as-controller.md + - Reference: + - Examples: reference/usage-examples.md + - 'Expressive Projects': reference/expressive-projects.md + - Migration: + - 'From RC5 and Earlier': reference/migration/rc-to-v1.md +site_name: Expressive site_description: 'zend-expressive: PSR-7 Middleware Microframework' repo_url: 'https://github.com/zendframework/zend-expressive' copyright: 'Copyright (c) 2016 Zend Technologies USA Inc.'