Skip to content

Instantly share code, notes, and snippets.

@llaumgui
Created September 3, 2014 11:56
Show Gist options
  • Save llaumgui/6a07652fe70f8b6c2ba4 to your computer and use it in GitHub Desktop.
Save llaumgui/6a07652fe70f8b6c2ba4 to your computer and use it in GitHub Desktop.
Exemple of configuration from Sami API documentation (https://github.com/fabpot/Sami).
<?php
/*
* This file is a configuration for Sami: an API documentation generator
* https://github.com/fabpot/Sami
*/
use Sami\Sami;
use Sami\Version\GitVersionCollection;
use Symfony\Component\Finder\Finder;
/* ************************** Begin Configuration *************************** */
$title = 'My project';
$theme = 'enhanced';
$isPhp52 = true;
// Generate documentation for all v2.0.* tags, the 2.0 branch, and the master one
/* $versions = GitVersionCollection::create($dir)
//->addFromTags('v2.0.*')
->add('develop', 'develop branch')
->add('master', 'master branch')
; */
$versions = 'develop';
// Files to parse.
$iterator = Finder::create()
->files()
->name('*.php')
//->exclude('Resources')
->exclude('Tests')
->in($dir = 'src')
;
// Fix build path
if (is_dir(getcwd().'/../../src')) {
$build = getcwd().'/../..'; // For Jenkins
} else {
$build = getcwd().'/../api'; // For command line
}
/* *************************** End Configuration **************************** */
return new Sami($iterator, array(
'theme' => $theme,
'versions' => $versions,
'title' => $title,
'build_dir' => $build.'/api/%version%',
'cache_dir' => $build.'/build/cache/api/%version%',
'default_opened_level' => 2,
'simulate_namespaces' => $isPhp52,
'include_parent_data' => true
));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment