【转载】devhelp的使用小结 --zealoussnow
来源:互联网 发布:注册了com的域名能卖吗 编辑:程序博客网 时间:2024/05/22 16:41
这篇文章转载于 http://blog.chinaunix.net/uid-28422527-id-4309534.html
作者 zealoussnow zealoussnow的ChinaUnix博客
网上比较少中文的devhelp的信息,所以想转过来。
devhelp是一个很方便的图形化文档查看器,自从发现了devhelp,感觉查阅帮助文档舒服多了。在linux写程序让我颇感遗憾的是manpage没有c++的,但在devhelp中也没有好一点的c++文档,所以就萌生了将cppreference上的离线文档放到devhelp中的做法。说干就干,尝试以下呗!
查阅了下devhelp的readme,发现devhelp搜寻文档的目录有:(1). $XDG_DATA_HOME/devhelp/books
(2). $XDG_DATA_HOME/gtk-doc/html
(3). $XDG_DATA_DIRS/devhelp/books
(4). $XDG_DATA_DIRS/gtk-doc/html
我就直接自己的家目录作为devhelp的文档搜索路径。export XDG_DATA_HOME=$HOME/.local/share,然后新建目录devhelp/books,在books下面就是文档的位置。由于我经常查阅的是c++和c的一些文档,这里我举的例子是cppreference的一个离线文档。
将下载的离线文档解压到$XDG_DATA_HOME/devhelp/books下面,目录名改为cpp-reference。
首先呢,我们需要一个以.devhelp结尾的文件,这个实际上就是一个xml文件,用于展示文档结构。我呢也不自己写了,以前devhelp里面我个libxml2的文档,就用它啦。在cpp-reference目录下新建一个cpp-reference.devhelp, 观察下cppreference的结构,c部分和c++部分在en目录下面。所以呢,这个devhelp文件可以这么写,我直接就展示修改后的文件了,很容易看懂的。
- <?xml version="1.0" encoding="UTF-8"?>
- <book xmlns="http://www.devhelp.net/book" title="C++ Reference Manual" link="en/index.html" author="zealoussnow" name="cppreference">
- <chapters>
- <sub name="C" link="en/c.html">
- <sub name="algorithm" link="en/c/algorithm.html"/>
- <sub name="atomic" link="en/c/atomic.html"/>
- <sub name="chrono" link="en/c/chrono.html"/>
- <sub name="error" link="en/c/error.html"/>
- <sub name="header" link="en/c/header.html"/>
- <sub name="keyword" link="en/c/keyword.html"/>
- <sub name="language" link="en/c/language.html"/>
- <sub name="links" link="en/c/links.html"/>
- <sub name="locale" link="en/c/locale.html"/>
- <sub name="memory" link="en/c/memory.html"/>
- <sub name="preprocessor" link="en/c/preprocessor.html"/>
- <sub name="program" link="en/c/program.html"/>
- <sub name="string" link="en/c/string.html"/>
- <sub name="thread" link="en/c/thread.html"/>
- <sub name="types" link="en/c/types.html"/>
- </sub>
- <sub name="C++" link="en/cpp.html">
- <sub name="algorithm" link="en/cpp/algorithm.html"/>
- <sub name="chrono" link="en/cpp/chrono.html"/>
- <sub name="comment" link="en/cpp/comment.html"/>
- <sub name="concept" link="en/cpp/concept.html"/>
- <sub name="containter" link="en/cpp/container.html"/>
- <sub name="error" link="en/cpp/error.html"/>
- <sub name="header" link="en/cpp/header.html"/>
- <sub name="io" link="en/cpp/io.html"/>
- <sub name="iterator" link="en/cpp/iterator.html"/>
- <sub name="keyword" link="en/cpp/keyword.html"/>
- <sub name="language" link="en/cpp/language.html"/>
- <sub name="links" link="en/cpp/links.html"/>
- <sub name="locale" link="en/cpp/locale.html"/>
- <sub name="memory" link="en/cpp/memory.html"/>
- <sub name="numberic" link="en/cpp/numberic.html"/>
- <sub name="preprocessor" link="en/cpp/preprocessor.html"/>
- <sub name="regex" link="en/cpp/regex.html"/>
- <sub name="string" link="en/cpp/string.html"/>
- <sub name="thread" link="en/cpp/thread.html"/>
- <sub name="types" link="en/cpp/types.html"/>
- <sub name="utility" link="en/cpp/utility.html"/>
- </sub>
- </chapters>
- <functions>
- <function name="swap()" link="en/cpp/io/basic_filebuf/swap.html"/>
- </functions>
- </book>
写完之后再次打开devhelp,新增的文档就出现了,查询起来十分方便,是不是很amazing啊。
阅读全文
0 0
- 【转载】devhelp的使用小结 --zealoussnow
- 用Devhelp看自己的文档
- 转载Java内部类的使用小结
- 【转载】Java内部类的使用小结
- [转载] CreateThread()使用小结
- 用devhelp查看linux下的开发文档
- [转载]GNU binutils使用小结
- Android Camera 使用小结--转载
- (转载)Android Camera 使用小结
- DEV GridControl小结。。转载的
- 【转载】【Android】Android Camera 使用小结
- 【转载】tomcat结合nginx使用小结
- tomcat结合nginx使用小结 《转载》
- JBPM使用小结:(1)安装JBPM的流程如下(转载)
- treeview的使用小结
- treeview的使用小结
- LinkButton的使用小结
- CListCtrl 使用的小结
- mapreduce入门
- 大数相加
- 高斯投影转换(3度带)
- 16. 3Sum Closest
- Hi3519V101色彩空间转换总结(一)
- 【转载】devhelp的使用小结 --zealoussnow
- JVM在嵌入式linux下的移植
- 函数
- 快速排序&sort()用法
- 以最简单方式学习Linux
- 复杂数据结构——哈希表与映射、图
- Palindrome Number
- 获取某一路径下的所有文件
- angulary 学习笔记1