Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
bd921ca
Update with latest PHPDoc default template
claudiosanches Sep 14, 2020
da12d72
Removed old templates
claudiosanches Sep 15, 2020
e1eed1b
Custom header and footer + styles
claudiosanches Sep 15, 2020
3f003b9
Generate source code in build
claudiosanches Sep 16, 2020
fabf9be
Updated template name and version
claudiosanches Sep 16, 2020
855b123
Removed old CSS files
claudiosanches Sep 17, 2020
bd2a70b
Fixed hooks template
claudiosanches Sep 17, 2020
bd1d077
Added icon for iOS and improve scripts location
claudiosanches Sep 17, 2020
204ea26
Restored debounce time
claudiosanches Sep 17, 2020
5d2fde9
Updated icons color
claudiosanches Sep 17, 2020
0236e24
Added source code
claudiosanches Sep 17, 2020
5ec1957
Improved hooks styles
claudiosanches Sep 17, 2020
c0593b3
Fixed return values output
claudiosanches Sep 17, 2020
f81f591
Clean float
claudiosanches Sep 17, 2020
0cdd549
Added hooks reference to sidebar and removed class diagram from menu
claudiosanches Sep 17, 2020
9618ead
Align menu
claudiosanches Sep 17, 2020
3d9d2c4
Fixed list of namespaces
claudiosanches Sep 17, 2020
c2f4f3c
Set default package name to WooCommerce
claudiosanches Sep 18, 2020
fdc0f20
Remove table of contents since introduces incorrect links
claudiosanches Sep 18, 2020
9b99b83
Updated PHPDoc
claudiosanches Sep 19, 2020
766af27
Updated css variables
claudiosanches Sep 22, 2020
f6055e1
Implemented autoComplete.js and improved search
claudiosanches Sep 22, 2020
0bd4115
Make search compatible with old browsers
claudiosanches Sep 22, 2020
6d4344d
Improve search results
claudiosanches Sep 22, 2020
887741d
Introduce hook docs generator
claudiosanches Sep 22, 2020
c749130
Improve hook generator
claudiosanches Sep 22, 2020
882d358
Include hooks in search index
claudiosanches Sep 22, 2020
e4674a0
Run hooks generator on deploy
claudiosanches Sep 22, 2020
0353cb9
Introduced --no-download flag
claudiosanches Sep 22, 2020
aa8638c
Clean build directory on run_build()
claudiosanches Sep 22, 2020
232f8c0
Allow duplicated hooks in search indexes to help find hooks
claudiosanches Sep 22, 2020
43ea2d2
Improved search results styles
claudiosanches Sep 22, 2020
0e3752c
Fixed search results summary styles
claudiosanches Sep 22, 2020
70a84c9
Tidy up
claudiosanches Sep 22, 2020
f54d783
Improve search results
claudiosanches Sep 23, 2020
fa3e4fc
Update PHPDoc
claudiosanches Sep 23, 2020
7aaae71
Clean search cache when code reference gets updated
claudiosanches Sep 23, 2020
6eab103
Use autoComplete.min.js
claudiosanches Sep 23, 2020
b4c6731
Clean CSS cache
claudiosanches Sep 23, 2020
0537dfd
Exclude src/Internal
claudiosanches Sep 23, 2020
c6d6cab
Remove class diagram since there's still some bugs on it
claudiosanches Sep 23, 2020
e440689
Remove graphs
claudiosanches Sep 23, 2020
7ae6e93
Use prefixes for hooks like WP code reference does
claudiosanches Sep 23, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
"php": ">=7.2.5"
},
"require-dev": {
"phpdocumentor/phpdocumentor": "v3.0.0-rc"
"phpdocumentor/phpdocumentor": "dev-master"
}
}
222 changes: 110 additions & 112 deletions composer.lock

Large diffs are not rendered by default.

79 changes: 1 addition & 78 deletions data/templates/woocommerce/base.html.twig
Original file line number Diff line number Diff line change
@@ -1,78 +1 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WooCommerce Code Reference</title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro">
<link rel="stylesheet" href="{{ path('css/normalize.css') }}">
<link rel="stylesheet" href="{{ path('css/template.css') }}">
<link rel="shortcut icon" href="{{ path('images/favicon.png') }}"/>
<link rel="apple-touch-icon" href="{{ path('images/apple-touch-icon.png') }}"/>
<link rel="apple-touch-icon" sizes="72x72" href="{{ path('images/apple-touch-icon-72x72.png') }}"/>
<link rel="apple-touch-icon" sizes="114x114" href="{{ path('images/apple-touch-icon-114x114.png') }}"/>
{% block stylesheets %}{% endblock %}
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.4.6/fuse.min.js"></script>
<script src="{{ path('js/search.js') }}"></script>
<script defer src="{{ path('js/searchIndex.js') }}"></script>
{% block javascripts %}{% endblock %}
</head>
<body>
<header class="phpdocumentor-top-header">
<section class="phpdocumentor-section">
<div class="site-branding">
<a class="site-logo" href="{{ path("/index.html") }}"><img width="180" src="{{ path('images/logo.svg') }}" alt="WooCommerce" /></a>
</div>
<nav class="main-navigation">
<ul>
<li><a href="{{ path('hooks/hooks.html') }}">Hooks Reference</a></li>
{% if project.settings.custom['graphs.enabled'] %}
<li><a href="{{ path('graphs/classes.html') }}">Class Diagram</a></li>
{% endif %}
<li><a href="https://docs.woocommerce.com/">Documentation</a></li>
<li><a href="https://woocommerce.github.io/woocommerce-rest-api-docs/">REST API Docs</a></li>
</ul>
</nav>
</section>
</header>
<header class="phpdocumentor-header">
<section class="phpdocumentor-section">
<h1 class="phpdocumentor-title">WooCommerce Code Reference</h1>
</section>

<section class="phpdocumentor-section">
<div data-search-form class="phpdocumentor-search">
<label class="phpdocumentor-label">
<span class="visually-hidden">Search</span>
<input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading..." disabled />
</label>
</div>
<div data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">

<h2>Search results</h2>
<ul class="phpdocumentor-search-results__entries">

</ul>
</div>
</section>
</header>
<main class="phpdocumentor">
<div class="phpdocumentor-section">
{% include 'sidebar.html.twig' %}

<div class="nine phpdocumentor-columns phpdocumentor-content">
{% block content %}{% endblock %}
</div>
</div>
</main>
<a href="#" class="to-top">Back to the top</a>
<footer class="phpdocumentor phpdocumentor-footer">
<div class="phpdocumentor-section">
<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>
</div>
</footer>
</body>
</html>
{% extends 'layout.html.twig' %}
12 changes: 0 additions & 12 deletions data/templates/woocommerce/breadcrumbs.html.twig

This file was deleted.

146 changes: 8 additions & 138 deletions data/templates/woocommerce/class.html.twig
Original file line number Diff line number Diff line change
@@ -1,145 +1,15 @@
{% extends 'base.html.twig' %}

{% block content %}
{% include 'breadcrumbs.html.twig' %}
{% include 'components/breadcrumbs.html.twig' %}

<article class="phpdocumentor-element phpdocumentor-class">
<h2 class="phpdocumentor-content__title">
{{ node.name }}
{% if node.parent %}
<span class="phpdocumentor-class__extends">
extends {{ node.parent|route('class:short') }}
</span>
{% endif %}
{% if usesPackages %}
<div class="phpdocumentor-element__package">
in
<ul class="phpdocumentor-breadcrumbs">
{% for breadcrumb in packages(node) %}
<li><a href="{{ link(breadcrumb) }}">{{ breadcrumb.name }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}
{% if node.interfaces is not empty %}
<span class="phpdocumentor-class__implements">
implements
{% for interface in node.interfaces %}
{{ interface|route('class:short') }}{% if not loop.last %}, {% endif %}
{% endfor %}
</span>
{% endif %}
{% if node.usedTraits is not empty %}
<span class="phpdocumentor-class__extends">
Uses
{% for trait in node.usedTraits %}
{{ trait|route('class:short') }}{% if not loop.last %}, {% endif %}
{% endfor %}
</span>
{% endif %}
</h2>
<aside class="phpdocumentor-element-found-in">
<abbr class="phpdocumentor-element-found-in__file" title="{{ node.file.path }}">{{ node.file|route('file:short') }}</abbr>
:
<span class="phpdocumentor-element-found-in__line">{{ node.line }}</span>
</aside>
<article class="phpdocumentor-element -class">
{{ include('components/class-title.html.twig') }}
{{ include('components/element-found-in.html.twig') }}
{{ include('components/element-header.html.twig') }}

<p class="phpdocumentor-class__summary">{{ node.summary }}</p>
<section class="phpdocumentor-class__description">{{ node.description|markdown }}</section>

<h3>Table of Contents</h3>
<table class="phpdocumentor-table_of_contents">
{% for constant in node.constants %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(constant) }}">{{ constant.name }}</a></th>
<td class="phpdocumentor-cell">{{ constant.summary }}</td>
<td class="phpdocumentor-cell">{{ constant.value }}</td>
</tr>
{% endfor %}
{% for property in node.properties %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(property) }}">${{ property.name }}</a></th>
<td class="phpdocumentor-cell">{{ property.summary }}</td>
<td class="phpdocumentor-cell">{{ property.type|route('class:short')|join('|')|raw }}</td>
</tr>
{% endfor %}
{% for property in node.magicProperties %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(property) }}">${{ property.name }}</a></th>
<td class="phpdocumentor-cell">{{ property.summary }}</td>
<td class="phpdocumentor-cell">{{ property.type|route('class:short')|join('|')|raw }}</td>
</tr>
{% endfor %}
{% for property in node.inheritedProperties %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(property) }}">${{ property.name }}</a></th>
<td class="phpdocumentor-cell">{{ property.summary }}</td>
<td class="phpdocumentor-cell">{{ property.type|route('class:short')|join('|')|raw }}</td>
</tr>
{% endfor %}
{% for method in node.methods %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(method) }}">{{ method.name }}()</a></th>
<td class="phpdocumentor-cell">{{ method.summary }}</td>
<td class="phpdocumentor-cell">{{ method.response.type|route('class:short')|join('|')|raw }}</td>
</tr>
{% endfor %}
{% for method in node.magicMethods %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(method) }}">{{ method.name }}()</a></th>
<td class="phpdocumentor-cell">{{ method.summary }}</td>
<td class="phpdocumentor-cell">{{ method.response.type|route('class:short')|join('|')|raw }}</td>
</tr>
{% endfor %}
{% for method in node.inheritedMethods %}
<tr>
<th class="phpdocumentor-heading"><a href="{{ link(method) }}">{{ method.name }}()</a></th>
<td class="phpdocumentor-cell">{{ method.summary }}</td>
<td class="phpdocumentor-cell">{{ method.response.type|route('class:short')|join('|')|raw }}</td>
</tr>
{% endfor %}
</table>

{% if node.constants is not empty %}
<section>
<h3 class="phpdocumentor-constants__header">Constants</h3>
{% for constant in node.constants %}
{% include 'constant.html.twig' %}
{% endfor %}
{% for constant in node.inheritedConstants %}
{% include 'constant.html.twig' %}
{% endfor %}
</section>
{% endif %}

{% if node.properties is not empty or node.magicProperties is not empty or node.inheritedProperties is not empty %}
<section>
<h3 class="phpdocumentor-properties__header">Properties</h3>
{% for property in node.properties %}
{% include 'property.html.twig' %}
{% endfor %}
{% for property in node.magicProperties %}
{% include 'property.html.twig' %}
{% endfor %}
{% for property in node.inheritedProperties %}
{% include 'property.html.twig' %}
{% endfor %}
</section>
{% endif %}

{% if node.methods is not empty or node.magicMethods is not empty or node.inheritedMethods is not empty %}
<section>
<h3 class="phpdocumentor-methods__header">Methods</h3>
{% for method in node.methods %}
{% include 'method.html.twig' %}
{% endfor %}
{% for method in node.magicMethods %}
{% include 'method.html.twig' %}
{% endfor %}
{% for method in node.inheritedMethods %}
{% include 'method.html.twig' %}
{% endfor %}
</section>
{% endif %}
{{ include('components/constants.html.twig') }}
{{ include('components/properties.html.twig') }}
{{ include('components/methods.html.twig') }}
</article>
{% endblock %}
9 changes: 9 additions & 0 deletions data/templates/woocommerce/components/admonition.css.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.phpdocumentor-admonition {
border: 1px solid var(--admonition-border-color);
border-radius: var(--border-radius-base-size);
padding: var(--spacing-sm) var(--spacing-md);
}

.phpdocumentor-admonition--success {
border-color: var(--admonition-success-color);
}
13 changes: 13 additions & 0 deletions data/templates/woocommerce/components/back-to-top.css.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.phpdocumentor .phpdocumentor-back-to-top {
position: fixed;
bottom: 2rem;
font-size: 2.5rem;
opacity: .25;
transition: all .3s ease-in-out;
right: 2rem;
}

.phpdocumentor .phpdocumentor-back-to-top:hover {
color: var(--link-color-primary);
opacity: 1;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<a href="#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
22 changes: 22 additions & 0 deletions data/templates/woocommerce/components/breadcrumbs.css.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.phpdocumentor ul.phpdocumentor-breadcrumbs {
font-size: var(--text-md);
list-style: none;
margin: 0;
padding: 0;
}

.phpdocumentor ul.phpdocumentor-breadcrumbs a {
color: var(--text-color);
text-decoration: none;
}

.phpdocumentor ul.phpdocumentor-breadcrumbs > li {
display: inline-block;
margin: 0;
}

.phpdocumentor ul.phpdocumentor-breadcrumbs > li + li:before {
color: var(--dark-gray);
content: "\\\A0";
padding: 0;
}
6 changes: 6 additions & 0 deletions data/templates/woocommerce/components/breadcrumbs.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{% set breadcrumbs = usesNamespaces ? breadcrumbs(node) : packages(node) %}
<ul class="phpdocumentor-breadcrumbs">
{% for breadcrumb in breadcrumbs %}
<li class="phpdocumentor-breadcrumb"><a href="{{ link(breadcrumb) }}">{{ breadcrumb.name }}</a></li>
{% endfor %}
</ul>
7 changes: 7 additions & 0 deletions data/templates/woocommerce/components/class-graph.css.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.phpdocumentor-class-graph {
width: 100%; height: 600px; border:1px solid black; overflow: hidden
}

.phpdocumentor-class-graph__graph {
width: 100%;
}
38 changes: 38 additions & 0 deletions data/templates/woocommerce/components/class-title.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<h2 class="phpdocumentor-content__title">
{{ node.name }}

{% if node.parent %}
<span class="phpdocumentor-element__extends">
extends {{ node.parent|route('class:short') }}
</span>
{% endif %}

{% if usesPackages %}
<div class="phpdocumentor-element__package">
in package
<ul class="phpdocumentor-breadcrumbs">
{% for breadcrumb in packages(node) %}
<li class="phpdocumentor-breadcrumb"><a href="{{ link(breadcrumb) }}">{{ breadcrumb.name }}</a></li>
{% endfor %}
</ul>
</div>
{% endif %}

{% if node.interfaces is not empty %}
<span class="phpdocumentor-element__implements">
implements
{% for interface in node.interfaces %}
{{ interface|route('class:short') }}{% if not loop.last %}, {% endif %}
{% endfor %}
</span>
{% endif %}

{% if node.usedTraits is not empty %}
<span class="phpdocumentor-element__extends">
Uses
{% for trait in node.usedTraits %}
{{ trait|route('class:short') }}{% if not loop.last %}, {% endif %}
{% endfor %}
</span>
{% endif %}
</h2>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<code class="phpdocumentor-signature phpdocumentor-code {% if node.deprecated %}-deprecated{% endif %}">
<span class="phpdocumentor-signature__visibility">{{ node.visibility }}</span>
<span class="phpdocumentor-signature__type">{{ not node.type ? "mixed" : node.type|route('class:short')|join('|')|raw }}</span>
<span class="phpdocumentor-signature__name">{{ node.name }}</span>
= <span class="phpdocumentor-signature__default-value">{{ node.value ?: '""' }}</span>
</code>
13 changes: 13 additions & 0 deletions data/templates/woocommerce/components/constant.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<article class="phpdocumentor-element -constant -{{ constant.visibility }} {% if constant.deprecated %}-deprecated{% endif %}">
<h4 class="phpdocumentor-element__name" id="constant_{{ constant.name }}">
{{ constant.name }}
<a href="#constant_{{ constant.name }}" class="headerlink"><i class="fas fa-link"></i></a>
</h4>

{{ include('components/element-found-in.html.twig', {'node': constant}) }}
{{ include('components/summary.html.twig', {'node': constant}) }}
{{ include('components/constant-signature.html.twig', {'node': constant}) }}

{{ include('components/description.html.twig', {'node': constant}) }}
{{ include ('components/tags.html.twig', {tags: constant.tags}) }}
</article>
13 changes: 13 additions & 0 deletions data/templates/woocommerce/components/constants.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% set constants = constants(node)|sortByVisibility %}

{% if constants is not empty %}
<section class="phpdocumentor-constants">
<h3 class="phpdocumentor-elements__header" id="constants">
Constants
<a href="#constants" class="headerlink"><i class="fas fa-link"></i></a>
</h3>
{% for constant in constants %}
{% include 'components/constant.html.twig' %}
{% endfor %}
</section>
{% endif %}
3 changes: 3 additions & 0 deletions data/templates/woocommerce/components/description.css.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.phpdocumentor-description {
margin-bottom: var(--spacing-md);
}
Loading