GithubHelp home page GithubHelp logo

blakeembrey / atom-dash Goto Github PK

View Code? Open in Web Editor NEW
394.0 17.0 26.0 60 KB

Dash documentation integration with Atom

License: MIT License

CoffeeScript 100.00%
atom docset dash atom-dash zeal documentation

atom-dash's Introduction

Atom Dash

Build status

Simple Dash documentation integration for Atom.

Please note: This plugin also works with Velocity or Zeal on Windows, and Zeal on Linux.

Installation

apm install dash

Alternatively, open Settings/Preferences -> Install and search for dash.

Usage

Look up the word under your cursor or selected text by pressing ctrl-h. This uses a scoped search and searches based on the current file name and selected syntax. If you want to search all documentation, press ctrl-alt-h.

Hint: To look up a word without bringing Dash to the front, add shift to the command. E.g. ctrl-shift-h. This is useful when Dash is already visible - such as on a dual monitor setup.

Adding Docsets

Open the Atom config file Atom -> Config... and add the docsets under the dash object in the following form:

'dash':
  'grammars':
    'JavaScript': [
      'nodejs'
    ]
  'filenames':
    'gruntfile.js': [
      'grunt'
    ]

Please note: File names must be lower case.

Docsets defined in your local configuration will override the default settings. Take a look at the built-in grammar map and built-in filename map for the default configurations.

License

MIT

atom-dash's People

Contributors

barbeque avatar blakeembrey avatar chronosis avatar fundon avatar greenkeeper[bot] avatar hd-deman avatar kapeli avatar kmiyashiro avatar michaelgmcd avatar parkerd avatar theinterned avatar watsoncj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

atom-dash's Issues

< gets included as part of an HTML tag

In a .html file, if cursor is placed between < and the tag name (e.g. span or div), then the following query is passed to Zeal: html,svg,statamic,javascript,jquery,jqueryui,jquerym,react,nodejs,angularjs,backbone,marionette,meteor,moo,prototype,ember,lodash,underscore,sencha,extjs,titanium,knockout,zepto,cordova,phonegap,yui,unity3d,css,bootstrap,foundation,awesome,cordova,phonegap:<span. <span leads to no results. Moving cursor right fixes the problem.

Reduce amount stored in config.cson?

This is by far the largest item in config.cson and I don't think I configured anything for it. Is there any way to have all of that be the default and only store what the user configures?

Uncaught TypeError: Cannot read property 'getSelection' of undefined

[Enter steps to reproduce below:]

  1. ...CMD + Shift + p
  2. ... Dash: shortcut

Atom Version: 0.184.0
System: Mac OS X 10.10.2
Thrown From: dash package, v1.0.2

Stack Trace

Uncaught TypeError: Cannot read property 'getSelection' of undefined

At /Users/raygerrard/.atom/packages/dash/lib/dash.coffee:16

TypeError: Cannot read property 'getSelection' of undefined
  at atom-workspace.module.exports.shortcut (/Users/raygerrard/.atom/packages/dash/lib/dash.coffee:16:23)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at CommandPaletteView.module.exports.CommandPaletteView.confirmed (/Applications/Atom.app/Contents/Resources/app/node_modules/command-palette/lib/command-palette-view.js:120:32)
  at CommandPaletteView.module.exports.SelectListView.confirmSelection (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-space-pen-views/lib/select-list-view.js:338:21)
  at space-pen-div.atom.commands.add.core:confirm (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-space-pen-views/lib/select-list-view.js:109:19)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:243:29)
  at /Applications/Atom.app/Contents/Resources/app/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:558:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:396:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:182:20)

Commands

     -0:35.6 fuzzy-finder:toggle-file-finder (ul.list-inline.tab-bar.inset-panel)
  4x -0:32.8 core:backspace (atom-text-editor.editor.mini)
     -0:31.9 editor:consolidate-selections (atom-text-editor.editor.mini)
     -0:31.9 core:cancel (atom-text-editor.editor.mini)
     -0:06.0 command-palette:toggle (ul.list-inline.tab-bar.inset-panel)
     -0:00.6 core:confirm (atom-text-editor.editor.mini)
     -0:00.6 dash:shortcut (ul.list-inline.tab-bar.inset-panel)

Config

{
  "core": {
    "themes": [
      "atom-dark-ui",
      "atom-dark-syntax"
    ]
  }
}

Installed Packages

# User
dash, v1.0.2

# Dev
No dev packages

Zeal on linux is ignoring the first parameter (the query)

it seems on linux the following will omit the first parameter when passed to zeal

xdg-open "dash-plugin:query=shared_ptr&keys=cpp,net,boost,qt,cvcpp,cocos2dx,c,manpages"

while the following works just fine

xdg-open "dash-plugin://query=shared_ptr&keys=cpp,net,boost,qt,cvcpp,cocos2dx,c,manpages"

According to https://kapeli.com/dash_plugins the dash-plugin format is dash-plugin://keys={keywords}&query={query} which matches my expectation for uri.

It seems in 137f5b3 you explicitly avoided this, but I'm not sure what the rational behind this was. Rolling back this change seems to fix the issue for me.

Zeal version 0.3.1
atom-dash 1.7.1

Issues with hyphenated css

Amazing add-on. It's already saved me tons of time.

In css if my cursor is on background-image and I look it up in Dash, it looks up "background" if it's under -image it looks up "image". Instead of "background-image".

Zeal ist started twice

When executing dash:shortcut Zeal is started twice, but only once when it is already open. For some reason the shortcut function is called twice. But I'm too unfamiliar with Atom to understand the reason for that.

Is there a mechanism that retries to start Dash/Zeal again, if the first call failed?

Using Atom 1.7.0 and atom-dash 1.6.0 on Debian 8 Linux.

Uncaught TypeError: Cannot read property 'start' of undefined

[Enter steps to reproduce below:]

  1. Press Ctrl-H when cursor is under a word.

Atom Version: 0.209.0
System: Mac OS X 10.10.3
Thrown From: dash package, v1.2.0

Stack Trace

Uncaught TypeError: Cannot read property 'start' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/range.js:35

TypeError: Cannot read property 'start' of undefined
  at Function.module.exports.Range.fromObject (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/range.js:35:31)
  at TextBuffer.module.exports.TextBuffer.getTextInRange (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/text-buffer/lib/text-buffer.js:373:36)
  at TextEditor.module.exports.TextEditor.getTextInBufferRange (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:619:26)
  at atom-text-editor.module.exports.shortcut (/Users/roustem/.atom/packages/dash/lib/dash.coffee:41:21)
  at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:238:29)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/command-registry.js:3:61
  at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:520:16)
  at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app.asar/node_modules/atom-keymap/lib/keymap-manager.js:355:22)
  at HTMLDocument.module.exports.WindowEventHandler.onKeydown (/Applications/Atom.app/Contents/Resources/app.asar/src/window-event-handler.js:177:20)

Commands

     -0:49.6.0 editor:newline (atom-text-editor.editor.is-focused)
  2x -0:49.2.0 core:save (atom-text-editor.editor.is-focused)
  2x -0:21.3.0 core:select-up (atom-text-editor.editor.is-focused)
     -0:20.8.0 editor:toggle-line-comments (atom-text-editor.editor.is-focused)
     -0:20.5.0 core:save (atom-text-editor.editor.is-focused)
     -0:10.4.0 dash:shortcut (atom-text-editor.editor.is-focused)
     -0:06.8.0 core:move-left (atom-text-editor.editor.is-focused)
     -0:06.4.0 editor:move-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -0:05.4.0 editor:delete-to-beginning-of-word (atom-text-editor.editor.is-focused)
     -0:04.7.0 core:undo (atom-text-editor.editor.is-focused)
     -0:03.4.0 dash:shortcut (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:02.5.0 autocomplete-plus:cancel (atom-text-editor.editor.is-focused.autocomplete-active)
     -0:02.1.0 editor:consolidate-selections (atom-text-editor.editor.is-focused)
     -0:02.1.0 core:cancel (atom-text-editor.editor.is-focused)
     -0:01.3.0 core:move-right (atom-text-editor.editor.is-focused)
     -0:00.6.0 dash:shortcut (atom-text-editor.editor.is-focused)

Config

{
  "core": {
    "projectHome": "/Users/roustem/Projects",
    "themes": [
      "one-light-ui",
      "one-light-syntax"
    ]
  }
}

Installed Packages

# User
.bin, vundefined
atom-typescript, v4.5.13
dash, v1.2.0
go-plus, v3.3.11
linter, v0.12.7

# Dev
No dev packages

Gruntfile.js

Is it currently possible to add a config setting in Atom so that when I have a Gruntfile.js open the Dash opens the Grunt documentation instead of the JavaScript one?

(Of course this could be applied to gulp.js as well for example)

Word selection around cursor seems broken

For regexp.MustCompile(), with the cursor in the middle of MustCompile, pressing ctrl-h opens dash and searches for ustCompile(. If I select MustCompile entirely, then ctrl-h, it works as expected.

Zeal Support

Zeal now supports dash-plugin:// scheme, and registers itself as a protocol handler on Windows and Linux. The old --query argument has been deprecated, and will be removed in 0.3.0 release.

I'll add support for &prevent_activation=true as well. I had no idea about this parameter. Zeal simply ignores unknown parameters, so starting to pass &prevent_activation=true immediately would not cause a problem.

I have just updated Zeal's website with a link to this nice plugin.

Cannot call out it in atom.

I installed it and updated config.cson file.

however i can't call out it when pressing ctrl-h, ctrl-alt-h or ctrl+shift+h. It wasn't even bind to the key mappings.

my OS is macos, Did I miss something or does it work in macos? :)

Ctrl-h does not do scoped search/pass in a string to Zeal

On Windows 7, Ctrl-h does not return from a scoped search of a custom docset. Instead, it simply opens the Zeal Browser. This does not happen in Linux. I doubt this is an issue in the code base, instead, I am probably doing something wrong. Has anyone else had this problem? Thanks!

Dash-plugin not working on Windows 10

On Windows 10 the plugin for Atom doesn't seem work. If you CTRL + h anything in a file you get an MS pop-up that says "You'll need a new app to open this dash-plugin." Then you are taken to the MS app store, which of course finds nothing.

Feature request: Read filetype, only search in relevant docs

First of all: thanks for making and sharing this! Love it :)

When I ctrl + h on the text 'export' while in a .js file, the Ruby docs for the 'export' class open in dash. Is there a way to read the current filetype and tell dash that it should ignore results from irrelevant docs?

Atom-Dash not available in Atom's Package Search

Hi.
Just as the title says, Atom does not return Atom-Dash when using the package search. I tried to use the terms dash and atom-dash.

Are you aware of this? I tried a few weeks ago as well with the same results.

Thanks,
Eric

Question: Return focus

This isn't a huge deal. But I was just curious if there was a way to return focus after ctrl+h is pressed, to the atom window. When I use the HUD and alt+d to open dash and escape out it returns focus to atom, but with ctrl+h it doesn't. Not a big issue. Great Package!

Issues with Ruby inheritance

Say I have a rails model

class User < ActiveRecord::Base
end

And I want to look up the dash doc for the rails base model. The atom ruby scoping rules that are being used to look up the search term say that the string in the current scope is " < ActiveRecord::Base" which is fine for syntax highlighting but fails when used to lookup in Dash which means a lot of meaningful Rails documentation is harder to get to.

I'm curious, why was syntax lookup chosen? Does this provide anything extra? Shouldn't the word under the cursor be enough? I saw that issue #2 was the impetus behind this change but this issue could have been solved by simply removing the dash - character from the nonWordCharacters setting of the language-css package. (the same is true for ?, ! and : with ruby but that's a separate issue)

I'm genuinely curious what syntax lookups afford, if anything, beyond a route around the uninformed default non-word character sets for atom's various language packages.

Changing the grammar in language-ruby could fix this (and change highlighting and possibly other things as a side effect), but there could be other scopes that we haven't stumbled on yet that don't match up well with good dash search terms either. I think it makes more sense to go back to word lookups and make sure the nonWordCharacters sets are accurate for the language you're working in.

apm troubles

Looks like this package is currently trying to resolve to an internal 192.x.x.x IP?

โžœ /scripts apm install dash Installing dash to /Users/bmo/.atom/packages Unable to download https://www.atom.io/api/packages/dash/versions/1.7.0/tarball: connect ETIMEDOUT 192.30.253.120:443

Thanks in advance of your help.

Change of conflicting keybindings

This package is very useful because OS X Services don't work in Atom and because of its syntax sensitive search. But this package's default keybindings conflict with the Atom's core keybindings below.
Is it possible to change atom-dash keybindings?

'atom-text-editor':
  'ctrl-alt-h': 'editor:delete-to-beginning-of-subword'
'body .native-key-bindings':
  'ctrl-h': 'native!'
'body':
  'ctrl-h': 'core:backspace'

Thanks.

Call Dash without activating it

atom-dash calls Dash by opening a dash-plugin:// URL. The problem is that the system forces Dash to become active when this URL is opened.

Currently, this is not an issue. However, a future update of Dash will add support for iOS remotes. While an iOS remote is connected, extensions are redirected to it directly and Dash on OS X is not shown at all. Unfortunately there's no way for me to prevent the system from activating Dash when you open the dash-plugin:// URL.

You currently open Dash by running:

shell.openExternal(@createLink(string, language)) 

I have no idea what this does behind the scenes, but it should be the equivalent of this Terminal command:

open dash-plugin://query

Instead of that, you should perform the equivalent of this Terminal command:

open -g dash-plugin://query

The -g causes Dash to not get activated if it does not want to and the user experience is a lot better as the active app (Atom) does not lose focus anymore. When you make the change, please make sure to test whether or not you need to escape special symbols (e.g. $).

It is safe to make this change as soon as possible (no need to wait for a Dash update), as the current version of Dash already knows to activate itself if it needs to.

Can't find `cmd.exe` on Windows 10

atom-dash used to work; Since I had to re-image my laptop, it's throwing an error trying to spawn cmd.exe. It knows about Zeal, no prob. Maybe Zeal recently added support for dash://...? ::shrug::

Sorry I don't have time for a real patch right now, but

join_path = require('path').join
 # snip
      return join_path(process.env.SystemRoot, 'System32', 'cmd.exe') + ' /c start "" "' + uri + '"'

gets it working again.

Weirdly, path = require 'path' and then path.join(etc. does not work, but then again, I'm no JS genius.

Will not open Zeal

I am using Manjaro Linux (Arch), have Zeal installed, and not matter what I do, it will not open Zeal. I get errors that look like:


Malformed URL
Invalid hostname (character '%' not permitted); source was "query=const Router %3D Ember.Router.extend(%7B%0A    location%3A config.locationType%0A%7D)%3B"; scheme = "dash-plugin", host = ""

Atom.Object.defineProperty.get is deprecated.

atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace),
which returns an HTMLElement.

Atom.Object.defineProperty.get (/Applications/Atom.app/Contents/Resources/app/src/atom.js:55:11)
Object.activate (/Users/lmauldin/.atom/packages/dash/lib/dash.coffee:8:9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.