From 102ac855b51db17f011ec1b11501cee77325695c Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Sat, 10 Feb 2024 18:51:27 +0100 Subject: [PATCH] Rework documentation templates --- .phpdoc/template/components/sidebar.html.twig | 2 +- .phpdoc/template/components/toc.html.twig | 19 +++++++++++++++ .phpdoc/template/css/custom.css.twig | 3 +++ .phpdoc/template/index.html.twig | 24 +++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .phpdoc/template/components/toc.html.twig create mode 100644 .phpdoc/template/css/custom.css.twig create mode 100644 .phpdoc/template/index.html.twig diff --git a/.phpdoc/template/components/sidebar.html.twig b/.phpdoc/template/components/sidebar.html.twig index 1e60bee..7201879 100644 --- a/.phpdoc/template/components/sidebar.html.twig +++ b/.phpdoc/template/components/sidebar.html.twig @@ -6,7 +6,7 @@ {% for version in project.versions %} {% for toc in version.tableOfContents %}
-

{{ toc.name|capitalize }}

+

{{ toc.name|title }}

{% for root in toc.roots %} {{ toc(root, 'components/menu.html.twig', 1) }} {% endfor %} diff --git a/.phpdoc/template/components/toc.html.twig b/.phpdoc/template/components/toc.html.twig new file mode 100644 index 0000000..7ff0a75 --- /dev/null +++ b/.phpdoc/template/components/toc.html.twig @@ -0,0 +1,19 @@ +{% for version in project.versions %} + {% for toc in version.tableOfContents|filter(toc => toc.name|lower == "documentation" or toc.name|lower == "packages") %} +

{{ toc.name|title }}

+
+ {% for root in toc.roots %} +
+ {{ root.title|shortFQSEN }} +
+ {% if root.children.count > 0 %} +
+ {% for child in root.children %} + {{ child.title|shortFQSEN }}
+ {% endfor %} +
+ {% endif %} + {% endfor %} +
+ {% endfor %} +{% endfor %} diff --git a/.phpdoc/template/css/custom.css.twig b/.phpdoc/template/css/custom.css.twig new file mode 100644 index 0000000..38deeae --- /dev/null +++ b/.phpdoc/template/css/custom.css.twig @@ -0,0 +1,3 @@ +.phpdocumentor-table-of-contents .phpdocumentor-table-of-contents__entry.-documentation:before { + content: 'D'; +} diff --git a/.phpdoc/template/index.html.twig b/.phpdoc/template/index.html.twig new file mode 100644 index 0000000..1dc4618 --- /dev/null +++ b/.phpdoc/template/index.html.twig @@ -0,0 +1,24 @@ +{% extends 'base.html.twig' %} + +{% block content %} +
+ + +

PHP Basics

+ +

A collection of generic classes and useful traits for PHP projects.

+ +

The package currently contains classes for type-sensitive data + structures, error and exception handlers, multiple + traits implementing standard interfaces, and more generic + traits for common use cases. They share the same design principles like + property and method naming schema, highest Psalm and PHPStan coding standards and full PSR-12 + compliance to make sure they can be combined and easily re-used in other projects.

+ +

Table of Contents

+ + {% include('components/toc.html.twig') %} +
+{% endblock %}