Skip to content

Commit

Permalink
Update documentation before release
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Oct 18, 2019
1 parent fbe7928 commit aef1cb8
Show file tree
Hide file tree
Showing 11 changed files with 157 additions and 70 deletions.
8 changes: 4 additions & 4 deletions docs/_data/packages.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package:
'uri':
name: 'uri'
version: '5.0'
latest: '5.3.0'
version: '6.0'
latest: '6.0.0'
documentation:
- '6.0'
- '5.0'
- '4.0'
'components':
name: 'uri-components'
version: '1.0'
latest: '1.8.2'
version: '2.0'
latest: '2.0.0'
documentation:
- '2.0'
- '1.0'
Expand Down
6 changes: 6 additions & 0 deletions docs/_data/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ author:
name: 'Ignace Nyamagana Butera'
twitter_account: 'nyamsprod'
support: 'Once a new major version is released, the previous stable release remains supported for six more months through patches and security fixes.'
deprecated:
'schemes': 'uri'
'manipulations': 'components'
'domain-parser': ''
'parser': 'uri'
'query-parser': 'components'
15 changes: 15 additions & 0 deletions docs/_includes/building-block.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">use</span> <span class="nx">League\Uri\Components\Query</span><span class="p">;</span>
<span class="k">use</span> <span class="nx">League\Uri\Uri</span><span class="p">;</span>
<span class="k">use</span> <span class="nx">League\Uri\UriModifier</span><span class="p">;</span>

<span class="nv">$uri</span> <span class="o">=</span> <span class="nx">Uri</span><span class="o">::</span><span class="na">createFromString</span><span class="p">(</span><span class="s1">'http://example.com?q=value#fragment'</span><span class="p">);</span>
<span class="nv">$newUri</span> <span class="o">=</span> <span class="nx">UriModifier</span><span class="o">::</span><span class="na">appendQuery</span><span class="p">(</span><span class="nv">$uri</span><span class="p">,</span> <span class="s1">'q=new.Value'</span><span class="p">);</span>
<span class="k">echo</span> <span class="nv">$newUri</span><span class="p">;</span> <span class="c1">// 'http://example.com?q=value&amp;q=new.Value#fragment';</span>

<span class="nv">$query</span> <span class="o">=</span> <span class="nx">Query</span><span class="o">::</span><span class="na">createFromUri</span><span class="p">(</span><span class="nv">$newUri</span><span class="p">);</span>
<span class="nv">$newQuery</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">'q'</span><span class="p">);</span> <span class="c1">// returns 'value'</span>
<span class="nv">$newQuery</span><span class="o">-&gt;</span><span class="na">getAll</span><span class="p">(</span><span class="s1">'q'</span><span class="p">);</span> <span class="c1">// returns ['value', 'new.Value']</span>
<span class="nv">$newQuery</span><span class="o">-&gt;</span><span class="na">params</span><span class="p">(</span><span class="s1">'q'</span><span class="p">);</span> <span class="c1">// returns 'new.Value'</span>
</code></pre></div></div>

<p>The libraries manipulate URIs and their components using a simple yet expressive code.</p>
7 changes: 7 additions & 0 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ <h2>{{ section[0] }}</h2>
{% if version != site.data.packages.package[package].version %}
<p class="message-notice">Please consider using the <a href="/{{ package}}/{{ site.data.packages.package[package].version }}/">the latest stable version</a> for any production code.</p>
{% endif %}

{% for deprecated in site.data.project.deprecated %}
{% if deprecated[0] == package %}
<p class="message-notice">This package is deprecated Please consider using an <a href="/{{ deprecated[1] }}">stable alternative</a> for any production code.</p>
{% endif %}
{% endfor %}

{{ content }}
</article>
</main>
Expand Down
124 changes: 67 additions & 57 deletions docs/_layouts/homepage.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<link rel="icon" type="image/x-icon" href="//theme.thephpleague.com/img/favicon.ico" />
<link rel="apple-touch-icon-precomposed" href="//theme.thephpleague.com/img/apple-touch-icon-precomposed.png">
<link rel="stylesheet" href="//theme.thephpleague.com/css/all.css?2">
<link rel="stylesheet" href="/homepage.css?3">
<link rel="stylesheet" href="/homepage.css?4">
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.data.project.google_analytics_tracking_id }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand All @@ -25,73 +25,83 @@
<h1>{{ site.data.project.title }}</h1>
<h2>{{ site.data.project.tagline }}</h2>
</div>
<p class="footnote">{{ site.data.project.support }}</p>
</header>

<main>

<div class="highlights">
<div class="features">
<div class="inner-content">
<div class="column one">
<h1>Highlights</h1>
<div class="description">
<p>This suite of packages provides simple and intuitive classes to parse, validate, format and manipulate URIs and their components. It is built to enable working with
any kind of RFC3986 compliant URI through extensions and middlewares.</p>
</div>
</div>
<div class="column two">
<ol>
<li><p>Simple and extensible API</p></li>
<li><p><a href="http://tools.ietf.org/html/rfc3986">RFC3986</a> compliant</p></li>
<li><p>Implements <a href="http://www.php-fig.org/psr/psr-7/">PSR-7</a> <code>UriInterface</code> interface</p></li>
<li><p>Framework-agnostic</p></li>
</ol>
</div>
<h1>Intuitive</h1>
{% include building-block.md %}
</div>
</div>

<div class="documentation">
<div class="inner-content">
<h1>Packages</h1>
<div class="packages-list">
<dl>
<dt><a href="/uri/5.0/">uri</a></dt>
<dd>A meta package to ease URI manipulation.</dd>
</dl>
<dl>
<dt><a href="/parser/1.0/">uri-parser</a></dt>
<dd>RFC3986 compliant parser and builder.</dd>
</dl>
<dl>
<dt><a href="/query-parser/1.0/">uri-query-parser</a></dt>
<dd>modern URI query string parser and builder based on RFC3986 and the URL
Living Standard.</dd>
</dl>
<dl>
<dt><a href="/components/1.0/">uri-components</a></dt>
<dd>Collection of URI components objects.</dd>
</dl>
<dl>
<dt><a href="/schemes/1.0/">uri-schemes</a></dt>
<dd>Collection of URI objects.</dd>
</dl>
<dl>
<dt><a href="/manipulations/1.0/">uri-manipulations</a></dt>
<dd>Functions and Middleware to ease URI Objects manipulations.</dd>
</dl>
<dl>
<dt><a href="/domain-parser/1.0/">uri-hostname-parser</a></dt>
<dd>A lightweight public suffix list ICANN section parser.</dd>
</dl>
</div>
<p class="footnote">{{ site.data.project.support }}</p>
<div class="highlights">
<div class="inner-content">
<div class="column one">
<h1>Highlights</h1>
<div class="description">
<p>This suite of packages provides simple and intuitive classes to parse, validate, format and manipulate URIs and their components. It is built to enable working with
any kind of RFC3986 compliant URI and also follow closely the latest WHATG Living standard specification.</p>
</div>
</div>
<div class="column two">
<ol>
<li><p>Simple and extensible API</p></li>
<li><p><a href="http://tools.ietf.org/html/rfc3986">RFC3986</a> compliant</p></li>
<li><p>follows <a href="https://url.spec.whatwg.org/">URL Living Standard</a> specifications</p></li>
<li><p>Implements <a href="http://www.php-fig.org/psr/psr-7/">PSR-7</a> <code>UriInterface</code> interface</p></li>
<li><p>Framework-agnostic</p></li>
</ol>
</div>
</div>
</div>
</div>

<!--div class="highlights">
<div class="inner-content">
{* content *}
<div class="documentation">
<div class="inner-content">
<h1>Packages</h1>
<div class="packages-list">
<h1>building blocks</h1>
<dl>
<dt><a href="/uri/6.0/">uri</a></dt>
<dd>This is the main package. It's goal is to ease generating and manipulation a full URI object independently from the URI schemes.</dd>
</dl>
<dl>
<dt><a href="/components/2.0/">uri-components</a></dt>
<dd>This package complement the URI package by providing a object oriented way to access and manipulate each URI components. It can be use to partially update such component in a full URI object context.</dd>
</dl>
</div>
<div class="packages-list">
<h1>Deprecated blocks</h1>
<dl>
<dt><a href="/schemes/1.0/">uri-schemes</a></dt>
<dd>Collection of URI objects. This package is deprecated because it conflicts and is superseded by the latest URI object package.</dd>
</dl>
<dl>
<dt><a href="/manipulations/1.0/">uri-manipulations</a></dt>
<dd>Functions and Middleware to ease URI Objects manipulations. This package is deprecated because it is superseded by the latest URI component object package.</dd>
</dl>
<dl>
<dt><a href="/domain-parser/1.0/">uri-hostname-parser</a></dt>
<dd>A lightweight public suffix list ICANN section parser. This package is deprecated as it was a temporary solution which is superseeded by other PHP packages dedicated to <a href="https://github.com/jeremykendall/php-domain-parser">domain host parsing</a>.</dd>
</dl>
</div>
<div class="packages-list">
<h1>Helpers blocks</h1>
<p class="message-notice">While no longer updated the following helper packages will continue to receive patch fixes <a href="https://www.php.net/supported-versions.php">as long as PHP7 is maintained</a>.
Their features are back-ported into maintained packages without BC break. Avoid using them for new projects.</p>
<dl>
<dt><a href="/parser/1.0/">uri-parser</a></dt>
<dd>a PHP user land RFC3986 compliant parser and builder to turn any valid URI string into an array and to build an URI out of a given array.</dd>
</dl>
<dl>
<dt><a href="/query-parser/1.0/">uri-query-parser</a></dt>
<dd>modern URI query string parser and builder based on RFC3986 and the URL Living Standard.</dd>
</dl>
</div>
</div>
</div>
</div-->

<div class="questions">
<div class="inner-content">
Expand Down
3 changes: 1 addition & 2 deletions docs/components/1.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ title: URI components
redirect_from:
- /5.0/components/
- /5.0/components/installation/
- /components/
---

Uri Components
Expand Down Expand Up @@ -62,4 +61,4 @@ Starting with version 1.4.0

- [Uri Hostname parser](/5.0/publicsuffix/)

The changes between dependencies was done to support `PHP7.2+`
The changes between dependencies was done to support `PHP7.2+`
2 changes: 2 additions & 0 deletions docs/components/2.0/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: URI components
redirect_from:
- /components/
---

Uri Components
Expand Down
53 changes: 48 additions & 5 deletions docs/homepage.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ footer {
}

pre {
background:#fff;
border-radius:.3em .3em 0 0;
border-width:0 0 0 4px;
background: #fff;
}

/* -------- homepage css -----------------*/
Expand All @@ -27,6 +27,9 @@ pre {
background:#19242F url(//thephpleague.com/img/header_bg.png) no-repeat top center;
background-size: cover;
max-width: none;
color:#fff;
font-family: "Museo 300";
text-align: center;
}

.homepage header h1 {
Expand Down Expand Up @@ -108,6 +111,46 @@ pre {
max-width: 1000px;
}

.documentation .packages-list h1 {
flex-grow: 1;
width:100%;
font:normal 1.5em/1.5 "Museo 300";
text-align: center;
text-transform: lowercase;
}

.documentation .packages-list .message-notice {
flex-grow: 1;
width:100%;
text-align: center;
}

.documentation .packages-list .message-notice a {
color:#000;
font-size:1em;
}

.documentation .packages-list .message-notice a:hover {
text-decoration: underline;
}

.documentation .packages-list .message-notice a:before {
content:'';
}

.documentation .packages-list dd a {
font-size:1em;
}

.documentation .packages-list dd a:hover {
text-decoration: underline;
}

.documentation .packages-list dd a:before {
content:'';
}


.packages-list dl {
flex-grow: 1;
width:100%;
Expand All @@ -116,7 +159,7 @@ pre {
}

.packages-list dd {
margin:0;
margin:.5em 0 0 0;
}

.inner-content .packages-list a {
Expand Down Expand Up @@ -146,7 +189,7 @@ pre {
}

.features p {
text-align: left;
text-align: center;
}

.features a {
Expand Down Expand Up @@ -437,4 +480,4 @@ pre {
width:30%;
margin:1%;
}
}
}
1 change: 0 additions & 1 deletion docs/uri/5.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ layout: default
title: Uri
redirect_from:
- /5.0/
- /uri/
---

# Overview
Expand Down
2 changes: 2 additions & 0 deletions docs/uri/6.0/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
layout: default
title: Uri Objects
redirect_from:
- /uri/
---

Overview
Expand Down
6 changes: 5 additions & 1 deletion docs/uri/6.0/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ This will edit (or create) your `composer.json` file.

This package is no longer a meta-package as such:

- it replaces, deprectes and conflicts with the `uri-schemes` package.
- it replaces, deprecates and conflicts with the `uri-schemes` package.
- it replaces and deprecates without conflicting the `uri-parser` package.
- it partially replaces and deprecates without conflicting the `uri-manipulation` package.

You are required to be explicit about your dependencies and
require the `uri-components` v2.0 package separately to get access to
URI components objects and how to manipulate them with URI objects.

## Interfaces

The `League\Uri\Http` class no longer implements the `League\Uri` specific interface. It only implements the PSR-7 `UriInterface` and PHP's `JsonSerializable` interfaces.
Expand Down

0 comments on commit aef1cb8

Please sign in to comment.