简体   繁体   中英

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. 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 "?" at the end of api respectively. Even Scala seems not have any command like "pydoc" for Python or "man" for C language.

Is it true that only way to find api document is by browsing document with web form or am I missing?

Is it true that only way to find api document is by browsing document with web form or am I missing?

It sort of is true at this point.

I wrote an sbt plugin sbt-man but its ability is limited.

> 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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