简体   繁体   English

REPL中的scala api文档

[英]scala api document in REPL

I'm new at Scala programming and prefer to code in terminal other than eclipse thought it is pretty nice. 我是Scala编程的新手,并且喜欢在eclipse之外的终端编码,因为它非常好。 One thing I couldn't find any information yet is how to retrieve api documents on Scala REPL (that is "scala" or "sbt" command) like python or ipython response on help() or putting "?" 我找不到任何信息的一件事是如何检索Scala REPL上的api文件(即“scala”或“sbt”命令),如python或ipython响应在help()或放“?” at the end of api respectively. 分别在api的末尾。 Even Scala seems not have any command like "pydoc" for Python or "man" for C language. 甚至Scala似乎也没有像Python的“pydoc”或C语言的“man”那样的命令。

Is it true that only way to find api document is by browsing document with web form or am I missing? 只有找到api文档的方法是通过浏览web表单的文件或者我错过了吗?

Is it true that only way to find api document is by browsing document with web form or am I missing? 只有找到api文档的方法是通过浏览web表单的文件或者我错过了吗?

It sort of is true at this point. 在这一点上确实如此。

I wrote an sbt plugin sbt-man but its ability is limited. 我写了一个sbt插件sbt-man,但它的能力是有限的。

> man Traversable /:
[man] scala.collection.Traversable
[man] def /:[B](z: B)(op: (B ⇒ A ⇒ B)): B
[man] Applies a binary operator to a start value and all elements of this
collection, going left to right. Note: /: is alternate syntax for foldLeft;
z /: xs is the same as xs foldLeft z. Note: will not terminate for infinite-
sized collections. Note: might return different results for different runs,
unless the underlying collection type is ordered. or the operator is
associative and commutative. 

For easier downloading I also wrote doctrine . 为了便于下载,我还写了主义

$ doctrine "org.scala-lang" % "scala-library" % "2.11.2" -o ~/doc
[info] unzippped documents to /Users/foo/doc/scala-library-2.11.2-javadoc

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM