Style de la documentation

This commit is contained in:
Michael RICOIS 2012-05-13 07:27:35 +00:00
parent a8cb0592a4
commit 41142b4907
5 changed files with 49 additions and 22 deletions

View File

@ -5,7 +5,7 @@ class Zend_View_Helper_DocMethod extends Zend_View_Helper_Abstract
protected $_transcodeType = array(
'str' => 'string',
'bool' => 'boolean',
'int' => 'integer',
'integer' => 'int',
);
public function docMethod($method)

View File

@ -6,7 +6,7 @@ class Zend_View_Helper_DocParameter extends Zend_View_Helper_Abstract
protected $types = array(
'string', 'str',
'boolean', 'bool',
'integer', 'int',
'int', 'integer',
'float', 'double',
'array', 'object', 'mixed'
);
@ -14,7 +14,7 @@ class Zend_View_Helper_DocParameter extends Zend_View_Helper_Abstract
protected $_transcodeType = array(
'str' => 'string',
'bool' => 'boolean',
'int' => 'integer',
'integer' => 'int',
);
public function docParameter($params, $serviceTypes)
@ -63,9 +63,9 @@ class Zend_View_Helper_DocParameter extends Zend_View_Helper_Abstract
$output.= '<li>';
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
$output.= ' ';
$output.= $param['name'];
$output.= '<b>' . $param['name'] . '</b>';
if (isset($param['description']) && !empty($param['description'])) {
$output.= ' : '.$param['description'];
$output.= ' - '.$param['description'];
}
if (!in_array($param['type'], $this->types)) {
$output.= $this->parseType($param['type']);

View File

@ -14,7 +14,7 @@ class Zend_View_Helper_DocReturn extends Zend_View_Helper_Abstract
protected $_transcodeType = array(
'str' => 'string',
'bool' => 'boolean',
'int' => 'integer',
'integer' => 'int',
);
public function docReturn($type, $serviceTypes)
@ -55,9 +55,9 @@ class Zend_View_Helper_DocReturn extends Zend_View_Helper_Abstract
$output.= '<li>';
$output.= '<i>' . $this->transcodeType($param['type']) . '</i>';
$output.= ' ';
$output.= $param['name'];
$output.= '<b>'. $param['name'] . '</b>';
if (isset($param['description']) && !empty($param['description'])) {
$output.= ' : '.$param['description'];
$output.= ' - '.$param['description'];
}
if (!in_array($param['type'], $this->types)) {
$output.= $this->parseType($param['type']);

View File

@ -20,23 +20,27 @@
<h1>Détails :</h1>
<?php foreach ($this->serviceMethods as $method) {?>
<div class="function">
<a name="<?php echo $method['name'];?>">&nbsp;</a>
<h2><?php echo $method['name'];?></h2>
<div><u>Description : </u></div>
<a name="<?=$method['name']?>">&nbsp;</a>
<h2><?=$method['name']?></h2>
<div class="titre">Description :</div>
<div class="description"><?=$this->docDescription($method)?></div>
<div class="titre">Empreinte :</div>
<div class="complement"><?=$this->docComplement($method)?></div>
<div class="function-detail" id="<?=$method['name']?>">
<p><?php echo $this->docMethod($method);?></p>
<div><u>Paramètres : </u></div>
<p><?=$this->docMethod($method)?></p>
<div class="titre">Paramètres :</div>
<div class="parameters">
<?php echo $this->docParameter($method['params'], $this->serviceTypes);?>
<?=$this->docParameter($method['params'], $this->serviceTypes);?>
</div>
<div><u>Retour : </u></div>
<div class="titre">Retour :</div>
<div class="return">
<?php echo $this->docReturn($method['return'], $this->serviceTypes);?>
<?=$this->docReturn($method['return'], $this->serviceTypes);?>
</div>
</div>
<p>Exemple : <?php echo $this->docExemple($method['name']);?></p>
<?php $exemple = $this->docExemple($method['name'])?>
<?php if (!empty($exemple)) {?>
<p>Exemple : <?=$exemple?></p>
<?php }?>
</div>
<?php } ?>
</div>

View File

@ -1,4 +1,8 @@
body { font:10pt/140% Arial,Helvetica,sans-serif;}
body {
font-size:0.9em;
font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;
color: #444444;
}
ul, ul li {
margin: 0 5px;
@ -76,9 +80,9 @@ ul, ul li {
margin:10px 5px;
}
#content h1 {font-size:16px; text-decoration:underline;}
#content h2 {font-size:14px;}
#content h3 {font-size:12px;}
#content h1 {font-size:1.2em; text-decoration:underline;}
#content h2 {font-size:1.1em;}
#content h3 {font-size:1em;}
div.op-list, div#wsdl, div.op-detail {
margin:10px 0;
@ -92,11 +96,30 @@ div.op-list ol li {
list-style-type:decimal-leading-zero;
}
.function { padding:0 5px; border-bottom:1px solid; }
.function {
border: 1px solid #D9D9D9;
margin: 15px;
padding:0 10px;
}
.function h2 {
background: none repeat scroll 0 0 #3CA2A2;
color: #FFFFFF;
padding: 5px 10px;
font-weight:bold;
}
.function div.titre {
color: #FF3300;
font-size:1.1em;
font-weight:bold;
margin:5px 0;
}
.function-detail {
margin:5px 20px;
padding:2px;
}
#footer {}