Skip to content

Commit 709f28c

Browse files
committed
add phpdoc custom template
1 parent 6a27c6b commit 709f28c

File tree

147 files changed

+2981
-0
lines changed

Some content is hidden

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

147 files changed

+2981
-0
lines changed

.phpdoc-template/base.html.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{% extends 'layout.html.twig' %}

.phpdoc-template/class.html.twig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{% block content %}
4+
{% include 'components/breadcrumbs.html.twig' %}
5+
6+
<article class="phpdocumentor-element -class">
7+
{{ include('components/class-title.html.twig') }}
8+
{{ include('components/element-found-in.html.twig') }}
9+
{{ include('components/element-header.html.twig') }}
10+
11+
{{ include('components/constants.html.twig') }}
12+
{{ include('components/properties.html.twig') }}
13+
{{ include('components/methods.html.twig') }}
14+
</article>
15+
{% endblock %}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.phpdocumentor-admonition {
2+
border: 1px solid var(--admonition-border-color);
3+
border-radius: var(--border-radius-base-size);
4+
border-color: var(--primary-color-lighten);
5+
background-color: var(--primary-color-lighter);
6+
font-size: 85%;
7+
padding: .5rem;
8+
margin: 2rem 0;
9+
display: flex;
10+
flex-direction: row;
11+
}
12+
13+
.phpdocumentor-admonition--success {
14+
border-color: var(--admonition-success-color);
15+
}
16+
17+
.phpdocumentor-admonition__icon {
18+
font-size: 2rem;
19+
margin: .75rem 0.75rem 1.25rem 0.5rem;
20+
color: var(--primary-color);
21+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.phpdocumentor .phpdocumentor-back-to-top {
2+
position: fixed;
3+
bottom: 2rem;
4+
font-size: 2.5rem;
5+
opacity: .25;
6+
transition: all .3s ease-in-out;
7+
right: 2rem;
8+
}
9+
10+
.phpdocumentor .phpdocumentor-back-to-top:hover {
11+
color: var(--link-color-primary);
12+
opacity: 1;
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.phpdocumentor ul.phpdocumentor-breadcrumbs {
2+
font-size: var(--text-md);
3+
list-style: none;
4+
margin: 0;
5+
padding: 0;
6+
}
7+
8+
.phpdocumentor ul.phpdocumentor-breadcrumbs a {
9+
color: var(--text-color);
10+
text-decoration: none;
11+
}
12+
13+
.phpdocumentor ul.phpdocumentor-breadcrumbs > li {
14+
display: inline-block;
15+
margin: 0;
16+
}
17+
18+
.phpdocumentor ul.phpdocumentor-breadcrumbs > li + li:before {
19+
color: var(--dark-gray);
20+
content: "\\\A0";
21+
padding: 0;
22+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{% set breadcrumbs = usesNamespaces ? breadcrumbs(node) : packages(node) %}
2+
<ul class="phpdocumentor-breadcrumbs">
3+
{% for breadcrumb in breadcrumbs %}
4+
<li class="phpdocumentor-breadcrumb"><a href="{{ link(breadcrumb) }}">{{ breadcrumb.name }}</a></li>
5+
{% endfor %}
6+
</ul>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.phpdocumentor-class-graph {
2+
width: 100%; height: 600px; border:1px solid black; overflow: hidden
3+
}
4+
5+
.phpdocumentor-class-graph__graph {
6+
width: 100%;
7+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<h2 class="phpdocumentor-content__title">
2+
{{ node.name }}
3+
4+
{% if node.parent %}
5+
<span class="phpdocumentor-element__extends">
6+
extends {{ node.parent|route('class:short') }}
7+
</span>
8+
{% endif %}
9+
10+
{% if usesPackages %}
11+
<div class="phpdocumentor-element__package">
12+
in package
13+
<ul class="phpdocumentor-breadcrumbs">
14+
{% for breadcrumb in packages(node) %}
15+
<li class="phpdocumentor-breadcrumb"><a href="{{ link(breadcrumb) }}">{{ breadcrumb.name }}</a></li>
16+
{% endfor %}
17+
</ul>
18+
</div>
19+
{% endif %}
20+
21+
{% if node.interfaces is not empty %}
22+
<span class="phpdocumentor-element__implements">
23+
implements
24+
{% for interface in node.interfaces %}
25+
{{ interface|route('class:short') }}{% if not loop.last %}, {% endif %}
26+
{% endfor %}
27+
</span>
28+
{% endif %}
29+
30+
{% if node.usedTraits is not empty %}
31+
<span class="phpdocumentor-element__extends">
32+
Uses
33+
{% for trait in node.usedTraits %}
34+
{{ trait|route('class:short') }}{% if not loop.last %}, {% endif %}
35+
{% endfor %}
36+
</span>
37+
{% endif %}
38+
</h2>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<code class="phpdocumentor-signature phpdocumentor-code {% if node.deprecated %}-deprecated{% endif %}">
2+
<span class="phpdocumentor-signature__visibility">{{ node.visibility }}</span>
3+
<span class="phpdocumentor-signature__type">{{ not node.type ? "mixed" : node.type|route('class:short')|join('|')|raw }}</span>
4+
<span class="phpdocumentor-signature__name">{{ node.name }}</span>
5+
= <span class="phpdocumentor-signature__default-value">{{ node.value ?: '""' }}</span>
6+
</code>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<article class="phpdocumentor-element -constant -{{ constant.visibility }} {% if constant.deprecated %}-deprecated{% endif %}">
2+
<h4 class="phpdocumentor-element__name" id="constant_{{ constant.name }}">
3+
{{ constant.name }}
4+
<a href="#constant_{{ constant.name }}" class="headerlink"><i class="fas fa-link"></i></a>
5+
</h4>
6+
7+
{{ include('components/element-found-in.html.twig', {'node': constant}) }}
8+
{{ include('components/summary.html.twig', {'node': constant}) }}
9+
{{ include('components/constant-signature.html.twig', {'node': constant}) }}
10+
11+
{{ include('components/description.html.twig', {'node': constant}) }}
12+
{{ include ('components/tags.html.twig', {tags: constant.tags}) }}
13+
</article>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% set constants = constants(node)|sortByVisibility %}
2+
3+
{% if constants is not empty %}
4+
<section class="phpdocumentor-constants">
5+
<h3 class="phpdocumentor-elements__header" id="constants">
6+
Constants
7+
<a href="#constants" class="headerlink"><i class="fas fa-link"></i></a>
8+
</h3>
9+
{% for constant in constants %}
10+
{% include 'components/constant.html.twig' %}
11+
{% endfor %}
12+
</section>
13+
{% endif %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.phpdocumentor-description {
2+
margin-bottom: var(--spacing-md);
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{% if node.description %}
2+
<section class="phpdocumentor-description">{{ node.description|description|markdown }}</section>
3+
{% endif %}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.phpdocumentor-element-found-in {
2+
position: absolute;
3+
top: 0;
4+
right: 0;
5+
font-size: var(--text-sm);
6+
color: gray;
7+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<aside class="phpdocumentor-element-found-in">
2+
<abbr class="phpdocumentor-element-found-in__file" title="{{ node.file.path }}">{{ node.file|route('file:short') }}</abbr>
3+
:
4+
<span class="phpdocumentor-element-found-in__line">{{ node.line }}</span>
5+
</aside>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{{ include('components/summary.html.twig') }}
2+
{{ include('components/description.html.twig') }}
3+
{{ include('components/tags.html.twig', {tags: node.tags}) }}
4+
5+
{{ include ('components/table-of-contents.html.twig') }}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
.phpdocumentor-element {
2+
position: relative;
3+
}
4+
5+
.phpdocumentor .phpdocumentor-element__name {
6+
line-height: 1;
7+
}
8+
9+
.phpdocumentor-element__package,
10+
.phpdocumentor-element__extends,
11+
.phpdocumentor-element__implements {
12+
display: block;
13+
font-size: var(--text-xxs);
14+
font-weight: normal;
15+
opacity: .7;
16+
}
17+
18+
.phpdocumentor-element__package .phpdocumentor-breadcrumbs {
19+
display: inline;
20+
}
21+
22+
.phpdocumentor-element:not(:last-child) {
23+
border-bottom: 1px solid var(--primary-color-lighten);
24+
padding-bottom: var(--spacing-lg);
25+
}
26+
27+
.phpdocumentor-element.-deprecated .phpdocumentor-element__name {
28+
text-decoration: line-through;
29+
}
30+
31+
.phpdocumentor-element__modifier {
32+
font-size: var(--text-xxs);
33+
padding: calc(var(--spacing-base-size) / 4) calc(var(--spacing-base-size) / 2);
34+
color: var(--text-color);
35+
background-color: var(--light-gray);
36+
border-radius: 3px;
37+
text-transform: uppercase;
38+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h2 class="phpdocumentor-content__title">{{ node.name }}</h2>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<article class="phpdocumentor-element -function -{{ function.visibility }} {% if function.deprecated %}-deprecated{% endif %}">
2+
<h4 class="phpdocumentor-element__name" id="function_{{ function.name }}">
3+
{{ function.name }}()
4+
<a href="#function_{{ function.name }}" class="headerlink"><i class="fas fa-link"></i></a>
5+
</h4>
6+
{{ include('components/element-found-in.html.twig', {'node': function}) }}
7+
{{ include('components/summary.html.twig', {'node': function}) }}
8+
{{ include('components/method-signature.html.twig', {'node': function}) }}
9+
{{ include('components/description.html.twig', {'node': function}) }}
10+
{{ include('components/method-arguments.html.twig', {'node': function}) }}
11+
{{ include('components/tags.html.twig', {tags: function.tags}) }}
12+
{{ include('components/method-response.html.twig', {'node': function}) }}
13+
</article>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{% if node.functions is not empty %}
2+
<section class="phpdocumentor-functions">
3+
<h3 class="phpdocumentor-elements__header" id="functions">
4+
Functions
5+
<a href="#functions" class="headerlink"><i class="fas fa-link"></i></a>
6+
</h3>
7+
{% for function in node.functions %}
8+
{% include 'components/function.html.twig' %}
9+
{% endfor %}
10+
</section>
11+
{% endif %}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.phpdocumentor-title {
2+
box-sizing: border-box;
3+
color: var(--title-text-color);
4+
font-size: var(--text-xxl);
5+
letter-spacing: .05rem;
6+
font-weight: normal;
7+
width: auto;
8+
margin: 0;
9+
display: flex;
10+
align-items: center;
11+
}
12+
13+
.phpdocumentor-title.-without-divider {
14+
border: none;
15+
}
16+
17+
.phpdocumentor-title__link {
18+
transition: all .3s ease-out;
19+
display: flex;
20+
color: var(--title-text-color);
21+
text-decoration: none;
22+
font-weight: normal;
23+
white-space: nowrap;
24+
transform: scale(.75);
25+
transform-origin: left;
26+
}
27+
28+
.phpdocumentor-title__link:hover {
29+
transform: perspective(15rem) translateX(.5rem);
30+
font-weight: 600;
31+
}
32+
33+
@media (min-width: {{ breakpoints['menu'] }}) {
34+
.phpdocumentor-title {
35+
width: 30.6666666667%;
36+
border-right: var(--sidebar-border-color) solid 1px;
37+
}
38+
39+
.phpdocumentor-title__link {
40+
transform-origin: left;
41+
}
42+
}
43+
44+
@media (min-width: {{ breakpoints['xl'] }}) {
45+
.phpdocumentor-title__link {
46+
transform: scale(.85);
47+
}
48+
}
49+
50+
@media (min-width: {{ breakpoints['xxl'] }}) {
51+
.phpdocumentor-title__link {
52+
transform: scale(1);
53+
}
54+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1 class="phpdocumentor-title"><a href="{{ path('/') }}" class="phpdocumentor-title__link">CrowdSec | PHP Bouncer Library</a></h1>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
.phpdocumentor-header {
2+
display: flex;
3+
flex-direction: row;
4+
align-items: stretch;
5+
flex-wrap: wrap;
6+
justify-content: space-between;
7+
height: auto;
8+
padding: var(--spacing-md) var(--spacing-md);
9+
}
10+
11+
.phpdocumentor-header__menu-button {
12+
position: absolute;
13+
top: -100%;
14+
left: -100%;
15+
}
16+
17+
.phpdocumentor-header__menu-icon {
18+
font-size: 2rem;
19+
color: var(--primary-color);
20+
}
21+
22+
.phpdocumentor-header__menu-button:checked ~ .phpdocumentor-topnav {
23+
max-height: 250px;
24+
padding-top: var(--spacing-md);
25+
}
26+
27+
@media (min-width: {{ breakpoints['menu'] }}) {
28+
.phpdocumentor-header {
29+
flex-direction: row;
30+
padding: var(--spacing-lg) var(--spacing-lg);
31+
min-height: var(--header-height);
32+
}
33+
34+
.phpdocumentor-header__menu-icon {
35+
display: none;
36+
}
37+
}
38+
39+
@media (min-width: {{ breakpoints['xl'] }}) {
40+
.phpdocumentor-header {
41+
padding-top: 0;
42+
padding-bottom: 0;
43+
}
44+
}
45+
@media (min-width: {{ breakpoints['xxl'] }}) {
46+
.phpdocumentor-header {
47+
padding: 0;
48+
}
49+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<header class="phpdocumentor-header phpdocumentor-section">
2+
{% include 'components/header-title.html.twig' %}
3+
<input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
4+
<label class="phpdocumentor-header__menu-icon" for="menu-button">
5+
<i class="fas fa-bars"></i>
6+
</label>
7+
{{ include('components/search.html.twig') }}
8+
{% include 'components/topnav.html.twig' %}
9+
</header>

0 commit comments

Comments
 (0)