

GitHub - dash-docs-el/dash-docs: A elisp library that exposes functionality to w...
source link: https://github.com/dash-docs-el/dash-docs
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Dash Docs
What's it
This package provides an elisp interface to query and show documenation using Dash docsets.
It doesn't require Dash app.
Requirements
- sqlite3
Installation
It's available on MELPA.
Now, it's possible to choose between install the stable or development version of dash-docs. Here there is an explanation about stable packages and MELPA and here a list of our tags.
m-x package-install dash-docs RET
Installing docsets
Dash-docs uses the same docsets as Dash.
You can install them with m-x dash-docs-install-docset
for the
official docsets or m-x dash-docs-install-user-docset
for user
contributed docsets (experimental).
To install a docset from a file in your drive you can use m-x dash-docs-install-docset-from-file'. That function takes as input a
tgzfile that you obtained, starting from a folder named
.docset`, with the command:
tar --exclude='.DS_Store' -cvzf <docset name>.tgz <docset name>.docset
as explained here.
Usage
Search all currently enabled docsets (docsets in dash-docs-docsets
or
dash-docs-common-docsets
):
(dash-docs-search "<pattern>")
Search a specific docset:
(dash-docs-search-docset "<docset>" "<pattern>")
The command dash-docs-reset-connections
will clear the connections
to all sqlite db's. Use it in case of errors when adding new docsets.
The next call to a search function will recreate them.
Variables to customize
dash-docs-docsets-path
is the prefix for your docsets. Defaults to ~/.docsets
dash-docs-min-length
tells dash-docs from which length to start
searching. Defaults to 3.
dash-docs-browser-func
is a function to encapsulate the way to browse
Dash' docsets. Defaults to browse-url. For example, if you want to use eww to
browse your docsets, you can do: (setq dash-docs-browser-func 'eww)
.
When dash-docs-enable-debugging
is non-nil stderr from sqlite queries is
captured and displayed in a buffer. The default value is t
. Setting this
to nil
may speed up queries on some machines (capturing stderr requires
the creation and deletion of a temporary file for each query).
Sets of Docsets
Common docsets
`dash-docs-common-docsets' is a list that should contain the docsets to be active always. In all buffers.
Buffer local docsets
Different subsets of docsets can be activated depending on the buffer. For the moment (it may change in the future) we decided it's a plain local variable you should setup for every different filetype. This way you can also do fancier things like project-wise docsets sets.
(defun go-doc () (interactive) (setq-local dash-docs-docsets '("Go"))) (add-hook 'go-mode-hook 'go-doc)
Only one docset
To narrow the search to just one docset, type its name in the beginning of the search followed by a space. If the docset contains spaces, no problemo, we handle it :D.
- Does it work in osX?
sqlite queries. Provisionally, we're executing shell-commands directly. Our idea is come back to use esqlite when some issues will be fixed.
dash-docs has been tested only in linux. We've been notified that it doesn't work in Mac, so we ask for elisp hackers who own something that runs Mac OSX if they could take a look at it.
Hints: It looks like something with 'end of line' differences. The suspicious are esqlite (which dash-docs requires) or pcsv (which esqlite requires)
- I'm using mac osx and pages open but not in the correct anchor
bug on mac osx's browse-url which can't open urls with #. If you find this issue, and want to debug, great, otherwise, you can use eww or w3 or w3m which will work just fine
- I get nil for every search I do
make sure you don't have sqlite3 .mode column but .mode list (the default). check your .sqliterc
- When selecting an item in dash-docs, no browser lookup occurs with firefox >= 38.0.and emacs >= 24.4
(setq browse-url-browser-function 'browse-url-generic
browse-url-generic-program "/path/to/firefox")
(setq dash-docs-browser-func 'browse-url-generic)
Contribution
We feedback, issues or pull requests. Feel free to contribute in dash-docs.
We're trying to add tests to the project, if you send a PR please consider add new or update the existing ones.
Install Cask if you haven't already, then:
$ cd /path/to/dash-docs
$ cask
Run all tests with:
$ make
Authors
Recommend
-
148
package-lint This library provides a linter for the metadata in Emacs Lisp files which are intended to be packages. You can integrate it into your build process. package-lint detects various issues that may make your p...
-
90
GENERATORS NOW IN CORE This package has been superseded by Emacs core support for generators in 25.1. elisp-generators This repository contains an implementation of Python-style generators for Emacs Lisp. It requires Emac...
-
32
README.md ConsentKit Note: This library only helps you collect consents for the services in your app that needs it, actually disabling those services is developer's job.
-
25
Kotlin-JDBC Version 0.5.0 API Breaking Release ℹ️ This branch is a rework with breaking changes to refactor models and related classes to eliminate having to specify identifier quoting in the model by...
-
11
Read Me This library was created to fascilitate quickly building web pages, though it also includes tools for working with parsed xml Code Generation with esxml.el This library provides to formats for xml code generat...
-
8
counsel-dash Browse Dash docsets using Ivy. Installation MELPA M-x package-install RET counsel-dash RET
-
24
Termux API This is an app exposing Android API to command line usage and scripts or programs. When developing or packaging, note that this app needs to be signed with the same key as the main Termux app for permissions to work...
-
10
Parsebib (c) 2014-2021 Joost Kremers Parsebib is an Elisp library for reading bibliographic database files. It supports both BibTeX / biblatex (.bib) files and CSL-JSON (.json
-
8
The Compat Elisp Library: A Package Maintainer's Best Friend Mar 16, 2023 |
-
6
OpenAI.el Elisp library for the OpenAI API The OpenAI Elisp library provides convenient access to the OpenAI API from applications written in the Elips language. P.S. This package is expected t...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK