Skip to content

Commit ae12f9f

Browse files
committed
Improve documentation layout
1 parent eddb233 commit ae12f9f

7 files changed

Lines changed: 295 additions & 261 deletions

File tree

docs/2.0/index.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,3 @@ Use composer:
1616
```
1717
composer require bakame/http-structured-fields:^2.0
1818
```
19-
20-
## Foreword
21-
22-
<p class="message-warning">
23-
While this package parses and serializes HTTP field value, it does not validate its content
24-
against any conformance rule out of the box. You are still required to perform such a
25-
compliance check against the constraints of the corresponding field. While Content
26-
validation is still possible and highly encouraged when using this library. Because
27-
of the wide variety of HTTP fields it can not be made mandatory.
28-
</p>

docs/2.0/validation.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,34 @@ order: 6
66

77
# Validation
88

9+
## Foreword
10+
11+
<p class="message-warning">
12+
While this package parses and serializes HTTP field value, it does not validate its content
13+
against any conformance rule out of the box. You are still required to perform such a
14+
compliance check against the constraints of the corresponding field. While Content
15+
validation is still possible and highly encouraged when using this library. Because
16+
of the wide variety of HTTP fields it can not be made mandatory.
17+
</p>
18+
19+
## Validating a field
20+
`
921
When it comes to make sure about the incoming data the package provides a simple approach around validation,
1022
To learn and understand the package validation mechanism we will look at a real world example and expand on it.
1123

1224
So what we are going to do is validating the following putative HTTP field `temperature`.
1325

14-
> The field is defined as a List. meaning it can contain multiple temperature
15-
> definitions as items. Each temperature entry MUST contain a temperature value express in Celsius.
16-
> The temperature has the following required parameters `date`, `longitude` and `latitude`
17-
> and an optional `location` parameter which is a human-readable name of the location where
18-
> the temperature was read. The `location` can be a `string` or a `displaystring`. The latitude
19-
> and longitude are express as `decimal` values. You will find below an example of such HTTP field.
26+
<dl>
27+
<dt><dfn>temperature</dfn></dt>
28+
<dt>
29+
The field is defined as a List. meaning it can contain multiple temperature
30+
definitions as items. Each temperature entry MUST contain a temperature value express in Celsius.
31+
The temperature has the following required parameters `date`, `longitude` and `latitude`
32+
and an optional `location` parameter which is a human-readable name of the location where
33+
the temperature was read. The `location` can be a `string` or a `displaystring`. The latitude
34+
and longitude are express as `decimal` values. You will find below an example of such HTTP field.
35+
</dt>
36+
</dl>
2037

2138
```bash
2239
temperature: 18.3;location=%"lagos";date=@1731573026;longitude=6.418;latitude=3.389, 12.8;date=@1730894400;longitude=6.418;latitude=3.389

docs/_data/manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"docs.css": "/styles.0004.css",
2+
"docs.css": "/styles.0005.css",
33
"docs.js": "/scripts.0002.js"
44
}

docs/_layouts/default.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<header class="flex items-center sm:justify-center pl-6 pr-6 pb-6 max-w-7xl mx-auto pb-32">
3030
<div class="flex gap-6 md:gap-0 md:flex-row justify-between md:items-center p-3 md:p-6 w-full max-w-7xl">
3131
<a class="flex items-center gap-2 sm:gap-3" href="{{ site.baseurl }}/">
32-
<img src="{{ site.baseurl }}/assets/img/httpsf-logo.svg" alt="Logo" class="w-[80px] sm:w-[60px] h-[40px] sm:h-[50px]"/>
32+
<img src="{{ site.baseurl }}/assets/img/httpsf-logo.svg" alt="Logo" class="w-[86px] sm:w-[70px] h-[40px] sm:h-[50px]"/>
3333
<div class="font-black">HTTP Structured Fields</div>
3434
</a>
3535
</div>
@@ -88,7 +88,7 @@ <h3 class="font-semibold tracking-tight text-slate-900">Older versions</h3>
8888
{{ content }}
8989
</article>
9090
<div class="flex justify-center items-center">
91-
<img src="{{ site.baseurl }}/assets/img/httpsf.svg" alt="Logo" class="w-[1800px] sm:w-[170px] h-[50px] sm:h-[60px]"/>
91+
<img src="{{ site.baseurl }}/assets/img/httpsf.svg" alt="Logo" />
9292
</div>
9393
</div>
9494
</main>

docs/_layouts/homepage.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<header class="flex items-center sm:justify-center">
2222
<div class="flex gap-6 md:gap-0 md:flex-row justify-between md:items-center p-3 md:p-6 w-full max-w-7xl">
2323
<div class="flex items-center gap-2 sm:gap-3">
24-
<img src="{{ site.baseurl }}/assets/img/httpsf-logo.svg" alt="Logo" class="w-[80px] sm:w-[60px] h-[40px] sm:h-[50px]"/>
24+
<img src="{{ site.baseurl }}/assets/img/httpsf-logo.svg" alt="Logo" class="w-[86px] sm:w-[70px] h-[40px] sm:h-[50px]"/>
2525
</div>
2626
<div class="flex items-center gap-0 md:gap-0">
2727
<a href="{{ site.data.project.repository_url }}" class="px-2 py-2 sm:px-6 sm:py-3 font-black text-md text-black-50 hover:text-csv-dark hover:underlines whitespace-nowrap">SOURCE CODE</a>

docs/input.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,18 @@ code {
380380
color: #099
381381
}
382382

383+
dl {
384+
@apply p-5 my-3 rounded-r-lg text-light border-l-green-500 border-l-4
385+
}
386+
387+
dl dfn {
388+
@apply font-bold text-black not-italic
389+
}
390+
391+
dl dt {
392+
@apply not-italic
393+
}
394+
383395
.message-info,
384396
.message-notice,
385397
.message-warning {

0 commit comments

Comments
 (0)