Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit 4d3c1ff

Browse files
author
Nikolaus Kühn
committed
chore(apiGen): improve documentation layout and title details
1 parent ab974aa commit 4d3c1ff

File tree

3 files changed

+41
-27
lines changed

3 files changed

+41
-27
lines changed

build/theme/@layout.latte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta charset="utf-8">
77
<meta name="robots" content="noindex" n:if="!$robots">
88

9-
<title>{include title}{if 'overview' !== $active && $config->title} | {$config->title}{/if}</title>
9+
<title>ct SDK: {include title}{if 'overview' !== $active && $config->title}{/if}</title>
1010

1111
<link rel="stylesheet" href="{='resources/bootstrap.min.css'|staticFile}">
1212
<link rel="stylesheet" href="{='resources/style.css'|staticFile}">

build/theme/class.latte

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{layout '@layout.latte'}
22
{var $active = 'class'}
33

4-
{block title}{if $class->deprecated}Deprecated {/if}{if $class->interface}Interface{elseif $class->trait}Trait{else}Class{/if} {$class->name}{/block}
4+
{block title}{$class->name} {if $class->deprecated}(Deprecated){/if}{if $class->interface}(Interface){elseif $class->trait}(Trait){else}(Class){/if}{/block}
55

66
{block content}
77
<div id="content" class="class">
@@ -74,28 +74,30 @@
7474
</div>
7575

7676
<div class="alert alert-info">
77-
{if !$class->interface && !$class->trait && ($class->abstract || $class->final)}<b>{if $class->abstract}Abstract{else}Final{/if}</b><br>{/if}
78-
{if $class->internal}<b>PHP Extension:</b> <a href="{$class->extension|manualUrl}" title="Go to PHP documentation">{$class->extension->name|firstUpper}</a><br>{/if}
79-
{if $class->inNamespace()}<b>Namespace:</b> {$class->namespaceName|namespaceLinks|noescape}<br>{/if}
80-
{if $class->inPackage()}<b>Package:</b> {$class->packageName|packageLinks|noescape}<br>{/if}
81-
82-
{if $class->internal}
83-
<b>Documented at:</b> <a href="{$class|manualUrl}" title="Go to PHP documentation">php.net</a><br>
84-
{else}
85-
<b>Located at:</b> <a n:tag-if="$config->sourceCode" href="{$class|sourceUrl}" title="Go to source code">{$class->fileName|relativePath}</a><br>
86-
{/if}
87-
88-
{foreach $template->annotationSort($template->annotationFilter($class->annotations)) as $annotation => $values}
89-
{foreach $values as $value}
90-
{if $annotation == "apidoc"}
91-
<span class="api-doc-link"><b>API documentation: <a href="{$value|noescape}" target="api-doc">{$value|noescape}</a></b></span><br>
92-
{else}
93-
<b>{$annotation|annotationBeautify}{if $value}:{/if}</b>
94-
{$value|annotation:$annotation:$class|noescape}<br>
95-
{/if}
96-
{/foreach}
97-
{/foreach}
98-
<br>
77+
<table class="class-annotations">
78+
{if !$class->interface && !$class->trait && ($class->abstract || $class->final)}<tr><th colspan="2">{if $class->abstract}Abstract{else}Final{/if}</th></tr>{/if}
79+
{if $class->internal}<tr><th>PHP Extension</th><td><a href="{$class->extension|manualUrl}" title="Go to PHP documentation">{$class->extension->name|firstUpper}</a></td></tr>{/if}
80+
{if $class->inNamespace()}<tr><th>Namespace</th><td>{$class->namespaceName|namespaceLinks|noescape}</td></tr>{/if}
81+
{if $class->inPackage()}<tr><th>Package</th><td>{$class->packageName|packageLinks|noescape}</td></tr>{/if}
82+
83+
{if $class->internal}
84+
<tr><th>Documented at</th><td><a href="{$class|manualUrl}" title="Go to PHP documentation">php.net</a></td></tr>
85+
{else}
86+
<tr><th>Located at</td><td><a n:tag-if="$config->sourceCode" href="{$class|sourceUrl}" title="Go to source code">{$class->fileName|relativePath}</a></td></tr>
87+
{/if}
88+
89+
{foreach $template->annotationSort($template->annotationFilter($class->annotations)) as $annotation => $values}
90+
{foreach $values as $value}
91+
{if $annotation == "apidoc"}
92+
<tr><th>API documentation</th><td><b><a href="{$value|noescape}" target="api-doc">{$value|noescape}</a></b></span></td></tr>
93+
{elseif $annotation == "description"}
94+
<tr><td colspan="2">{$value|annotation:$annotation:$class|noescape}</td></tr>
95+
{else}
96+
<tr><th>{$annotation|annotationBeautify}</th><td>{$value|annotation:$annotation:$class|noescape}</td></tr>
97+
{/if}
98+
{/foreach}
99+
{/foreach}
100+
</table>
99101
</div>
100102

101103
{var $ownMethods = $class->ownMethods}
@@ -210,7 +212,7 @@
210212

211213
{if $ownMethods || $ownMagicMethods || $inheritedMethods || $inheritedMagicMethods}
212214
<div class="panel panel-default methods">
213-
<div class="panel-heading"><h2>Methods summary</h2></div>
215+
<div class="panel-heading"><h2>Methods</h2></div>
214216
<table class="summary table table-bordered table-striped methods" id="methods" n:if="$ownMethods || $ownMagicMethods || $inheritedMethods || $inheritedMagicMethods">
215217
{foreach $ownMethods as $method}
216218
{include method, method => $method}
@@ -317,7 +319,7 @@
317319
{/define}
318320

319321
<div class="panel panel-default constants">
320-
<div class="panel-heading"><h2>Constants summary</h2></div>
322+
<div class="panel-heading"><h2>Constants</h2></div>
321323
<table class="summary table table-bordered table-striped constants" id="constants" n:if="$ownConstants || $inheritedConstants">
322324
{foreach $constants as $constant}
323325
{include constant, constant => $constant}
@@ -387,7 +389,7 @@
387389

388390
{if $ownProperties || $ownMagicProperties}
389391
<div class="panel panel-default properties">
390-
<div class="panel-heading"><h2>Properties summary</h2></div>
392+
<div class="panel-heading"><h2>Properties</h2></div>
391393
<table class="summary table table-bordered table-striped properties" id="properties" n:if="$ownProperties">
392394

393395
{foreach $ownProperties as $property}

build/theme/resources/style.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,17 @@ pre code {
264264
max-width: 1000px;
265265
}
266266

267+
.class-annotations th{
268+
font-weight: bold;
269+
white-space: nowrap;
270+
width: 1%;
271+
padding-right: 15px;
272+
}
273+
.class-annotations td{
274+
width: 99%;
275+
}
276+
277+
267278
dl.tree {
268279
margin: 1.2em 0;
269280
padding: 10px;
@@ -299,6 +310,7 @@ h2.switchable {
299310

300311
.summary tr:hover td {
301312
background: #f6f6f4;
313+
cursor: help;
302314
}
303315

304316
.summary .description p {

0 commit comments

Comments
 (0)