Changeset 75089 in spip-zone
- Timestamp:
- Aug 29, 2013, 2:31:57 PM (7 years ago)
- Location:
- _galaxie_/code.spip.net/autodoc/trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
_galaxie_/code.spip.net/autodoc/trunk/installation.md
r75043 r75089 190 190 #### from:file 191 191 192 Générer des documentations dont les sources sont indiquées dans un fichier 193 192 Générer des documentations dont les sources sont indiquées dans un fichier. 193 194 Par défaut, utilise le fichier svn de la zone. 195 196 php autodoc/bin/autodoc_helper.php from:file 194 197 php autodoc/bin/autodoc_helper.php from:file autodoc.txt 195 198 php autodoc/bin/autodoc_helper.php from:file svn://zone.spip.org/spip-zone/autodoc.txt -
_galaxie_/code.spip.net/autodoc/trunk/src/autodoc/Helpers/Generator.php
r75078 r75089 24 24 private $commands = array(); // forcer des commandes spécifiques à phpdocumentor 25 25 26 // les infos de plugins sont enregistrées dedans pour l'index.html de la commande generateFromFile() 27 private $infos_plugins = array(); 28 26 29 /** 27 30 * Description de la documentation à générer … … 192 195 193 196 $output_base = $this->input->getOption('sorties'); 194 if (!$output_base) $output = $this->dirs['work'] . '/output';197 if (!$output_base) $output_base = $this->dirs['work'] . '/output'; 195 198 196 199 if ($anciens) { … … 233 236 if ($nb_erreur) { 234 237 $this->output->writeln("<comment>$nb_erreur documentation(s) non générée(s) sur " 235 . count($presents) . ". Fin.</comment>");238 . count($presents) . ".</comment>"); 236 239 } else { 237 240 $this->output->writeln("<comment>Toutes les documentations (" 238 . count($presents) . ") ont été générées. Fin.</comment>\n"); 239 } 241 . count($presents) . ") ont été générées.</comment>\n"); 242 } 243 244 // générer un sommaire de toutes ces documentations 245 $this->output->writeln("Création du sommaire des documentations"); 246 247 // ajouter les dépendances du fichier html 248 if (!is_dir($data = $output_base . '/__data')) { 249 mkdir($data); 250 $template = $this->dirs['template']; 251 foreach (array('bootstrap', 'images', 'css', 'js') as $dir) { 252 exec("cp -r '$template/$dir' '$data/$dir'"); 253 } 254 copy("$template/favicon.png", "$output_base/favicon.png"); 255 } 256 257 if (file_exists($index = "$output_base/index.html")) { 258 unlink($index); 259 } 260 261 // obtenir les description des plugins 262 $plugins = array(); 263 foreach ($presents as $prefixe => $present) { 264 if (isset($this->infos_plugins[$prefixe])) { 265 $plugins[$prefixe] = $this->infos_plugins[$prefixe]; 266 } else { 267 // ce n'était pas un plugin ou erreur 268 $plugins[$prefixe] = array( 269 'prefixe' => $prefixe, 270 'nom' => $prefixe, 271 'slogan' => '', 272 'description' => '', 273 'annuaire' => '', 274 'documentation' => '', 275 'developpement' => '', 276 ); 277 } 278 } 279 usort($plugins, function($a, $b) { 280 return ($a['nom'] < $b['nom']) ? -1 : 1; 281 }); 282 283 // charger Twig, générer la page et l'enregitrer 284 $loader = new \Twig_Loader_Filesystem( $this->dirs['helper'] . '/Template' ); 285 $twig = new \Twig_Environment($loader); 286 287 $content = $twig->render('index.html', array( 288 'titre' => 'Documentation automatique des plugins SPIP', 289 'plugins' => $plugins, 290 )); 291 file_put_contents($index, $content); 292 293 294 $this->output->writeln("Fin"); 240 295 } 241 296 … … 317 372 318 373 # executable php de l'application autodoc (extension de l'application phpdocumentor) 319 $this->dirs['bin'] = realpath( $this->dirs['helper'] . '/../ bin');374 $this->dirs['bin'] = realpath( $this->dirs['helper'] . '/../../../bin'); 320 375 321 376 # répertoire racine (celui depuis lequel on execute ce script). … … 326 381 $this->dirs['work'] = $this->dirs['root'] . '/work'; 327 382 383 # répertoire du template zora 384 $this->dirs['template'] = realpath( $this->dirs['helper'] . '/../../../templates/zora'); 385 386 # fichier de config xml pour phpdocumentor 328 387 $this->files['phpdoc.xml'] = $this->dirs['work'] . '/phpdoc.xml'; 329 388 } … … 586 645 * 587 646 * Définir avec le titre, et une présentation (si ce n'est déjà fait). 588 * 647 * 589 648 * @return bool true si on a trouvé un paquet.xml 590 649 **/ … … 607 666 $version = (string)$paquet['version']; 608 667 $prefixe = (string)$paquet['prefix']; 668 $this->infos_plugins[$prefixe] = array( 669 'nom' => $nom, 670 'prefixe' => $prefixe, 671 'slogan' => '', 672 'description' => '', 673 'annuaire' => '', 674 'documentation' => '', 675 'developpement' => '', 676 ); 609 677 $documentation = $developpement = $lien_plugins_spip = ''; 610 678 611 679 if (isset($paquet['documentation'])) { 612 680 $documentation = $paquet['documentation']; 681 $this->infos_plugins[$prefixe]['documentation'] = $documentation; 613 682 } 614 683 if (isset($paquet['developpement'])) { 615 684 $developpement = $paquet['developpement']; 616 } 685 $this->infos_plugins[$prefixe]['developpement'] = $developpement; 686 } 687 617 688 if (!$is_spip) { 618 689 $lien_plugins_spip = "http://plugins.spip.net/$prefixe.html"; 619 620 // si le nom n'est pas renseigné, chercher dans la chaîne de langue. 621 if (!$nom) { 622 $langue = $source . "/lang/paquet-$prefixe"."_fr.php"; 623 if (file_exists($langue)) { 624 $GLOBALS['idx_lang'] = 'pour_autodoc'; 625 defined('_ECRIRE_INC_VERSION') || define('_ECRIRE_INC_VERSION', 1); 626 @include $langue; 627 $infos = $GLOBALS['pour_autodoc']; 628 if (is_array($infos) and isset($infos["$prefixe" . "_nom"])) { 690 $this->infos_plugins[$prefixe]['annuaire'] = $lien_plugins_spip; 691 692 // récupérer les infos dans les chaînes de langue. 693 694 $langue = $source . "/lang/paquet-$prefixe"."_fr.php"; 695 if (file_exists($langue)) { 696 $GLOBALS['idx_lang'] = 'pour_autodoc'; 697 defined('_ECRIRE_INC_VERSION') || define('_ECRIRE_INC_VERSION', 1); 698 @include $langue; 699 $infos = $GLOBALS['pour_autodoc']; 700 701 if (is_array($infos)) { 702 if (!$nom and isset($infos["$prefixe" . "_nom"])) { 629 703 $nom = $infos["$prefixe" . "_nom"]; 704 $this->infos_plugins[$prefixe]['nom'] = $nom; 705 } 706 if (isset($infos["$prefixe" . "_slogan"])) { 707 $this->infos_plugins[$prefixe]['slogan'] = $infos["$prefixe" . "_slogan"]; 708 } 709 if (isset($infos["$prefixe" . "_descriptif"])) { 710 $this->infos_plugins[$prefixe]['descriptif'] = $infos["$prefixe" . "_descriptif"]; 630 711 } 631 712 } -
_galaxie_/code.spip.net/autodoc/trunk/templates/zora/inclure/nav.twig
r74916 r75089 34 34 35 35 <div class="nav-collapse collapse navbar-responsive-collapse"> 36 <ul class="nav"> 37 <ul class="nav nav-tabs"> 36 <ul class="nav nav-tabs"> 38 37 39 40 38 {%- for e in elements %} 39 {%- if e.elements.count %} 41 40 42 43 44 45 46 47 48 41 <li>{{ '' -}} 42 <a href="{{ path(e.path) }}" title="{{ e.elements.count ~ ' ' ~ e.nom|lower }}"> 43 {{- e.nom -}} 44 </a>{{ '' -}} 45 </li> 46 {%- endif %} 47 {%- endfor %} 49 48 50 49 {%- if classes.afficher %} 51 50 52 53 54 55 56 57 58 59 60 61 62 63 64 51 <li> 52 {%- set virgule = false -%} 53 <a href="{{ path( classes.path ) }}" title=" 54 {%- for type,collection in classes.elements if collection.count -%} 55 {%- if virgule %}, {% endif -%} 56 {%- set virgule = true -%} 57 {{ collection.count ~ ' ' ~ type }} 58 {%- endfor -%} 59 "> 60 {{- classes.nom -}} 61 </a>{{ '' -}} 62 </li> 63 {%- endif %} 65 64 66 65 <li><a href="{{ path('statistiques.html') }}">Statistiques</a></li> 67 66 68 {#- <!-- lien temporaire --> 69 <li><a href="{{ path('debug.html') }}">Debug</a></li> 70 #} 71 </ul> 67 {#- <!-- lien temporaire --> 68 <li><a href="{{ path('debug.html') }}">Debug</a></li> 69 #} 72 70 </ul> 73 71 … … 75 73 <input type="text" name="q" placeholder="Recherche" class="search-query span2"> 76 74 </form> 77 </div><!-- /. babarre -->78 </div><!-- /. nav-collapse -->75 </div><!-- /.nav-collapse --> 76 </div><!-- /.babarre --> 79 77 </div> 80 78 </div><!-- /navbar-inner -->
Note: See TracChangeset
for help on using the changeset viewer.