院子0.7.3无法以降价和纺织方式建立我的自述文件 [英] yard 0.7.3 fails to build my README in both markdown and textile

查看:96
本文介绍了院子0.7.3无法以降价和纺织方式建立我的自述文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我决定将我的项目中的README文件转换为markdown,并一直在使用yard验证提供的文档.所以我安装了rdiscount,将README更改为README.md并尝试:

I've decided to convert the README file in a project of mine to markdown and have been using yard verify the documentation rendered out ok. So I installed rdiscount, changed README to README.md and tried:

yard doc README.md

这给了我一个警告:

[warn]: Syntax error in `readme.md`:(3,18): syntax error, unexpected tinteger, expecting $end

所以我尝试了:

yard doc -m markdown -- README.md

相同的问题.正在运行:

Same problem. Running:

yard doc --backtrace -- README.md

提供了更多信息:

[warn]: Syntax error in `readme.md`:(3,18): syntax error, unexpected tinteger, expecting $end
[error]: ParserSyntaxError: syntax error in `README.md`:(3,18): syntax error, unexpected tINTEGER, expecting $end
[error]: Stack trace:
    /Users/wadewest/.rvm/gems/ruby-1.9.2-p290@peppercorn/gems/yard-0.7.3/lib/yard/parser/ruby/ruby_parser.rb:505:in `on_parse_error'
    /Users/wadewest/.rvm/gems/ruby-1.9.2-p290@peppercorn/gems/yard-0.7.3/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /Users/wadewest/.rvm/gems/ruby-1.9.2-p290@peppercorn/gems/yard-0.7.3/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /Users/wadewest/.rvm/gems/ruby-1.9.2-p290@peppercorn/gems/yard-0.7.3/lib/yard/parser/ruby/ruby_parser.rb:15:in `parse'
    /Users/wadewest/.rvm/gems/ruby-1.9.2-p290@peppercorn/gems/yard-0.7.3/lib/yard/parser/source_parser.rb:438:in `parse'
    /Users/wadewest/.rvm/gems/ruby-1.9.2-p290@peppercorn/gems/yard-0.7.3/lib/yard/parser/source_parser.rb:361:in `parse_in_order'

如果我尝试使用纺织品,也会发生同样的事情.如果有人想重现该问题,则该项目位于 github .谢谢.

Same thing happens if I try using textile. If anyone wants to try reproduce the problem, the project is on github. Thank you.

推荐答案

我认为您只是对yard选项感到困惑.帮助说:

I think you're just confused about the yard options. The help says this:

$ yard --help doc
Usage: yard doc [options] [source_files [- extra_files]]
(if a list of source files is omitted, 
  {lib,app}/**/*.rb ext/**/*.c is used.)

Example: yardoc -o documentation/ - FAQ LICENSE
  The above example outputs documentation for files in
  lib/**/*.rb to documentation/ including the extra files
  FAQ and LICENSE.
...

所以当你这样说的时候:

so when you say this:

$ yard doc -m markdown -- README.md

围场将尝试将README.md解释为某种源文件.您的README.md将被解释为Ruby源文件(不是),并且会导致 Ruby 错误,如下所示:

Yard will try to interpret README.md as a source file of some kind. Your README.md will be interpreted as a Ruby source file (which it isn't) and that results in a Ruby error like this:

unexpected tinteger, expecting $end

如果稍微编辑一下README.md,您将看到错误的位置,但是如果您尝试将README.md读取为Ruby源文件,则该错误才有意义.

If you edit your README.md a bit you'll see the location of the error moving around but the error will make sense if you try to read README.md as a Ruby source file.

当完全运行yard时,您不需要说任何有关README.md的信息,yard会自己知道如何处理README.md.

You don't need to say anything about README.md when running yard at all, yard will know what to do with README.md all by itself.

这篇关于院子0.7.3无法以降价和纺织方式建立我的自述文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆