1

在过去的 4 天里,我一直在试图让 yuidoc 解析我的 javascript 框架,这真的让我抓狂了。

这是我的 json 配置文件

{ linkNatives: 'true',
  attributesEmit: 'true',
  paths: [ '..\\\\layers' ],
  outdir: '../docs/',
  port: 3000,
  nocode: true,
  extension: '.js',
  project:
   { name: '{NAME}',
     description: '{DESCRIPTION}',
     version: '1.0.0',
     url: 'http://docs.mysite.com/',
     logo: 'http://docs.mysite.com/img/logo.png',
     themedir: 'yuidoc-bootstrap-theme' } }

它正在解析 json 配置并且没有错误。这是输出:

$ yuidoc ../layers
info: (yuidoc): Starting YUIDoc@0.3.46 using YUI@3.9.1 with NodeJS@0.10.24
info: (yuidoc): Scanning for yuidoc.json file.
info: (yuidoc): Loading yuidoc.json data from:    C:\devtools\GitHub\Framework\tools\yuidoc.json
info: (yuidoc): Starting YUIDoc with the following options:
info: (yuidoc):
{ linkNatives: 'true',
  attributesEmit: 'true',
  paths: [ '..\\\\layers' ],
  outdir: '../docs',
  port: 3000,
  nocode: false,
  project:
   { name: '{NAME}',
     description: '{DESCRIPTION}',
     version: '1.0.0',
     url: 'http://docs.mysite.com/',
     logo: 'http://docs.mysite.com/img/logo.png',
     themedir: 'yuidoc-bootstrap-theme' } }
info: (yuidoc): YUIDoc Starting from: ..\\layers
Nlaak@Nlaak-PC /cygdrive/c/devtools/GitHub/Framework/tools
$

我可以使用命令行和输出和主题的默认设置让它工作,但它没有我的项目构建和版本信息。Bootstrap 主题在 Github 上并且确实有效。我在 Windows 7 64 位上使用 Cygwin 64 位。

我有... - 检查行尾 - 以最少的编辑复制和粘贴 yuidocs 示例 - 以各种方式尝试命令行 - 验证所有路径和目录都存在

帮助!为什么没有错误也没有输出。

4

2 回答 2

1

我认为 YUIDoc 在应用自定义配置时存在错误。

尝试在配置 JSON 中添加带有“outdir”条目的“输出”属性。

例如:

{
  linkNatives: 'true',
  attributesEmit: 'true',
  paths: ['..\\\\layers'],
  port: 3000,
  nocode: true,
  extension: '.js',
  project: {
    name: '{NAME}',
    description: '{DESCRIPTION}',
    version: '1.0.0',
    url: 'http://docs.mysite.com/',
    logo: 'http://docs.mysite.com/img/logo.png',
    themedir: 'yuidoc-bootstrap-theme',
    options: {
        outdir: '..\out'
    }
  }
}
于 2014-01-21T17:48:14.187 回答
1

像这样创建 yuidoc.json

{
    "name": "yout title",    
    "version": "1.0.0",     
    "options": {                
        "outdir": "./docs"              
    }
}

并在您的终端中运行

c://user/test> yuidoc . -c yuidoc.json --server  <js filder path ex: ./example> 
于 2014-05-12T12:12:48.597 回答