Skip to content

Commit c64351d

Browse files
committed
First commit!
0 parents  commit c64351d

81 files changed

Lines changed: 3670 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/vendor/

LICENSE

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Copyright (c) 2026 Felipe Sayão Lobato Abreu
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is furnished
8+
to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

README.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# PHPDocumentor Bootstrap Template
2+
3+
A clean and modern Bootstrap-based template for phpDocumentor, designed to improve readability, navigation, and overall developer experience.
4+
5+
## Features
6+
7+
- Modern UI built with Bootstrap 5
8+
- Improved navigation and layout
9+
- Clean typography and spacing
10+
- Enhanced "On this page" sidebar
11+
- Better search UI integration
12+
- Responsive and mobile-friendly
13+
- Styled code blocks and documentation elements
14+
- Improved tables of contents and element listings
15+
16+
## Installation
17+
18+
Install the template with Composer:
19+
20+
```bash
21+
composer require --dev fast-forward/phpdoc-bootstrap-template
22+
```
23+
24+
Usage
25+
26+
Reference the template from vendor in your phpdoc.xml:
27+
28+
<?xml version="1.0" encoding="UTF-8" ?>
29+
<phpdocumentor
30+
configVersion="3"
31+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
32+
xsi:noNamespaceSchemaLocation="https://docs.phpdoc.org/latest/phpdoc.xsd"
33+
>
34+
<paths>
35+
<output>build/docs</output>
36+
</paths>
37+
38+
<version number="1.0.0">
39+
<api>
40+
<source dsn=".">
41+
<path>src</path>
42+
</source>
43+
</api>
44+
</version>
45+
46+
<template name="vendor/fast-forward/phpdoc-bootstrap-template" />
47+
</phpdocumentor>
48+
49+
You can also generate documentation directly from the command line:
50+
51+
vendor/bin/phpdoc --template vendor/fast-forward/phpdoc-bootstrap-template
52+
53+
Or with a config file:
54+
55+
vendor/bin/phpdoc --config phpdoc.xml
56+
57+
Requirements
58+
• PHP 8.3+
59+
• phpDocumentor 3+
60+
61+
Customization
62+
63+
You can customize the template by overriding Twig files in your own project or by forking this package.
64+
65+
Typical customization points include:
66+
• layout structure
67+
• sidebar navigation
68+
• search UI
69+
• cards and content sections
70+
• Bootstrap styling
71+
72+
Contributing
73+
74+
Contributions are welcome. Please open an issue or submit a pull request.
75+
76+
License
77+
78+
MIT

base.html.twig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{% extends 'layout.html.twig' %}
2+
3+
{% block content %}
4+
<div class="content">
5+
<div class="container">
6+
{% block page_content %}{% endblock %}
7+
</div>
8+
</div>
9+
{% endblock %}

class.html.twig

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{% block content %}
4+
{% include 'components/breadcrumbs.html.twig' %}
5+
6+
<article class="phpdocumentor-element">
7+
<div class="mb-4">
8+
{{ include('components/class-title.html.twig') }}
9+
</div>
10+
11+
<div class="mb-4">
12+
{{ include('components/element-found-in.html.twig') }}
13+
</div>
14+
15+
<div class="mb-4">
16+
{{ include('components/element-header.html.twig') }}
17+
</div>
18+
19+
<div class="d-grid gap-4">
20+
{% set constants = constants(node) %}
21+
{% set properties = properties(node) %}
22+
{% set methods = methods(node) %}
23+
24+
{% if constants is not empty %}
25+
<section class="card border-0 shadow-sm">
26+
<div class="card-header bg-body-tertiary border-0 d-flex align-items-center gap-2">
27+
<i class="fas fa-thumbtack text-warning"></i>
28+
<span class="fw-semibold">Constants</span>
29+
</div>
30+
<div class="card-body p-4">
31+
{{ include('components/constants.html.twig') }}
32+
</div>
33+
</section>
34+
{% endif %}
35+
36+
{% if properties is not empty %}
37+
<section class="card border-0 shadow-sm">
38+
<div class="card-header bg-body-tertiary border-0 d-flex align-items-center gap-2">
39+
<i class="fas fa-sliders-h text-info"></i>
40+
<span class="fw-semibold">
41+
Properties
42+
{{ include('components/headerlink.html.twig', {'on': node, 'at': 'properties'}, with_context = false) }}
43+
</span>
44+
</div>
45+
<div class="card-body p-4">
46+
{{ include('components/properties.html.twig') }}
47+
</div>
48+
</section>
49+
{% endif %}
50+
51+
{% if methods is not empty %}
52+
<section class="card border-0 shadow-sm">
53+
<div class="card-header bg-body-tertiary border-0 d-flex align-items-center gap-2">
54+
<i class="fas fa-code text-primary"></i>
55+
<span class="fw-semibold">
56+
Methods
57+
{{ include('components/headerlink.html.twig', {'on': node, 'at': 'methods'}, with_context = false) }}
58+
</span>
59+
</div>
60+
<div class="card-body p-4">
61+
{{ include('components/methods.html.twig') }}
62+
</div>
63+
</section>
64+
{% endif %}
65+
</div>
66+
67+
{{ include('components/source-modal.html.twig') }}
68+
</article>
69+
{% endblock %}
70+
71+
{% block on_this_page %}
72+
{% set constants = constants(node) %}
73+
{% set properties = properties(node) %}
74+
{% set methods = methods(node) %}
75+
76+
<section>
77+
<div class="d-grid gap-4">
78+
<div>
79+
<div class="small text-uppercase fw-semibold text-body-secondary mb-2">Table of contents</div>
80+
<div class="list-group list-group-flush">
81+
{% if constants is not empty %}
82+
<a class="list-group-item list-group-item-action px-0 py-2 border-0 bg-transparent" href="{{ link(node) }}#toc-constants">
83+
Constants
84+
</a>
85+
{% endif %}
86+
{% if properties is not empty %}
87+
<a class="list-group-item list-group-item-action px-0 py-2 border-0 bg-transparent" href="{{ link(node) }}#toc-properties">
88+
Properties
89+
</a>
90+
{% endif %}
91+
{% if methods is not empty %}
92+
<a class="list-group-item list-group-item-action px-0 py-2 border-0 bg-transparent" href="{{ link(node) }}#toc-methods">
93+
Methods
94+
</a>
95+
{% endif %}
96+
</div>
97+
</div>
98+
99+
{% if constants is not empty %}
100+
<div>
101+
<div class="small text-uppercase fw-semibold text-body-secondary mb-2 d-flex align-items-center gap-2">
102+
<i class="fas fa-thumbtack text-warning"></i>
103+
<span>Constants</span>
104+
</div>
105+
106+
<div class="list-group list-group-flush">
107+
{% for constant in constants|sortByVisibility %}
108+
<a
109+
class="list-group-item list-group-item-action px-0 py-2 border-0 bg-transparent d-flex align-items-center justify-content-between gap-2{% if constant.deprecated %} text-decoration-line-through text-body-secondary{% endif %}"
110+
href="{{ link(constant) }}"
111+
>
112+
<span class="text-truncate">{{ constant.name }}</span>
113+
{% if constant.deprecated %}
114+
<span class="badge text-bg-warning">Deprecated</span>
115+
{% endif %}
116+
</a>
117+
{% endfor %}
118+
</div>
119+
</div>
120+
{% endif %}
121+
122+
{% if properties is not empty %}
123+
<div>
124+
<div class="small text-uppercase fw-semibold text-body-secondary mb-2 d-flex align-items-center gap-2">
125+
<i class="fas fa-sliders-h text-info"></i>
126+
<span>Properties</span>
127+
</div>
128+
129+
<div class="list-group list-group-flush">
130+
{% for property in properties|sortByVisibility %}
131+
<a
132+
class="list-group-item list-group-item-action px-0 py-2 border-0 bg-transparent d-flex align-items-center justify-content-between gap-2{% if property.deprecated %} text-decoration-line-through text-body-secondary{% endif %}"
133+
href="{{ link(property) }}"
134+
>
135+
<span class="text-truncate">${{ property.name }}</span>
136+
{% if property.deprecated %}
137+
<span class="badge text-bg-warning">Deprecated</span>
138+
{% endif %}
139+
</a>
140+
{% endfor %}
141+
</div>
142+
</div>
143+
{% endif %}
144+
145+
{% if methods is not empty %}
146+
<div>
147+
<div class="small text-uppercase fw-semibold text-body-secondary mb-2 d-flex align-items-center gap-2">
148+
<i class="fas fa-code text-primary"></i>
149+
<span>Methods</span>
150+
</div>
151+
152+
<div class="list-group list-group-flush">
153+
{% for method in methods|sortByVisibility %}
154+
<a
155+
class="list-group-item list-group-item-action px-0 py-2 border-0 bg-transparent d-flex align-items-center justify-content-between gap-2{% if method.deprecated %} text-decoration-line-through text-body-secondary{% endif %}"
156+
href="{{ link(method) }}"
157+
>
158+
<span class="text-truncate">{{ method.name }}()</span>
159+
{% if method.deprecated %}
160+
<span class="badge text-bg-warning">Deprecated</span>
161+
{% endif %}
162+
</a>
163+
{% endfor %}
164+
</div>
165+
</div>
166+
{% endif %}
167+
</div>
168+
</section>
169+
{% endblock %}

components/attribute.html.twig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="d-grid gap-2">
2+
<div class="d-flex flex-wrap align-items-center gap-2">
3+
<span class="badge text-bg-info">
4+
#[{{ attribute.attribute | route('class:short') }}]
5+
</span>
6+
</div>
7+
8+
{% if attribute.arguments is not empty %}
9+
<div class="d-flex flex-column gap-2 mt-1">
10+
{% for argument in attribute.arguments %}
11+
<div class="small">
12+
{% if argument.name %}
13+
<span class="fw-semibold text-body-secondary">${{ argument.name }}</span>
14+
<span class="text-body-secondary">:</span>
15+
{% endif %}
16+
<code>{{ argument.value }}</code>
17+
</div>
18+
{% endfor %}
19+
</div>
20+
{% endif %}
21+
</div>

components/attributes.html.twig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% if node is attributed %}
2+
{% set attributes = attributes(node)|specializedAttributes|sortByVisibility %}
3+
4+
{% if attributes is not empty %}
5+
<section class="mt-4">
6+
<div class="d-flex align-items-center gap-2 mb-3">
7+
<i class="fas fa-tags text-info"></i>
8+
<h5 class="h6 text-uppercase text-body-secondary fw-semibold mb-0" id="attributes">
9+
Attributes
10+
{{ include('components/headerlink.html.twig', {'on': node, 'at': 'attributes'}, with_context = false) }}
11+
</h5>
12+
</div>
13+
14+
<div class="d-grid gap-3">
15+
{% for attribute in attributes %}
16+
{% include 'components/attribute.html.twig' %}
17+
{% endfor %}
18+
</div>
19+
</section>
20+
{% endif %}
21+
{% endif %}

components/back-to-top.html.twig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<a
2+
href="{{ target_path ?: env.currentFileDestination }}#top"
3+
class="btn btn-primary rounded-circle shadow position-fixed bottom-0 end-0 m-4 d-inline-flex align-items-center justify-content-center"
4+
style="width: 3rem; height: 3rem; z-index: 1030;"
5+
aria-label="Back to top"
6+
title="Back to top"
7+
>
8+
<i class="fas fa-chevron-up"></i>
9+
</a>

components/breadcrumbs.html.twig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{% set breadcrumbs = usesNamespaces ? breadcrumbs(node) : packages(node) %}
2+
3+
<nav aria-label="breadcrumb" class="mb-4">
4+
<ol class="breadcrumb mb-0">
5+
<li class="breadcrumb-item">
6+
<a href="{{ path('/') }}" class="text-decoration-none">
7+
<i class="fas fa-home text-primary me-1"></i>
8+
<span>Home</span>
9+
</a>
10+
</li>
11+
12+
{% for breadcrumb in breadcrumbs %}
13+
<li class="breadcrumb-item">
14+
<a href="{{ link(breadcrumb) }}" class="text-decoration-none">
15+
{{ breadcrumb.name }}
16+
</a>
17+
</li>
18+
{% endfor %}
19+
</ol>
20+
</nav>

0 commit comments

Comments
 (0)