windows/Linux下的程序员文档浏览工具

Dash + Alfred

https://www.jianshu.com/p/77d2bf8df81f

对于程序员来说,查看api文档是非常频繁,经常窗口之间切换非常麻烦,mac下就有一个查文档的神器:Dash。

详细使用可以参考如上连接的说明。

本文重点整理下windows和linux下使用类似的功能如何操作。

IntelliJ插件

https://github.com/gdelmas/IntelliJDashPlugin/releases

ShortcutYou can change the shortcut at Preferences -> Keymap -> Plug-ins -> Dash.Toolbar IconYou can add a button to the toolbar. Right-click the menubar -> Customize […]. You will find the button under "Plug-ins -> Dash".

zeal

dash只有mac版本,没有windows版,以zeal为例说明

zeal官网:https://zealdocs.org/

文档地址:

https://kapeli.com/cheatsheets

https://github.com/Kapeli/feeds

https://github.com/zealdocs/zeal

  • windows下的安装和使用很简单:只要下载安装包,解压安装即可

  • linux下需要安装依赖包和自己代码编译

由于api的内容需要连接国外的站点下载,速度特别慢,建议采用如下的docsets节的内容手动下载和加压即可

docsets

https://kapeli.com/docsets 这里有docsets的一些相关资料

可以下载的内容有:https://github.com/Kapeli/feeds 这里有完整列表,选择某个xml文件中,找到下载的地址下载对应的tgz文件,下载完成后解压到zeal对应的目录下,然后重新启动zeal即可

如下是一个参考的下载来源:

  • C++17: csdn

  • https://github.com/Kapeli/feeds/blob/master/Spring_Framework.xml

http://tokyo.kapeli.com/feeds/jQuery.tgz

http://tokyo.kapeli.com/feeds/Bash.tgz

http://tokyo.kapeli.com/feeds/C++.tgz

http://tokyo.kapeli.com/feeds/Boost.tgzhttp://tokyo.kapeli.com/feeds/Vagrant.tgzhttp://tokyo.kapeli.com/feeds/Gradle_DSL.tgzhttp://tokyo.kapeli.com/feeds/AWS_JavaScript.tgzhttp://tokyo.kapeli.com/feeds/Go.tgzhttp://tokyo.kapeli.com/feeds/Font_Awesome.tgzhttp://tokyo.kapeli.com/feeds/SQLAlchemy.tgzhttp://tokyo.kapeli.com/feeds/jQuery_UI.tgzhttp://tokyo.kapeli.com/feeds/JavaScript.tgzhttp://tokyo.kapeli.com/feeds/Spring_Framework.tgzhttp://tokyo.kapeli.com/feeds/RequireJS.tgzhttp://tokyo.kapeli.com/feeds/Docker.tgzhttp://tokyo.kapeli.com/feeds/Python_3.tgzhttp://tokyo.kapeli.com/feeds/Vim.tgzhttp://tokyo.kapeli.com/feeds/C.tgzhttp://tokyo.kapeli.com/feeds/Grails.tgzhttp://tokyo.kapeli.com/feeds/NodeJS.tgzhttp://tokyo.kapeli.com/feeds/CMake.tgzhttp://tokyo.kapeli.com/feeds/Groovy.tgzhttp://tokyo.kapeli.com/feeds/Bootstrap_3.tgzhttp://tokyo.kapeli.com/feeds/Java_SE9.tgzhttp://tokyo.kapeli.com/feeds/ElasticSearch.tgzhttp://singapore.kapeli.com/feeds/TypeScript.tgz

Linux编译zeal

centos 7.1版本上没有zeal的二进制安装包,从源码编译有点麻烦。

由于zeal使用的是qt5版本,默认centos7没有这个内容,需要进行一定的配置

依赖包

第一步,参考README安装基础的依赖包

yum install qt5-qtwebkit-devel.x86_64yum install xcb-util-keysyms-devel.x86_64yum install -y libarchive-devel.x86_64

ECM 【cmake modules】

此时执行cmake编译时提示如下的错误:

CMake Error at assets/CMakeLists.txt:2 (find_package): Could not find a package configuration file provided by "ECM" with any of the following names:

ECMConfig.cmake<br />ecm-config.cmake

Add the installation prefix of "ECM" to CMAKE_PREFIX_PATH or set "ECM_DIR" to a directory containing one of the above files. If "ECM" provides a

这个错误是和cmake有关的,缺少的内容安装

yum install -y extra-cmake-modules.noarch

再次编译,出现如下的问题,安装qt5的包

Qt5 COMPONENTS X11Extras REQUIRED

yum install -y qt5-qtx11extras-devel.x86_64

此时如果编译成功,即可运行,运行时出现如下问题:

libQt5Gui.so undefined reference hb_font_funcs_set_nominal_glyph_func

这个是harfbuzz的版本问题,只要安装新的1.0.3.2版本即可【默认是0.#的版本】

yum install -y harfbuzz-devel.x86_64 [HarfBuzz is an OpenType text shaping engine]

此时即可运行

将编译的包拷贝到其他的机器上运行

由于整个包依赖于qt,为了避免系统没有安装qt的问题,此处把相关的依赖放入独立的目录中,使用独立的环境变量进行设置引导zeal

运行脚本

具体的脚本文件类似如下

#!/bin/bash<br />:<<EOF<br />~/.local/share/Zeal/Zeal/docsets<br />想看哪个解哪个!!!<br />tar -xzvf Java_SE9.tgz -C ~/.local/share/Zeal/Zeal/docsets/.<br />EOF<br /># 自动从FTP下载docsets,然后装入zeal<br />num=`ls ~/.local/share/Zeal/Zeal/docsets | wc -l`<br />if [ "$num" = "0" ]; then<br />    mkdir pkg<br />    ftp -v -n <<END<br />open 172.16.1.201 21<br />user anonymous anonymous<br />binary<br />​<br />lcd pkg<br />cd /常用软件/dash/docsets/<br />prompt<br />​<br />mget *.tgz<br />mget *.zip<br />close<br />bye <br />END<br /><br />    for file in ./pkg/*<br />    do<br />        echo $file<br />        tar xzf $file -C ~/.local/share/Zeal/Zeal/docsets/.<br />    done<br /><br />    rm -rf pkg<br />fi<br />​<br /># 运行zeal的相关设置和准备<br />BASE_DIR=$(cd "$(dirname "$0")"; pwd)<br />cd $BASE_DIR<br />​<br />export LD_LIBRARY_PATH=$BASE_DIR/dash<br />export FONTCONFIG_FILE=/etc/fonts/fonts.conf<br />export FONTCONFIG_PATH=/etc/fonts/<br />export QT_XKB_CONFIG_ROOT=/usr/share/X11/xkb<br />export QT_DEBUG_PLUGINS=1<br />​<br />cd dash<br />​<br />if [ -f /lib64/libharfbuzz.so.0.10302.0 ]; then<br /> echo 'true type font installed'<br />else<br /> rpm -i --force --nodeps *.rpm<br />fi<br />​<br />chmod +x zeal<br />./zeal<br />​<br />cd ..<br />​
依赖的文件列表
<br />dash:<br />harfbuzz-1.3.2-1.el7.x86_64.rpm<br />harfbuzz-devel-1.3.2-1.el7.x86_64.rpm<br />harfbuzz-icu-1.3.2-1.el7.x86_64.rpm<br />libcrypto.so<br />libcrypto.so.10<br />libcrypto.so.1.0.2k<br />libpcre2-16.so.0<br />libpcre2-16.so.0.5.0<br />libQt5Concurrent.prl<br />libQt5Concurrent.so<br />libQt5Concurrent.so.5<br />libQt5Concurrent.so.5.9<br />libQt5Concurrent.so.5.9.2<br />libQt5Core.prl<br />libQt5Core.so<br />libQt5Core.so.5<br />libQt5Core.so.5.9<br />libQt5Core.so.5.9.2<br />libQt5DBus.prl<br />libQt5DBus.so<br />libQt5DBus.so.5<br />libQt5DBus.so.5.9<br />libQt5DBus.so.5.9.2<br />libQt5EglFSDeviceIntegration.prl<br />libQt5EglFSDeviceIntegration.so<br />libQt5EglFSDeviceIntegration.so.5<br />libQt5EglFSDeviceIntegration.so.5.9<br />libQt5EglFSDeviceIntegration.so.5.9.2<br />libQt5EglFsKmsSupport.prl<br />libQt5EglFsKmsSupport.so<br />libQt5EglFsKmsSupport.so.5<br />libQt5EglFsKmsSupport.so.5.9<br />libQt5EglFsKmsSupport.so.5.9.2<br />libQt5Gui.prl<br />libQt5Gui.so<br />libQt5Gui.so.5<br />libQt5Gui.so.5.9<br />libQt5Gui.so.5.9.2<br />libQt5Location.so.5<br />libQt5Location.so.5.9<br />libQt5Location.so.5.9.2<br />libQt5Network.prl<br />libQt5Network.so<br />libQt5Network.so.5<br />libQt5Network.so.5.9<br />libQt5Network.so.5.9.2<br />libQt5OpenGL.prl<br />libQt5OpenGL.so<br />libQt5OpenGL.so.5<br />libQt5OpenGL.so.5.9<br />libQt5OpenGL.so.5.9.2<br />libQt5Positioning.so.5<br />libQt5Positioning.so.5.9<br />libQt5Positioning.so.5.9.2<br />libQt5PrintSupport.prl<br />libQt5PrintSupport.so<br />libQt5PrintSupport.so.5<br />libQt5PrintSupport.so.5.9<br />libQt5PrintSupport.so.5.9.2<br />libQt5Qml.prl<br />libQt5Qml.so<br />libQt5Qml.so.5<br />libQt5Qml.so.5.9<br />libQt5Qml.so.5.9.2<br />libQt5QuickParticles.prl<br />libQt5QuickParticles.so<br />libQt5QuickParticles.so.5<br />libQt5QuickParticles.so.5.9<br />libQt5QuickParticles.so.5.9.2<br />libQt5Quick.prl<br />libQt5Quick.so<br />libQt5Quick.so.5<br />libQt5Quick.so.5.9<br />libQt5Quick.so.5.9.2<br />libQt5QuickTest.prl<br />libQt5QuickTest.so<br />libQt5QuickTest.so.5<br />libQt5QuickTest.so.5.9<br />libQt5QuickTest.so.5.9.2<br />libQt5QuickWidgets.prl<br />libQt5QuickWidgets.so<br />libQt5QuickWidgets.so.5<br />libQt5QuickWidgets.so.5.9<br />libQt5QuickWidgets.so.5.9.2<br />libQt5Sensors.so.5<br />libQt5Sensors.so.5.9<br />libQt5Sensors.so.5.9.2<br />libQt5Sql.prl<br />libQt5Sql.so<br />libQt5Sql.so.5<br />libQt5Sql.so.5.9<br />libQt5Sql.so.5.9.2<br />libQt5Test.prl<br />libQt5Test.so<br />libQt5Test.so.5<br />libQt5Test.so.5.9<br />libQt5Test.so.5.9.2<br />libQt5WebChannel.so.5<br />libQt5WebChannel.so.5.9<br />libQt5WebChannel.so.5.9.2<br />libQt5WebKit.prl<br />libQt5WebKit.so<br />libQt5WebKit.so.5<br />libQt5WebKit.so.5.9<br />libQt5WebKit.so.5.9.1<br />libQt5WebKitWidgets.prl<br />libQt5WebKitWidgets.so<br />libQt5WebKitWidgets.so.5<br />libQt5WebKitWidgets.so.5.9<br />libQt5WebKitWidgets.so.5.9.1<br />libQt5Widgets.prl<br />libQt5Widgets.so<br />libQt5Widgets.so.5<br />libQt5Widgets.so.5.9<br />libQt5Widgets.so.5.9.2<br />libQt5X11Extras.prl<br />libQt5X11Extras.so<br />libQt5X11Extras.so.5<br />libQt5X11Extras.so.5.9<br />libQt5X11Extras.so.5.9.2<br />libQt5XcbQpa.prl<br />libQt5XcbQpa.so<br />libQt5XcbQpa.so.5<br />libQt5XcbQpa.so.5.9<br />libQt5XcbQpa.so.5.9.2<br />libQt5XmlPatterns.so.5<br />libQt5XmlPatterns.so.5.9<br />libQt5XmlPatterns.so.5.9.2<br />libQt5Xml.prl<br />libQt5Xml.so<br />libQt5Xml.so.5<br />libQt5Xml.so.5.9<br />libQt5Xml.so.5.9.2<br />libssl3.so<br />libssl.so<br />libssl.so.10<br />libssl.so.1.0.2k<br />libxcb-composite.so<br />libxcb-composite.so.0<br />libxcb-composite.so.0.0.0<br />libxcb-damage.so<br />libxcb-damage.so.0<br />libxcb-damage.so.0.0.0<br />libxcb-dpms.so<br />libxcb-dpms.so.0<br />libxcb-dpms.so.0.0.0<br />libxcb-dri2.so<br />libxcb-dri2.so.0<br />libxcb-dri2.so.0.0.0<br />libxcb-dri3.so<br />libxcb-dri3.so.0<br />libxcb-dri3.so.0.0.0<br />libxcb-ewmh.so.2<br />libxcb-ewmh.so.2.0.0<br />libxcb-glx.so<br />libxcb-glx.so.0<br />libxcb-glx.so.0.0.0<br />libxcb-icccm.so.4<br />libxcb-icccm.so.4.0.0<br />libxcb-image.so.0<br />libxcb-image.so.0.0.0<br />libxcb-keysyms.so<br />libxcb-keysyms.so.1<br />libxcb-keysyms.so.1.0.0<br />libxcb-present.so<br />libxcb-present.so.0<br />libxcb-present.so.0.0.0<br />libxcb-randr.so<br />libxcb-randr.so.0<br />libxcb-randr.so.0.1.0<br />libxcb-record.so<br />libxcb-record.so.0<br />libxcb-record.so.0.0.0<br />libxcb-render.so<br />libxcb-render.so.0<br />libxcb-render.so.0.0.0<br />libxcb-render-util.so.0<br />libxcb-render-util.so.0.0.0<br />libxcb-res.so<br />libxcb-res.so.0<br />libxcb-res.so.0.0.0<br />libxcb-screensaver.so<br />libxcb-screensaver.so.0<br />libxcb-screensaver.so.0.0.0<br />libxcb-shape.so<br />libxcb-shape.so.0<br />libxcb-shape.so.0.0.0<br />libxcb-shm.so<br />libxcb-shm.so.0<br />libxcb-shm.so.0.0.0<br />libxcb-sync.so<br />libxcb-sync.so.1<br />libxcb-sync.so.1.0.0<br />libxcb-util.so.1<br />libxcb-util.so.1.0.0<br />libxcb-xevie.so<br />libxcb-xevie.so.0<br />libxcb-xevie.so.0.0.0<br />libxcb-xf86dri.so<br />libxcb-xf86dri.so.0<br />libxcb-xf86dri.so.0.0.0<br />libxcb-xfixes.so<br />libxcb-xfixes.so.0<br />libxcb-xfixes.so.0.0.0<br />libxcb-xinerama.so<br />libxcb-xinerama.so.0<br />libxcb-xinerama.so.0.0.0<br />libxcb-xinput.so<br />libxcb-xinput.so.0<br />libxcb-xinput.so.0.1.0<br />libxcb-xkb.so<br />libxcb-xkb.so.1<br />libxcb-xkb.so.1.0.0<br />libxcb-xselinux.so<br />libxcb-xselinux.so.0<br />libxcb-xselinux.so.0.0.0<br />libxcb-xtest.so<br />libxcb-xtest.so.0<br />libxcb-xtest.so.0.0.0<br />libxcb-xvmc.so<br />libxcb-xvmc.so.0<br />libxcb-xvmc.so.0.0.0<br />libxcb-xv.so<br />libxcb-xv.so.0<br />libxcb-xv.so.0.0.0<br />platforms<br />zeal<br />​<br />dash/platforms:<br />libqeglfs.so<br />libqlinuxfb.so<br />libqminimalegl.so<br />libqminimal.so<br />libqoffscreen.so<br />libqvnc.so<br />libqxcb.so<br />​

相关推荐