做文件之外,如果可以畫一些圖的話,會讓讀者更容易有feel.
而doxygen是透過graphviz來畫圖。
首先要安裝graphviz套件。
然後,昨天Doxygen -g 產生的設定檔,
Doxyfile ,用搜尋功能,找到其中的三處設定,
If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
available from the path. This tool is part of Graphviz, a graph visualization
toolkit from AT&T and Lucent Bell Labs. The other options in this section
have no effect if this option is set to NO (the default)
HAVE_DOT = YES
If the CALL_GRAPH and HAVE_DOT options are set to YES then
doxygen will generate a call dependency graph for every global function
or class method. Note that enabling this option will significantly increase
the time of a run. So in most cases it will be better to enable call graphs
for selected functions only using the \callgraph command.
CALL_GRAPH = YES
If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
doxygen will generate a caller dependency graph for every global function
or class method. Note that enabling this option will significantly increase
the time of a run. So in most cases it will be better to enable caller
graphs for selected functions only using the \callergraph command.
CALLER_GRAPH = YES
#號是註解,USER只要把NO, 改成YES, 就可以畫圖了。
重新再產生文件,
doxygen Doxyfile 。
這時候,進去html目錄,打開index.html,
多了幾張小圖,
讓本來排版精美的手冊,
又多加幾分色彩。
更進階的設定,可以參考 官網 http://www.stack.nl/~dimitri/doxygen/manual/diagrams.html
doxygen 在自由軟體界算是個寫文件的不成文標準,如果是FSF基金會主導的軟體專案,是有標準的
手冊,info 格式(Stallman先生的作品)為主。老一輩的man page. 這些手冊的寫法,和CODE 是分離的,
而doxygen是CODE和文件放一起,這會讓人的閱讀源碼的習慣,或多或少需要改變。
Ben先生的這本書,一本書已經沒幾頁了,卻還有三分之一在介紹程式員的工具。比較少見,這樣做是好還是不好,當然見仁見智。