Skip to content

Commit e301ad9

Browse files
committed
Expanded PHP API Reference
1 parent b719d8c commit e301ad9

File tree

4 files changed

+38
-11
lines changed

4 files changed

+38
-11
lines changed
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{% extends "package-edition-map.twig" %}
22

33
{% block content %}
4-
{% set edition_list = [
4+
{# List of displayable editions sorted in inclusion order, each edition includes the previous ones #}
5+
{% set edition_pill_list = [
56
'experience',
67
'commerce',
78
] %}
@@ -17,15 +18,21 @@
1718
{% endfor %}
1819
{% endif %}
1920

20-
{% if package_edition_map[package] is defined and package_edition_map[package] in edition_list %}
21-
{% set is_supporting = false %}
22-
{% for edition in edition_list %}
23-
{% if edition == package_edition_map[package] %}
24-
{% set is_supporting = true %}
25-
{% endif %}
26-
{% if is_supporting %}
27-
<div class="pill {{ edition }}-pill"></div>
28-
{% endif %}
29-
{% endfor %}
21+
{% if package_edition_map[package] is defined %}
22+
{% if package_edition_map[package] in edition_pill_list %}
23+
{% set is_supporting = false %}
24+
{# display edition pills since minimal edition supporting the package #}
25+
{% for edition in edition_pill_list %}
26+
{% if edition == package_edition_map[package] %}
27+
{% set is_supporting = true %}
28+
{% endif %}
29+
{% if is_supporting %}
30+
<div class="pill {{ edition }}-pill"></div>
31+
{% endif %}
32+
{% endfor %}
33+
{% endif %}
34+
{% else %}
35+
{# if package is not in an edition #}
36+
<div class="pill optional-pill" title="Included in the optional package {{ package }}"></div>
3037
{% endif %}
3138
{% endblock %}

tools/php_api_ref/.phpdoc/template/css/base.css.twig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ ul.breadcrumbs li.breadcrumb-item-current span {
252252
border: 1px solid var(--ibexa-jazzberry);
253253
}
254254

255+
.md-typeset .content-header .optional-pill {
256+
color: var(--sherpa-blue);
257+
border: 1px solid var(--sherpa-blue);
258+
}
259+
255260
.md-typeset .content-header img {
256261
display: inline-block;
257262
margin-bottom: -2px;

tools/php_api_ref/.phpdoc/template/css/custom.css.twig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,14 @@ div.pills {
540540
background-color: var(--ibexa-jazzberry);
541541
}
542542

543+
.optional-pill::after {
544+
content: "Optional";
545+
}
546+
547+
.optional-pill {
548+
background-color: var(--sherpa-blue);
549+
}
550+
543551
.md-clipboard:focus, .md-clipboard:hover {
544552
color: var(--ibexa-jazzberry);
545553
}

tools/php_api_ref/phpdoc.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ OUTPUT_DIR=${2:-./docs/api/php_api/php_api_reference}; # Path to the directory w
77

88
DXP_EDITION='commerce'; # Edition from and for which the Reference is built
99
DXP_VERSION='4.6.*'; # Version from and for which the Reference is built
10+
DXP_ADD_ONS=(connector-ai connector-openai); # Packages not included in $DXP_EDITION but added to the Reference, listed without their vendor "ibexa"
1011
DXP_EDITIONS=(oss headless experience commerce); # Available editions ordered by ascending capabilities
1112
PHPDOC_VERSION='3.5.3'; # Version of phpDocumentor used to build the Reference
1213
PHPDOC_CONF="$(pwd)/tools/php_api_ref/phpdoc.dist.xml"; # Absolute path to phpDocumentor configuration file
@@ -63,6 +64,12 @@ fi;
6364

6465
export COMPOSER_ROOT_VERSION=$DXP_VERSION;
6566

67+
if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
68+
for additional_package in "${DXP_ADD_ONS[@]}"; do
69+
composer require --no-interaction --ignore-platform-reqs --no-scripts ibexa/$additional_package:$DXP_VERSION
70+
done;
71+
fi;
72+
6673
#if [ 0 -eq $DXP_ALREADY_EXISTS ]; then
6774
# MY_PACKAGE='';
6875
# MY_BRANCH='';

0 commit comments

Comments
 (0)