0

YUIdoc のハングアウトを取得しようとしていますが、動作させることができません: これは私の PHP コードの一部です:

/**
* Estimates whether a number is odd or even
*
*@method odd_or_even
*@param num {number} String to fix
*@return {Boolean} Returns True on even number, False on odd
*/
function odd_or_even($num)
{
return ($num%2); // Returns 0 for odd and 1 for even
}

/**
* Detects if user runs one of the most common browsers
*
*@method detect_browser
*@return {string} Returns the browser name. 'Undefined' for undefined
*/
function detect_browser()
    {
$useragent = $_SERVER['HTTP_USER_AGENT'];

if(strpos($useragent, 'MSIE'))
    $browser = 'Internet explorer';

elseif(strpos($useragent, 'Firefox'))
    $browser = 'Firefox';

elseif(strpos($useragent, 'Chrome'))
    $browser = 'Google Chrome';

elseif(strpos($useragent, 'Opera'))
    $browser = 'Opera';

elseif(strpos($useragent, 'Safari'))
    $browser = 'Safari';

elseif(strpos($useragent, 'SeaMonkey'))
    $browser = 'SeaMonkey';

elseif(strpos($useragent, 'Flock'))
    $browser = 'Flock';

elseif(strpos($useragent, 'Prism'))
    $browser = 'Prism';

elseif(strpos($useragent, 'Deepnet Explorer'))
    $browser = 'Deepnet Explorer';

elseif(strpos($useragent, 'Maxthon'))
    $browser = 'Maxthon';

elseif(strpos($_SERVER['HTTP_USER_AGENT'], 'Avant'))
    $browser = 'Avant';

elseif(strpos($useragent, 'Camino'))
    $browser = 'Camino';

elseif(strpos($useragent, 'Shiira'))
    $browser = 'Shiira';

elseif(strpos($useragent, 'OmniWeb'))
    $browser = 'OmniWeb';

elseif(strpos($useragent, 'iCab'))
    $browser = 'iCab';

elseif(strpos($useragent, 'Stainless'))
    $browser = 'Stainless';

elseif(strpos($useragent, 'Fluid'))
    $browser = 'Fluid';

elseif(strpos($useragent, 'Konqueror'))
    $browser = 'Konqueror';

elseif(strpos($useragent, 'Galeon'))
    $browser = 'Galeon';

elseif(strpos($useragent, 'Epiphany'))
    $browser = 'Epiphany';

elseif(strpos($useragent, 'Swiftfox'))
    $browser = 'Swiftfox';

elseif(strpos($useragent, 'Swiftweasel'))
    $browser = 'Swiftweasel';

else
    $browser = 'Undefined';

return $browser;

}

lib.php として保存し、「yuidoc」を実行します。これは出力です:

info: (yuidoc): Starting YUIDoc@0.3.13 using YUI@3.5.1 with NodeJS@0.6.12
info: (yuidoc): Scanning for yuidoc.json file.
info: (yuidoc): Starting YUIDoc with the following options:
info: (yuidoc): { port: 3000, nocode: false, paths: [ '.' ], outdir: './out' }
info: (yuidoc): YUIDoc Starting from: .
info: (yuidoc): Making out dir: ./out
info: (yuidoc): Parsed 0 files in 0.004 seconds
info: (builder): Building..
info: (builder): Compiling Templates
info: (builder): Making default directories: classes,modules,files
info: (builder): Copying Assets
info: (builder): Rendering and writing 0 modules pages.
info: (builder): Finished writing module files
info: (builder): Rendering and writing 0 class pages.
info: (builder): Finished writing class files
info: (builder): Rendering and writing 0 source files.
info: (builder): Finished writing source files
info: (builder): Preparing index.html
info: (builder): Loading theme from/usr/local/lib/node_modules/yuidocjs/themes/default/theme.json
info: (builder): Writing API Meta Data
info: (builder): Writing index.html
info: (builder): Finished writing 1 files in 0.077 seconds
info: (yuidoc): Completed in 0.085 seconds

そして、ドキュメントは空です。私もjavascriptで試しましたが、同じ結果でした。私は何を間違っていますか?

前もってありがとうアダム

4

1 に答える 1

-1

YUIDoc 構文が正しくフォーマットされていません。アスタリスクと @ タグの間にはスペースが必要です。次のヘッダーは私にとってはうまくいきます:

/**
* Estimates whether a number is odd or even
*
* @method odd_or_even
* @param num {number} String to fix
* @return {Boolean} Returns True on even number, False on odd
*/
function odd_or_even($num)
{
return ($num%2); // Returns 0 for odd and 1 for even
}

/**
* Detects if user runs one of the most common browsers
*
* @method detect_browser
* @return {string} Returns the browser name. 'Undefined' for undefined
*/
于 2012-06-13T23:44:38.717 に答える