Trước hết, bạn cần Scaladoc2 cho phần này, là một phần của Scala 2.10.
Nếu cài đặt 2,10, người dùng cũng cần chuyển tùy chọn -diagrams
sang Scaladoc để tạo biểu đồ. Nhưng nếu bạn làm như vậy nó có thể được rằng các thông báo lỗi sau đây xảy ra:
Graphviz dot encountered an error when generating the diagram for:
_root_
These are usually spurious errors, but if you notice a persistant error on
a diagram, please use the -diagrams-debug flag and report a bug with the output.
Graphviz will be restarted...
Lỗi này xảy ra bởi vì Scaladoc không tạo ra các sơ đồ bằng cách riêng của mình nhưng cố gắng gọi Graphviz, để làm công việc này. Khi chúng ta thêm -diagrams-debug
cờ chúng tôi cũng có được số những thứ khác được thông báo lỗi chính xác:
The following is the log of the failure:
Main thread in _root_: Exception: java.io.IOException: Cannot run program "dot": java.io.IOException: error=2, No such file or directory
Để giải quyết vấn đề người ta cần phải cài đặt các chương trình dot
, mà là một phần của Graphviz. Sau khi làm như vậy người ta có thể thực hiện thành công scaladoc -diagrams <file>.scala
và xem kết quả là thẻ "Loại hệ thống phân cấp" phía trên thanh tìm kiếm thành viên trong tài liệu được tạo.
Thi scaladoc -help
cho thấy thêm thông tin cho sơ đồ lựa chọn:
-diagrams Create inheritance diagrams for classes, traits and packages.
-diagrams-dot-path <path> The path to the dot executable used to generate the inheritance diagrams. Eg: /usr/bin/dot
-diagrams-dot-restart <n> The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5)
-diagrams-dot-timeout <n> The timeout before the graphviz dot util is forcefully closed, in seconds (default: 10)
-diagrams-max-classes <n> The maximum number of superclasses or subclasses to show in a diagram
-diagrams-max-implicits <n> The maximum number of implicitly converted classes to show in a diagram