Skip to content

Commit 0b37fb2

Browse files
Merge pull request #8 from woocommerce/v2
New template with source code and faster search engine
2 parents dd6ebb9 + 7ae6e93 commit 0b37fb2

File tree

99 files changed

+2781
-12710
lines changed

Some content is hidden

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

99 files changed

+2781
-12710
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"php": ">=7.2.5"
1111
},
1212
"require-dev": {
13-
"phpdocumentor/phpdocumentor": "v3.0.0-rc"
13+
"phpdocumentor/phpdocumentor": "dev-master"
1414
}
1515
}

composer.lock

Lines changed: 110 additions & 112 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1 @@
1-
<!DOCTYPE html>
2-
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<title>WooCommerce Code Reference</title>
6-
<meta name="description" content="">
7-
<meta name="author" content="">
8-
<meta name="viewport" content="width=device-width, initial-scale=1">
9-
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro">
10-
<link rel="stylesheet" href="{{ path('css/normalize.css') }}">
11-
<link rel="stylesheet" href="{{ path('css/template.css') }}">
12-
<link rel="shortcut icon" href="{{ path('images/favicon.png') }}"/>
13-
<link rel="apple-touch-icon" href="{{ path('images/apple-touch-icon.png') }}"/>
14-
<link rel="apple-touch-icon" sizes="72x72" href="{{ path('images/apple-touch-icon-72x72.png') }}"/>
15-
<link rel="apple-touch-icon" sizes="114x114" href="{{ path('images/apple-touch-icon-114x114.png') }}"/>
16-
{% block stylesheets %}{% endblock %}
17-
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
18-
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.4.6/fuse.min.js"></script>
19-
<script src="{{ path('js/search.js') }}"></script>
20-
<script defer src="{{ path('js/searchIndex.js') }}"></script>
21-
{% block javascripts %}{% endblock %}
22-
</head>
23-
<body>
24-
<header class="phpdocumentor-top-header">
25-
<section class="phpdocumentor-section">
26-
<div class="site-branding">
27-
<a class="site-logo" href="{{ path("/index.html") }}"><img width="180" src="{{ path('images/logo.svg') }}" alt="WooCommerce" /></a>
28-
</div>
29-
<nav class="main-navigation">
30-
<ul>
31-
<li><a href="{{ path('hooks/hooks.html') }}">Hooks Reference</a></li>
32-
{% if project.settings.custom['graphs.enabled'] %}
33-
<li><a href="{{ path('graphs/classes.html') }}">Class Diagram</a></li>
34-
{% endif %}
35-
<li><a href="https://docs.woocommerce.com/">Documentation</a></li>
36-
<li><a href="https://woocommerce.github.io/woocommerce-rest-api-docs/">REST API Docs</a></li>
37-
</ul>
38-
</nav>
39-
</section>
40-
</header>
41-
<header class="phpdocumentor-header">
42-
<section class="phpdocumentor-section">
43-
<h1 class="phpdocumentor-title">WooCommerce Code Reference</h1>
44-
</section>
45-
46-
<section class="phpdocumentor-section">
47-
<div data-search-form class="phpdocumentor-search">
48-
<label class="phpdocumentor-label">
49-
<span class="visually-hidden">Search</span>
50-
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading..." disabled />
51-
</label>
52-
</div>
53-
<div data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
54-
55-
<h2>Search results</h2>
56-
<ul class="phpdocumentor-search-results__entries">
57-
58-
</ul>
59-
</div>
60-
</section>
61-
</header>
62-
<main class="phpdocumentor">
63-
<div class="phpdocumentor-section">
64-
{% include 'sidebar.html.twig' %}
65-
66-
<div class="nine phpdocumentor-columns phpdocumentor-content">
67-
{% block content %}{% endblock %}
68-
</div>
69-
</div>
70-
</main>
71-
<a href="#" class="to-top">Back to the top</a>
72-
<footer class="phpdocumentor phpdocumentor-footer">
73-
<div class="phpdocumentor-section">
74-
<span>WooCommerce Code Reference API documentation generated by <a href="http://www.phpdoc.org/">phpDocumentor</a> on {{ "now"|date('F jS, Y \\a\\t h:i a') }}.</span>
75-
</div>
76-
</footer>
77-
</body>
78-
</html>
1+
{% extends 'layout.html.twig' %}

data/templates/woocommerce/breadcrumbs.html.twig

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 8 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,15 @@
11
{% extends 'base.html.twig' %}
22

33
{% block content %}
4-
{% include 'breadcrumbs.html.twig' %}
4+
{% include 'components/breadcrumbs.html.twig' %}
55

6-
<article class="phpdocumentor-element phpdocumentor-class">
7-
<h2 class="phpdocumentor-content__title">
8-
{{ node.name }}
9-
{% if node.parent %}
10-
<span class="phpdocumentor-class__extends">
11-
extends {{ node.parent|route('class:short') }}
12-
</span>
13-
{% endif %}
14-
{% if usesPackages %}
15-
<div class="phpdocumentor-element__package">
16-
in
17-
<ul class="phpdocumentor-breadcrumbs">
18-
{% for breadcrumb in packages(node) %}
19-
<li><a href="{{ link(breadcrumb) }}">{{ breadcrumb.name }}</a></li>
20-
{% endfor %}
21-
</ul>
22-
</div>
23-
{% endif %}
24-
{% if node.interfaces is not empty %}
25-
<span class="phpdocumentor-class__implements">
26-
implements
27-
{% for interface in node.interfaces %}
28-
{{ interface|route('class:short') }}{% if not loop.last %}, {% endif %}
29-
{% endfor %}
30-
</span>
31-
{% endif %}
32-
{% if node.usedTraits is not empty %}
33-
<span class="phpdocumentor-class__extends">
34-
Uses
35-
{% for trait in node.usedTraits %}
36-
{{ trait|route('class:short') }}{% if not loop.last %}, {% endif %}
37-
{% endfor %}
38-
</span>
39-
{% endif %}
40-
</h2>
41-
<aside class="phpdocumentor-element-found-in">
42-
<abbr class="phpdocumentor-element-found-in__file" title="{{ node.file.path }}">{{ node.file|route('file:short') }}</abbr>
43-
:
44-
<span class="phpdocumentor-element-found-in__line">{{ node.line }}</span>
45-
</aside>
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') }}
4610

47-
<p class="phpdocumentor-class__summary">{{ node.summary }}</p>
48-
<section class="phpdocumentor-class__description">{{ node.description|markdown }}</section>
49-
50-
<h3>Table of Contents</h3>
51-
<table class="phpdocumentor-table_of_contents">
52-
{% for constant in node.constants %}
53-
<tr>
54-
<th class="phpdocumentor-heading"><a href="{{ link(constant) }}">{{ constant.name }}</a></th>
55-
<td class="phpdocumentor-cell">{{ constant.summary }}</td>
56-
<td class="phpdocumentor-cell">{{ constant.value }}</td>
57-
</tr>
58-
{% endfor %}
59-
{% for property in node.properties %}
60-
<tr>
61-
<th class="phpdocumentor-heading"><a href="{{ link(property) }}">${{ property.name }}</a></th>
62-
<td class="phpdocumentor-cell">{{ property.summary }}</td>
63-
<td class="phpdocumentor-cell">{{ property.type|route('class:short')|join('|')|raw }}</td>
64-
</tr>
65-
{% endfor %}
66-
{% for property in node.magicProperties %}
67-
<tr>
68-
<th class="phpdocumentor-heading"><a href="{{ link(property) }}">${{ property.name }}</a></th>
69-
<td class="phpdocumentor-cell">{{ property.summary }}</td>
70-
<td class="phpdocumentor-cell">{{ property.type|route('class:short')|join('|')|raw }}</td>
71-
</tr>
72-
{% endfor %}
73-
{% for property in node.inheritedProperties %}
74-
<tr>
75-
<th class="phpdocumentor-heading"><a href="{{ link(property) }}">${{ property.name }}</a></th>
76-
<td class="phpdocumentor-cell">{{ property.summary }}</td>
77-
<td class="phpdocumentor-cell">{{ property.type|route('class:short')|join('|')|raw }}</td>
78-
</tr>
79-
{% endfor %}
80-
{% for method in node.methods %}
81-
<tr>
82-
<th class="phpdocumentor-heading"><a href="{{ link(method) }}">{{ method.name }}()</a></th>
83-
<td class="phpdocumentor-cell">{{ method.summary }}</td>
84-
<td class="phpdocumentor-cell">{{ method.response.type|route('class:short')|join('|')|raw }}</td>
85-
</tr>
86-
{% endfor %}
87-
{% for method in node.magicMethods %}
88-
<tr>
89-
<th class="phpdocumentor-heading"><a href="{{ link(method) }}">{{ method.name }}()</a></th>
90-
<td class="phpdocumentor-cell">{{ method.summary }}</td>
91-
<td class="phpdocumentor-cell">{{ method.response.type|route('class:short')|join('|')|raw }}</td>
92-
</tr>
93-
{% endfor %}
94-
{% for method in node.inheritedMethods %}
95-
<tr>
96-
<th class="phpdocumentor-heading"><a href="{{ link(method) }}">{{ method.name }}()</a></th>
97-
<td class="phpdocumentor-cell">{{ method.summary }}</td>
98-
<td class="phpdocumentor-cell">{{ method.response.type|route('class:short')|join('|')|raw }}</td>
99-
</tr>
100-
{% endfor %}
101-
</table>
102-
103-
{% if node.constants is not empty %}
104-
<section>
105-
<h3 class="phpdocumentor-constants__header">Constants</h3>
106-
{% for constant in node.constants %}
107-
{% include 'constant.html.twig' %}
108-
{% endfor %}
109-
{% for constant in node.inheritedConstants %}
110-
{% include 'constant.html.twig' %}
111-
{% endfor %}
112-
</section>
113-
{% endif %}
114-
115-
{% if node.properties is not empty or node.magicProperties is not empty or node.inheritedProperties is not empty %}
116-
<section>
117-
<h3 class="phpdocumentor-properties__header">Properties</h3>
118-
{% for property in node.properties %}
119-
{% include 'property.html.twig' %}
120-
{% endfor %}
121-
{% for property in node.magicProperties %}
122-
{% include 'property.html.twig' %}
123-
{% endfor %}
124-
{% for property in node.inheritedProperties %}
125-
{% include 'property.html.twig' %}
126-
{% endfor %}
127-
</section>
128-
{% endif %}
129-
130-
{% if node.methods is not empty or node.magicMethods is not empty or node.inheritedMethods is not empty %}
131-
<section>
132-
<h3 class="phpdocumentor-methods__header">Methods</h3>
133-
{% for method in node.methods %}
134-
{% include 'method.html.twig' %}
135-
{% endfor %}
136-
{% for method in node.magicMethods %}
137-
{% include 'method.html.twig' %}
138-
{% endfor %}
139-
{% for method in node.inheritedMethods %}
140-
{% include 'method.html.twig' %}
141-
{% endfor %}
142-
</section>
143-
{% endif %}
11+
{{ include('components/constants.html.twig') }}
12+
{{ include('components/properties.html.twig') }}
13+
{{ include('components/methods.html.twig') }}
14414
</article>
14515
{% endblock %}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.phpdocumentor-admonition {
2+
border: 1px solid var(--admonition-border-color);
3+
border-radius: var(--border-radius-base-size);
4+
padding: var(--spacing-sm) var(--spacing-md);
5+
}
6+
7+
.phpdocumentor-admonition--success {
8+
border-color: var(--admonition-success-color);
9+
}
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>

0 commit comments

Comments
 (0)