Gnome Developers Help Program
devhelp 是一套 API 參考手冊系統,它可以用來閱讀或是查詢索引函式。新版是基於 Gnome2/GTK2 所開發。
事實上,The GTK+ Reference Documentation Project有個稱為 gtk-doc 的工具,它可以將程式碼中內嵌的文件擷取出來,轉成 DocBook 格式。gtk-doc 包含了一個 devhelp.xsl 的 XSL 檔案。所以你可以輕易把程式碼轉成 DocBook,然後使用這個 XSL 將文件整理出章節與索引,以及產生出 HTML 檔案。文件本身是以 HTML 格式存在,而 devhelp 設定檔包含章節與索引資料,是 XML 格式。

雖然它標明給 Gnome developers 使用,但是其中並不只有 Gnome/GTK+ 的文件而已,在寫其他種類的程式時,許多的 API 資訊也相當有用。我在開發 GTK2/Gnome 或是其他需要用到 autotools/binutils/make 時,還是會拿出來翻一翻。而且也把一些自己所開發的工具或是其他人所寫的文件,建立相關的檔案匯入到系統中。如此一來,我便有統一的介面可以查詢這些 API 細節。

在 Debian 系統上,請用
便可以安裝相關的文件。
除此之外,如果你同我一樣也愛用 vim,請在你的 .vimrc 中加上
” Idea copied from the same “emacs intergration” script by ≤author/>
” Gert
function! DevHelpCurrentWord()
let word = expand( “
exe “!devhelp -s ” . word
endfunction
” Example: bind
” cursor
nmap
當你在編輯程式需要快速查詢文件時,請在需要查詢的字眼上鍵入 Esc + H,vim 便會呼叫 devhelp 自動查詢該函式。是否方便許多? ![]()
在 Debian 系統上,你可以安裝以下套件來取得相關的程式與電子書。
devhelp-books - Books for the DevHelp system
devhelp-book-autotools - Autotools book for the DevHelp system
devhelp-book-binutils - Binutils book for the DevHelp system
devhelp-book-cvs - Cvs book for the DevHelp system
devhelp-book-emacs - Emacs book for the DevHelp system
devhelp-book-gdb - GNU Debugger (gdb) book for the DevHelp system
devhelp-book-ggad - ”GGAD” book for the DevHelp system
devhelp-book-glibc - GNU C Library (glibc) book for the DevHelp system
devhelp-book-gnome - Gnome books for the DevHelp system
devhelp-book-gtk2 - Gtk+ 2 books for the DevHelp system
devhelp-book-gtk - Gtk+ books for the DevHelp system
devhelp-book-make - A ‘make’ book for the DevHelp system
devhelp-book-sdl - Simple DirectMedia Layer book for the DevHelp system
libdevhelp0 - Shared library for devhelp
libdevhelp-dev - Library for devhelp (development files)
gstreamer-doc - GStreamer documentation
你隨時可以自建書籍,只需要在把那些文件轉成 HTML 檔案,並整理出 .devhelp 檔案。當然,你大可以直接用 DocBook 來寫文件,然後透過 XSL 直接轉出設定檔。 (我好像一直說要寫篇告訴大家如何使用 DocBook/XSL 生成文件的方法,有點懶惰
)
倘若你懶得裝 devhelp ,也可使用 Linux Developer Network,他的網頁有點像是 MSDN,同樣方便查詢 API ,LIDN 網站也有許多 devhelp 格式書籍可下載使用。
延伸閱讀:
計畫網頁
訂閱郵遞論壇
mailing list archives
happy hacking !