Giter Site home page Giter Site logo

dashdoc's Introduction

DashDoc provides integration of Dash (on OS X), Zeal (on Linux) and Zeal or Velocity (on Windows) into Sublime Text.

If the package is not available in the install list

You need to be on OS X, Windows or Linux to use DashDoc. You might have installed it already. If nothing helps, please check package control troubleshooting page or fill a bug against package control.

Usage

You can look up the word under the cursor or selected text in Dash using ctrl+h.

Installation

  1. Install the Sublime Package Control package.
  2. Use Package Control to install this package (DashDoc)

Hotkey configuration

DashDoc no longer comes with a default hotkey.

To set up the hotkey for dash open the Preferences > Key Bindings from the menu and add a new entry that looks like this:

[{ "keys": ["YOUR HOTKEY"], "command": "dash_doc"}]

for the default mode

[{ "keys": ["YOUR HOTKEY"], "command": "dash_doc",
                           "args": { "flip_syntax_sensitive": true } }]

for the flipped case sensitive mode.

Dependencies

xdg-utils on Linux.

Options

As usual, you will find the associated settings under the Preferences / Package Settings / DashDoc menu. Personal settings should be made in Settings - User.

Search any topic

DashDoc also includes a command to search any topic right from Sublime's command palette.

Syntax sensitivity

By default, DashDoc is sensitive to the syntax used in the current view. Dash will then consult the docset that matches the current syntax. Example: a lookup for map in a Haskell buffer will instruct Dash to search in its haskell docset, a search for the same word in a Python buffer will consult the python docset instead.

Syntax-insensitive search may be invoked using the ctrl+alt+h hotkey. You have an option to switch the default method of searching with config option syntax_sensitive_as_default, which defaults to true. If you set it to false, then ctrl+h becomes syntax-insensitive, and ctrl+alt+h becomes the sensitive option.

Choosing a Dash docset for a given syntax

For any Sublime Text syntax, DashDoc can search a number of docsets of your choosing. Use map entries of the form { <syntax> : [ <docset>, <docset>, ... ] }. For <docset>, use the lowercase docset prefixes that Dash indicates in its Preferences / Docsets pane. Dash searches the list of docsets in the given order.

For particular projects, you can override individual syntax-to-docsets mappings in the settings of the project's .sublime-project file, for example:

"settings": {
  "syntax_docset_map": {
    "Objective-C": ["iphoneos", "cocos2d"]
  }
}

Mappings that are not overridden this way default to what is found in the DashDoc.sublime-settings file. The default mapping, derived from Dash's suggestion, is:

"syntax_docset_map":
{
  "ActionScript"          : ["actionscript"],
  "Boo"                   : ["unity3d"],
  "C"                     : ["c", "glib", "gl2", "gl3", "gl4", "manpages"],
  "C99"                   : ["c", "glib", "gl2", "gl3", "gl4", "manpages"],
  "C++"                   : ["cpp", "net", "boost", "qt", "cvcpp", "cocos2dx", "c", "manpages"],
  "C++11"                 : ["cpp", "net", "boost", "qt", "cvcpp", "cocos2dx", "c", "manpages"],
  "Clojure"               : ["clojure"],
  "CoffeeScript"          : ["coffee"],
  "ColdFusion"            : ["cf"],
  "CSS"                   : ["css", "bootstrap", "foundation", "less", "awesome", "cordova", "phonegap"],
  "Dart"                  : ["dartlang", "polymerdart", "angulardart"],
  "Elixir"                : ["elixir"],
  "Erlang"                : ["erlang"],
  "Go"                    : ["go", "godoc"],
  "GoSublime"             : ["go", "godoc"],
  "GoSublime-Go"          : ["go", "godoc"],
  "Groovy"                : ["groovy"],
  "Haskell"               : ["haskell"],
  "Haskell-SublimeHaskell": ["haskell"],
  "Literate Haskell"      : ["haskell"],
  "HTML"                  : ["html", "svg", "css", "bootstrap", "foundation", "awesome", "statamic", "javascript", "jquery", "jqueryui", "jquerym", "angularjs", "backbone", "marionette", "meteor", "moo", "prototype", "ember", "lodash", "underscore", "sencha", "extjs", "knockout", "zepto", "cordova", "phonegap", "yui"],
  "Jade"                  : ["jade"],
  "Java"                  : ["java", "javafx", "grails", "groovy", "playjava", "spring", "cvj", "processing", "javadoc"],
  "JavaScript"            : ["javascript", "jquery", "jqueryui", "jquerym", "angularjs", "backbone", "marionette", "meteor", "sproutcore", "moo", "prototype", "bootstrap", "foundation", "lodash", "underscore", "ember", "sencha", "extjs", "knockout", "zepto", "yui", "d3", "svg", "dojo", "coffee", "nodejs", "express", "mongoose", "moment", "require", "awsjs", "jasmine", "sinon", "grunt", "chai", "html", "css", "cordova", "phonegap", "unity3d", "titanium"],
  "Kotlin"                : ["kotlin"],
  "Less"                  : ["less"],
  "Lisp"                  : ["lisp"],
  "Lua"                   : ["lua", "corona"],
  "Markdown"              : ["markdown"],
  "MultiMarkdown"         : ["markdown"],
  "Objective-C"           : ["iphoneos", "macosx", "appledoc", "cocos2d", "cocos3d", "kobold2d", "sparrow", "cocoapods", "c", "manpages"],
  "Objective-C++"         : ["cpp", "iphoneos", "macosx", "appledoc", "cocos2d", "cocos2dx", "cocos3d", "kobold2d", "sparrow", "cocoapods", "c", "manpages"],
  "Objective-J"           : ["cappucino"],
  "OCaml"                 : ["ocaml"],
  "Perl"                  : ["perl", "manpages"],
  "PHP"                   : ["php", "wordpress", "drupal", "zend", "laravel", "yii", "joomla", "ee", "codeigniter", "cakephp", "phpunit", "symfony", "typo3", "twig", "smarty", "phpp", "html", "statamic", "mysql", "sqlite", "mongodb", "psql", "redis"],
  "Processing"            : ["processing"],
  "Puppet"                : ["puppet"],
  "Python"                : ["python", "django", "twisted", "sphinx", "flask", "tornado", "sqlalchemy", "numpy", "scipy", "salt", "cvp"],
  "R"                     : ["r"],
  "Ruby"                  : ["ruby", "rubygems", "rails"],
  "Ruby on Rails"         : ["ruby", "rubygems", "rails"],
  "(HTML) Rails"          : ["ruby", "rubygems", "rails", "html", "svg", "css", "bootstrap", "foundation", "awesome", "statamic", "javascript", "jquery", "jqueryui", "jquerym", "angularjs", "backbone", "marionette", "meteor", "moo", "prototype", "ember", "lodash", "underscore", "sencha", "extjs", "knockout", "zepto", "cordova", "phonegap", "yui"],
  "(JavaScript) Rails"    : ["ruby", "rubygems", "rails", "javascript", "jquery", "jqueryui", "jquerym", "angularjs", "backbone", "marionette", "meteor", "sproutcore", "moo", "prototype", "bootstrap", "foundation", "lodash", "underscore", "ember", "sencha", "extjs", "knockout", "zepto", "yui", "d3", "svg", "dojo", "coffee", "nodejs", "express", "mongoose", "moment", "require", "awsjs", "jasmine", "sinon", "grunt", "chai", "html", "css", "cordova", "phonegap", "unity3d"],
  "(SQL) Rails"           : ["ruby", "rubygems", "rails"],
  "Ruby Haml"             : ["haml"],
  "Rust"                  : ["rust"],
  "Sass"                  : ["sass", "compass", "bourbon", "neat", "css"],
  "Scala"                 : ["scala", "akka", "playscala", "scaladoc"],
  "Shell-Unix-Generic"    : ["bash", "manpages"],
  "SQL"                   : ["mysql", "sqlite", "psql"],
  "TCL"                   : ["tcl"],
  "TSS"                   : ["titanium"],
  "TypeScript"            : ["typescript", "javascript", "react", "nodejs", "jquery", "jqueryui", "jquerym", "angularjs", "backbone", "marionette", "meteor", "sproutcore", "moo", "prototype", "bootstrap", "foundation", "lodash", "underscore", "ember", "sencha", "extjs", "knockout", "zepto", "yui", "d3", "svg", "dojo", "express", "mongoose", "moment", "require", "awsjs", "jasmine", "sinon", "grunt", "chai", "html", "css", "cordova", "phonegap", "unity3d", "titanium"],
  "YAML"                  : ["yaml"],
  "XML"                   : ["xml", "titanium"]
}

More information on Dash docsets.

Credits

dashdoc's People

Contributors

akhterali avatar cenkalti avatar dayanruben avatar dotcypress avatar farcaller avatar fichtefoll avatar flada-auxv avatar fokkezb avatar j9ac9k avatar jacek-adamek avatar kapeli avatar madblobfish avatar mnkhouri avatar stufflebeam avatar teggy 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  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

dashdoc's Issues

Angularjs as option inside of Javascript Syntax map

It's easy enough to add it in user preferences, but I was curious why 'angularjs' isn't under the javascript syntax map by default? I would assume most every Angular project would have their controllers and directives inside a .js file. Just a thought.

New way for plugins to call Dash with keywords

Dash 1.9.3 comes with a new way for plugins to call Dash and send over a list of keywords which Dash uses to enable/disable docsets.

This is all described at http://kapeli.com/dash_plugins.

In the next weeks I'll go through all plugins and update them myself, so expect a pull request regarding this. However, if you have some free time and want to do it yourself, feel free to do so πŸ‘.

Note: please do not release a new version of the ST plugin for at least 2-4 weeks, so that Dash users have time to update to 1.9.3.

Alfred search immediately overrides the tab search

I almost exclusively use Dash with Alfred.

When I type in a command the activatd tab in Dash gets overwritten with the new search.
This is bugging me for years now!

Suggestions:

  1. Searching with Alfred opens a new tab and searchs there (Don't like this one)

  2. Alfred doesn't search inside the Dash-App until I hit Enter; It then would always open a new Tab, unless I press CMD+Enter.

What do you say?

DashDoc does not work on Sublime 3 on Ubuntu

I have set up key binding like so as per advise i nthe documentation:

{ "keys": ["ctrl+h"], "command": "dash_doc", "args": { "flip_syntax_sensitive": true }}

and it doesn't work. Do I miss anything here?

User preference not taking

Under osx have set "syntax_sensitive": true, in user prefs but the search is not syntax sensitive.

If I change the DashDoc prefs it works as expected.

Any ideas ?

Thanks

Issues with looking up correct language.

So basically whenever I have my cursor over a function, I hit my keybinding to do the quick dash-lookup and instead of taking me to the PHP docs, it seems to be taking me to either HTML5 or Bootstrap. Any ideas what's causing this?

Please Support Sublime Text 3

Please add support to Sublime Text 3.
Or if it had done that, please update the meta info in Package Control Repo.

Now in ST3, DashDoc is not available in Repo.

Thanks for this!

I just installed this package and did my first word lookup... πŸ”₯πŸ”₯πŸ”₯

Thanks so much for making this! πŸ’š

(please close this issue immediately after reading. kthxbai)

Have Dash snippets available in SublimeText

As an avid user of Dash snippets I would like to have them available in SublimeText in order to save me from manually switing to Dash, selecting the snippet in question there with the mouse, copying it, returning back to SublimeText in order to finally pasting it and then manually filling the gaps.

Ideally the Dash snippets appear in the list of snippets already available in SublimeText (as invoked by Tools: Snippets...)

URLs not being handled on KDE Plasma 5

Looks like the same issue here is impacting this plugin:

zealdocs/zeal#471

When I modified the xdg-open subprocess calls in DashDoc.py as follows, the plugin worked as intended

elif platform.system() == 'Linux':
            subprocess.call(['/usr/bin/xdg-open',
                         'dash-plugin:keys=%s&query=%s%s' % (','.join(keys), quote(query), background_string)])
        else:
            subprocess.call(['/usr/bin/open', '-g',
                         'dash-plugin:keys=%s&query=%s%s' % (','.join(keys), quote(query), background_string)])

DashDoc can not work after installing both zeal and velocity and uninstall zeal

I first installed velocity and DashDoc for sublime text. The doc search works well and use velocity. I then installed zeal. The doc search works well and use zeal. I then decided to uninstall zeal. After that, DasDoc does not work any more.

When I invoke the doc search function using my custom shortcut key, DashDoc complains that it can not find the application.

Dash Sublime Settings

i read the article about https://sublime.wbond.net/packages/DashDoc
I setup everything and it worked as described, but i have a problem to setup the individual syntax to docket setting.

At the moment i override the html docset in DashDoc.sublime-settings - DashDock like that to keep your default settings in the file.

    "HTML"                  : ["html","css","ee","foundation"], // "svg", "css", "bootstrap", "foundation", "javascript", "jquery", "jqueryui", "jquerym", "angularjs", "backbone", "marionette", "meteor", "moo", "prototype", "ember", "lodash", "underscore", "sencha", "extjs", "knockout", "zepto", "cordova", "phonegap", "yui"

because it didn't worked for me to override this settings in my xxx.sublime-project like that

{
    "folders":
    [
        {
            "path": "/Users/pog/webserver/project_xx"
        }
    ],
    "settings": {
      "syntax_docset_map": {
        "HTML" : ["html","css","ee","foundation"]
      }
    }
}

everytime i tried it before without to manipulate your default settings it didn't worked out for me.
Any ideas why?

I also tried out to override the user settings of DashDock but that also didn't work.

Any help with that would be great.

Best Peter

Language context search

Hi, although I do not know completely the dash syntax, it seems a way filtering to only the language syntax is dash://lang:word or dash://lang:{word}, then I've added:

    syntax = self.view.settings().get('syntax').split('/')[-1].split('.')[0]
    webbrowser.open_new_tab("dash://%s:%s" % (syntax,word,))

Old version in Package Control

The version in package control is from July 17th 2012 and is missing Main.sublime-menu

Can you update version and last_modified in packages.json?

Errors when running DashDoc command

When I run the DashDoc command, either through the keyboard shortcut or command palette, I get this output:

command: dash_doc
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 549, in run_
    return self.run(edit)
  File "DashDoc in /Users/a1096681/Library/Application Support/Sublime Text 3/Installed Packages/DashDoc.sublime-package", line 54, in run
  File "X/subprocess.py", line 521, in call
  File "X/subprocess.py", line 818, in __init__
  File "X/subprocess.py", line 1416, in _execute_child
FileNotFoundError: [Errno 2] No such file or directory: 'open'

ST3 Support

any chance this is coming? I don't see it in package control.

Page not updating

I'm on a 2017 Macbook Pro, running macOS Sierra 10.12.6 with the latest version of Dash, and I'm having this issue:

it doesn't work.

I've used this extension before on Windows and Linux, where it works flawlessly, but on macOS, when I run the dash_doc command on a selected bit of text, absolutely nothing will happen if I already have Dash open. If I close Dash and try again, it'll open dash... but only to whatever page I happened to be looking at last time I closed it; it's not searching for what I typed.

I'm new to mac, so it's possible that I just don't know what I'm doing, but I've tried running through the command palette and binding a key, and frankly I don't know what I could be missing.

Look up the expression/keyword under the cursor (such as background-color)

Thanks for DashDoc, very useful.
Not sure if this is doable, but depending on the buffer syntax, could the look up be performed on something "larger" than the word? For example, in a CSS file:

div.foo {
  background-color: #ddd;
}

If my cursor is on background, Dash looks up background, if my cursor is on color, it looks up color, but one would likely expect Sublime would ask Dash to look up background-color.

Thanks

Call Dash without activating it

DashDoc 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.

Instead of doing this:

open dash-plugin://query

Can you do this?

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 does not lose focus anymore.

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.

nodeload.github.com decommissioned?

Hi there,

It appears that GitHub have decided to decommission their "nodeload" service, see this tweet from their support account:

github support tweet

This unfortunately breaks the Package Control install:

Package Control: Error downloading package. HTTP error 503 downloading https://nodeload.github.com/farcaller/DashDoc/zipball/master.

Is there any way you can host the code elsewhere and update the install recipe?

Let me know if I can help in any way.

Cheers,
Dave J

Not working on Sb3

Hi,

The module is not working on Sublime-Text3 on Mac, I added { "keys": ["ctrl+d"], "command": "dash_doc" } to my keycap but it does not open at all :s

[Feature request] Add Β«zeal_pathΒ» setting

Request

Add "zeal_path" setting in DashDoc.

Justification

I install Zeal Portable for Windows in E:\Zeal folder. But now if directory of Zeal not default I can not to use DashDoc.

Extended behavior

Setting "zeal_path" in DashDoc.sublime-settings file. I make a value "zeal_path": "E:\\Zeal" and DashDoc works for me.

Environment

Operating system and version:
Windows 10.0.14393
Sublime Text:
Build 3126

Thanks.

Stopped working

This was excellent until it stopped working.

I have enabled shortcut visibility in the console, and i can see the commands are being invoked, but nothing happens at all.

The normal Dash shortcut does work, but only outside of Sublime Text.

I have Yosemite latest beta, but this (non-)behaviour started in Mavericks.

Any idea what I can do to troubleshoot?

Sublime Text 3065

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.