Skip to content

Commit

Permalink
Adding the new documentation website layout (#527)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jun 19, 2024
1 parent a5bdf6a commit 89d885e
Show file tree
Hide file tree
Showing 50 changed files with 3,541 additions and 950 deletions.
2 changes: 1 addition & 1 deletion docs/9.0/extensions/doctrine.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Using CSV with Doctrine packages
<p class="message-warning">With the release of league\csv <code>9.16.0</code> this
package is officially marked as deprecated no development aside security fixes
will be applied to it. The package is also marked as abandoned if you use composer.
For replacement please visit the [Constraint Builders documentation page](https://csv.thephpleague.com/9.0/reader/statement/)</p>
For replacement please visit the <a href="https://csv.thephpleague.com/9.0/reader/statement/">Constraint Builders documentation page</a></p>

In a nutshell, the features provided by this package have been implemented in a
better integrated manner directly into the main package, without the need for a
Expand Down
5 changes: 4 additions & 1 deletion docs/9.0/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ If you are using **PHP >= 8.0**, use version **9.6.2 or higher** for compatibili
**Recommendation:** It is recommended to use the latest stable version of the `League\Csv` package in
combination with the latest PHP version.

<p class="message-notice">Since version <code>9.16.0</code> the <code>mbstring</code> extension is no
longer required but it is still recommended if you are using or plan to use any mb related stream filter</p>

## Composer Install

`League\Csv` is available on [Packagist](https://packagist.org/packages/league/csv) and can be installed using [Composer](https://getcomposer.org/):

```bash
composer require league/csv:^9.0
composer require league/csv:^{{ site.data.project.version }}
```

## Manual Install
Expand Down
4 changes: 4 additions & 0 deletions docs/_data/manifest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"docs.css": "/styles.0001.css",
"docs.js": "/scripts.0001.js"
}
4 changes: 2 additions & 2 deletions docs/_data/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Working with CSV can often be much more difficult than you expect,
google_analytics_tracking_id: UA-46050814-6
# Github repository
repository: 'csv'
version: 9.1.4
version: 9.16.0
releases:
# next:
# version: '10.0'
Expand All @@ -16,7 +16,7 @@ releases:
current:
version: '9.0'
requires: 'PHP >= 7.0.10'
latest: '9.1.4 - 2018-05-01'
latest: '9.16.0- 2018-05-01'
supported_until: 'TBD'
documentation_link: '/9.0/'
previous:
Expand Down
246 changes: 157 additions & 89 deletions docs/_layouts/default.html
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{% assign version = page.url | remove_first: "/" | split: "/" | first %}
{% assign upgrading = false %}
{% if version == '' or version == 'releases' or version == 'upgrading' %}
{% if version == '' or version == 'releases' %}
{% assign version = site.data.project.releases.current.version %}
{% assign upgrading = true %}
{% endif %}
{% capture version_home %}/{{ version }}/{% endcapture %}
<!DOCTYPE html>
<html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="docsearch:version" content="4.0">
<meta name="description" content="{{ site.data.project.description }}">
<meta name="docsearch:version" content="{{ version }}">
<title>{{ page.title }} - {{ site.data.project.title }}</title>
<link rel="icon" type="image/x-icon" href="//theme.thephpleague.com/img/favicon.ico" />
<link rel="icon" href="/assets/img/csv-logo.svg" type="image/svg+xml">
<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="/custom.css?29">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@300;400;500&family=Onest:wght@300;400;500;600;700;900&display=swap" rel="stylesheet">
<link href="{{ site.data.manifest['docs.css'] }}" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css">
<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 @@ -27,95 +29,161 @@
gtag('config', '{{ site.data.project.google_analytics_tracking_id }}');
</script>
</head>
<body>
<header>
<div class="header-content">
<h1 class="title"><a href="/"><span>League</span>{{ site.data.project.title }}</a></h1>
<div class="search"><input type="search" id="doc-search" placeholder="search the docs..."></div>
<nav class="versions">
<h2>{% if upgrading == true %}Notes{% else %}v{{ version }}{% endif %} &#9662;</h2>
<ul>
{% for v in site.data.menu.version %}
<li {% if version == v[0] and upgrading == false %}class="selected"{% endif %}><a href="/{{ v[0] }}/">v{{ v[0] }}</a></li>
{% endfor %}
<li {% if upgrading == true %}class="selected"{% endif %}><a href="/releases/">Notes</a></li>
</ul>
</nav>
</div>
</header>

<input type="checkbox" id="menu">
<label for="menu" onclick>
<div class="closed">&#9776;</div>
<div class="open">&#10799;</div>
</label>

<main>
<menu>
<div class="versions-small">
<h2>Versions</h2>
<ul>
{% for v in site.data.menu.version %}
<li {% if version == v[0] and upgrading == false %}class="selected"{% endif %}>
<a href="/{{ v[0] }}/">{{ v[0] }}</a>
</li>
{% endfor %}
<li {% if upgrading == true %}class="selected"{% endif %}><a href="/releases/">Notes</a></li>
</ul>
<body class="bg-white text-dark font-onest antialiased relative">
<div class="relative z-10">
<header class="flex items-center sm:justify-center pl-6 pr-6 pb-6 max-w-7xl mx-auto pb-32">
<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">
<a class="flex items-center gap-2 sm:gap-3" href="/">
<img src="/assets/img/csv-logo.svg" alt="Logo" class="w-[40px] sm:w-[50px] h-[40px] sm:h-[50px]"/>
<div class="font-black">CSV</div>
</a>
</div>

{% if upgrading == false %}
{% for section in site.data.menu.version[version] %}
<div class="menu-section">
<h2>{{ section[0] }}</h2>
<ul>
{% for link in section[1] %}
<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">
<input type="search" id="doc-search" class="w-64" placeholder="search the docs...">
</div>
</header>
<main class="relative flex justify-center mx-auto max-w-8xl sm:px-2 lg:px-8 xl:px-12">
<label for="navigation" class="fixed top-5 right-5 z-50 flex items-center justify-center w-12 h-12 mb-4 ml-4 bg-white border rounded-full shadow-lg cursor-pointer text-slate-600 border-slate-300 lg:hidden transition duration-200 ease-in-out active:scale-95">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
<path stroke-linecap="round" stroke-linejoin="round" d="M4 8h16M4 16h16" />
</svg>
</label>
<input type="checkbox" name="navigation" id="navigation" class="hidden peer" />
<div class="fixed top-[3.5rem] h-screen shadow-xl px-4 left-0 hidden peer-checked:block lg:relative lg:top-0 lg:h-auto lg:px-0 lg:block lg:flex-none lg:shadow-none bg-slate-100 lg:bg-transparent">
<div class="absolute inset-y-0 right-0 w-full lg:w-[50vw]"></div>
<nav class="sticky top-[4.5rem] w-64 pr-8 text-base lg:text-sm xl:w-72 xl:pr-16">
<ul role="list" class="-ml-0.5 h-[calc(100vh-4.5rem)] overflow-y-auto py-7 pl-0.5 space-y-4">
{% if upgrading == false %}
{% for section in site.data.menu.version[version] %}
<h3 class="font-semibold tracking-tight text-slate-900">{{ section[0] }}</h3>
<ul role="list" class="pl-3 mt-3 space-y-2">
{% for link in section[1] %}
<li {% if page.url == link[1] %}class="selected"{% endif %}>
<a href="{{ link[1] }}">{{ link[0] }}</a>
<a href="{{ link[1] }}" class="text-slate-900 hover:text-slate-800">{{ link[0] }}</a>
</li>
{% endfor %}
</ul>
{% endfor %}
</ul>
</div>
{% endfor %}
{% else %}
{% for section in site.data.menu.upgrading %}
<h2>{{ section[0] }}</h2>
<ul>
{% for link in section[1] %}
{% else %}
{% for section in site.data.menu.upgrading %}
<h3 class="font-semibold tracking-tight text-slate-900">{{ section[0] }}</h3>
<ul role="list" class="pl-3 mt-3 space-y-2">
{% for link in section[1] %}
<li {% if page.url == link[1] %}class="selected"{% endif %}>
<a href="{{ link[1] }}">{{ link[0] }}</a>
<a href="{{ link[1] }}" class="text-slate-900 hover:text-slate-800">{{ link[0] }}</a>
</li>
{% endfor %}
</ul>
{% endfor %}
{% endif %}
<h3 class="font-semibold tracking-tight text-slate-900">Release Notes</h3>
<ul role="list" class="pl-3 mt-3 space-y-2">
<li {% if upgrading == true %}class="selected"{% endif %}><a href="/releases/">Releases Notes</a></li>
</ul>
<h3 class="font-semibold tracking-tight text-slate-900">Older versions</h3>
<ul role="list" class="pl-3 mt-3 space-y-2">
{% for v in site.data.menu.version %}
<li {% if version == v[0] and upgrading == false %}class="selected"{% endif %}>
<a href="/{{ v[0] }}/">{{ v[0] }} {% if v[0] == site.data.project.releases.current.version %}(latest stable){% endif %}</a>
</li>
{% endfor %}
</ul>
</ul>
{% endfor %}
{% endif %}
</menu>
<article>
{% if version == site.data.project.releases.next.version %}
<p class="message-notice">This is the documentation for the upcoming <code>version {{ version }}</code>. This is a work in progress</p>
{% endif %}

{% if version == site.data.project.releases.previous.version %}
<p class="message-notice">This is the documentation for <code>version {{ version }}</code> which will be supported until <strong>{{ site.data.project.releases.previous.supported_until }}</strong>. Please consider upgrading your code to <a href="{{ site.data.project.releases.current.documentation_link }}">the latest stable version</a></p>
{% endif %}

{% if version == site.data.project.releases.legacy.version %}
<p class="message-notice">This is the documentation for the unsupported <code>version {{ version }}</code>. Please consider upgrading your code to <a href="{{ site.data.project.releases.current.documentation_link }}">the latest stable version</a></p>
{% endif %}

{{ content }}
</article>
</main>

<aside class="sponsors hide">
<p>Love this package ? <a href="https://github.com/sponsors/{{ site.data.project.author.github_account }}">Support its development!</a></p>
</aside>

<footer>
<span>&copy; Copyright <a href="//thephpleague.com">The League of Extraordinary Packages</a>.</span>
<span>Site design by <a href="//reinink.ca">Jonathan Reinink</a> and <a href="//nyamsprod.com">Ignace Nyamagana Butera</a>.</span>
</footer>
<script src="/custom.js?7"></script>
</nav>
</div>
<div class="flex-auto max-w-2xl min-w-0 px-4 py-10 lg:max-w-4xl lg:pr-0 lg:pl-8 xl:px-16">
<article class="content">
{% if version == site.data.project.releases.next.version %}
<p class="message-notice">This is the documentation for the upcoming <code>version {{ version }}</code>. This is a work in progress</p>
{% endif %}

{% if version == site.data.project.releases.previous.version %}
<p class="message-notice">This is the documentation for <code>version {{ version }}</code> which will be supported until <strong>{{ site.data.project.releases.previous.supported_until }}</strong>. Please consider upgrading your code to <a href="{{ site.data.project.releases.current.documentation_link }}">the latest stable version</a></p>
{% endif %}

{% if version == site.data.project.releases.legacy.version %}
<p class="message-notice">This is the documentation for the unsupported <code>version {{ version }}</code>. Please consider upgrading your code to <a href="{{ site.data.project.releases.current.documentation_link }}">the latest stable version</a></p>
{% endif %}
{{ content }}
</article>
</div>
</main>
<footer class="p-6 max-w-7xl mx-auto pb-32">
<hr class="border-t border-light border-opacity-50 max-w-7xl mx-auto" />

<div class="flex flex-col lg:flex-row gap-12 my-16 px-6 md:px-0">
<a href="https://csv.thephpleague.com/" class="flex gap-3 lg:justify-between items-start transition-all hover-block">
<img src="/assets/img/csv-logo.svg" alt="CSV Logo" class="" />

<div class="flex flex-col">
<div class="font-black text-lg text-dark">CSV</div>

<p class="text-light">Data manipulation made easy in PHP</p>
</div>
</a>

<a href="https://uri.thephpleague.com/" class="flex gap-3 lg:justify-between items-start transition-all hover-block">
<img src="/assets/img/uri-logo.svg" alt="URI Logo" class="" />

<div class="flex flex-col">
<div class="font-black text-lg text-dark">URI</div>

<p class="text-light">Modern API to process URIs in PHP</p>
</div>
</a>

<a href="https://period.thephpleague.com/" class="flex gap-3 lg:justify-between items-start transition-all hover-block">
<img src="/assets/img/period-logo.svg" alt="Period Logo" class="" />

<div class="flex flex-col">
<div class="font-black text-lg text-dark">PERIOD</div>

<p class="text-light">Time range API for PHP</p>
</div>
</a>
</div>

<hr class="border-t border-light border-opacity-50 max-w-7xl mx-auto mb-16" />

<div class="gap-12 sm:gap-32 grid sm:grid-cols-1 md:grid-cols-3 lg:grid-cols-4">
<div class="flex flex-col gap-3 sm:col-span-3 lg:col-span-1">
<div class="text-csv-base font-black text-xl">Copyright</div>

<a href="//thephpleague.com" class="font-mono tracking-tighter text-sm underline transition-all hover-text">The League of <br />Extraordinary Packages</a>
</div>

<div class="flex flex-col gap-3">
<div class="text-dark font-black text-xl">Questions?</div>
<p class="font-mono text-sm tracking-tighter">
<a href="https://phpc.social/@nyamsprod" target="_blank" class="transition-all hover-text">
Package created and maintained by <span class="underline">Ignace Nyamagana Butera.</span>
</a>
</p>
</div>

<div class="flex flex-col gap-3">
<div class="text-dark font-black text-xl">Design</div>

<p class="font-mono text-sm tracking-tighter">
<a href="https://twitter.com/sandr" target="_blank" class="transition-all hover-text">
Brand and site design by <span class="underline">Sander van der Kolk</span>
</a>
</p>
</div>

<div class="flex flex-col gap-3">
<div class="font-black text-xl">License package</div>

<p class="font-mono text-sm tracking-tighter">
<a href="https://github.com/thephpleague/csv/blob/master/LICENSE" target="_blank" class="transition-all hover-text underline">
The MIT License (MIT)
</a>
</p>
</div>
</div>
</footer>
</div>
<script src="{{ site.data.manifest['docs.js'] }}"></script>
<script src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script>
<script> docsearch({
apiKey: '63ba748e8f5bceb91934667c118972d0',
Expand Down
Loading

0 comments on commit 89d885e

Please sign in to comment.