• Stars
    star
    128
  • Rank 279,377 (Top 6 %)
  • Language
    Python
  • Created almost 13 years ago
  • Updated about 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Sublime Text 2 plugin to go to documentation

GotoDocumentation

A Sublime Text plugin to jump to documentation for the current keyword.

Supports

  • PHP
  • JS / CoffeeScript
  • HTML
  • CSS/SASS/LESS
  • Python (via pydoc)
  • Clojure
  • Go
  • Ruby (+Rails)
  • C / C++
  • Perl
  • C#
  • Lua
  • Postgres
  • Erlang
  • Smarty
  • Haskell
  • ...you can add any other language via settings

Installation

Via Package Control
Search for GotoDocumentation

Manually
Clone this project in your Packages folder under the name GotoDocumentation.
git clone https://github.com/kemayo/sublime-text-2-goto-documentation.git GotoDocumentation

How to use

Move the cursor inside the word you want the docs for and:

  • Press Super+Shift+H or
  • Open command palette (Ctrl+Shift+P) and search for for GotoDocumentation

Edit the urls

GotoDocumentation allows you to edit the url that opens by editing the settings.

The available settings are:

{
    "prefix": "", // added at the begging of the query
    "suffix": "", // added at the end of the query
    "docs": { // obj containing the docs for each scope
              // these are merged with the default ones


        // the key value pair represent scope -> doc url
        // supported placeholders:
        //  - %(query)s the selected text/word
        //  - %(scope)s the current scope
       "css": "http://devdocs.io/#q=%(scope)s+%(query)s",

        // we can also have an object to
        // run a command for finding docs
        // inside the command you can use the same placeholders
        "python": {
            // the command to be executed
            "command": ["python", "-m", "pydoc", "%(query)s"],
            // a regex to determine if this was an invalid response from the console
            "failTest": ".*no Python documentation found for.*",
            // regex to select something from the valid response
            "changeMatch": "(Related help topics)",
            // regex to replace the matched result
            "changeWith": "-------\n\\1",
            // fallback url: if failTest returns true this will be used
            "url": "http://docs.python.org/3/search.html?q=%(query)s"
        }
    },
    // if we have no docs for the current scope
    // we will try using the fallback one,
    // to disable set to false
    "fallback_scope": "google"
}

The change replace is done with the re.sub method

How to get the scope

To get the scope for a specific place open your sublime console with ctrl + ` and paste in this command view.scope_name(view.sel()[0].begin()).rpartition('.')[2].strip()
You can then use that scope to set a rule in the docs dictionary(object).

Contributions

Submit a patch adding more and I'll include it.

If you find a bug or have suggestions open an issue here

More Repositories

1

sublime-text-git

Plugin for some git integration into sublime text
Python
2,824
star
2

maphilight

jQuery plugin that adds highlighting to image maps
JavaScript
489
star
3

sublime-text-2-clipboard-history

Clipboard history plugin for Sublime Text 2
Python
188
star
4

leech

Turn a story on certain websites into an ebook for convenient reading
Python
154
star
5

obsidian-smart-links

TypeScript
26
star
6

wow-silverdragon

World of Warcraft addon to find rare mobs
Lua
23
star
7

wp-rss-importer

PHP
19
star
8

wow-simpleitemlevel

World of Warcraft addon to show item levels
Lua
15
star
9

davidlynch.org

My website
HTML
14
star
10

firefox-sticky-containers

Firefox extention to make the current container "sticky" when opening a new tab
JavaScript
13
star
11

simplecomic

Lightweight online comic publishing system, for the webcomic artist who just wants to put up comics
PHP
11
star
12

google-webfonts-lister

Download a complete list of google webfonts
Python
11
star
13

hubot-phabricator

Hubot plugin to expand on phabricator object names
CoffeeScript
10
star
14

wp-disqus-importer

Import a Disqus XML export into WordPress
PHP
10
star
15

deviantart_backup

Backup script for DeviantArt
Python
9
star
16

gedit-smarthome

Enable smart HOME/END behavior for gedit
Python
8
star
17

wow-handynotes-dragonflight

World of Warcraft addon to tell you where treasures are in the Dragon Isles (requires HandyNotes)
Lua
8
star
18

lj.py

Sometimes you want to have API access to angsty teenagers under Python. This lets you do that. May God have mercy upon your soul.
Python
7
star
19

wow-dropthecheapestthing

World of Warcraft addon to drop/sell the cheapest thing you're carrying
Lua
7
star
20

wow-handynotes-shadowlandstreasures

World of Warcraft addon to tell you where treasures are in Shadowlands (requires HandyNotes)
Lua
7
star
21

wow-appearancetooltip

World of Warcraft addon: fancy tooltip for previewing item appearances
Lua
6
star
22

wow-handynotes-legiontreasures

World of Warcraft addon to tell you where treasures are in Legion (requires HandyNotes)
Lua
6
star
23

irssi-pushover

Pushover.net plugin for irssi
Perl
5
star
24

wow-minimaprangeextender

World of Warcraft addon to show minimap vignette icons sooner
Lua
5
star
25

wow-handynotes-battleforazerothtreasures

World of Warcraft addon to tell you where treasures are in Battle for Azeroth (requires HandyNotes)
Lua
5
star
26

wow-haveidonethat

World of Warcraft addon to tell you about what you've done and suggest what you might want to do next
Lua
4
star
27

wow-questpointer

World of Warcraft addon to point at quests
Lua
4
star
28

sublime-text-exclude-paths

Exclude paths from project / search indexing
Python
4
star
29

downer

token-based download manager
PHP
3
star
30

waup

An updater for World of Warcraft addons hosted on wowace.com
Python
3
star
31

wow-questschanged

World of Warcraft addon for developers to log quest completion changes
Lua
3
star
32

contwext

Fetch a Twitter feed and guess context
Python
3
star
33

wow-whatsonthemap

World of Warcraft addon that shows a simple list of currently visible map vignettes
Lua
3
star
34

wow-bankstack

World of Warcraft addon to move items around in your inventory, bank, and guild bank
Lua
3
star
35

wow-handynotes-warwithin

World of Warcraft addon to tell you where treasures are in the War Within expansion (requires HandyNotes)
Lua
3
star
36

jenny

Size calculation for blocking/non-blocking JS/CSS on a page
Python
2
star
37

wow-handynotes-lostandfound

World of Warcraft addon to help you find the Lost and Found treasures in Pandaria
Lua
2
star
38

actions-recent-changelog

A GitHub Action for generating a "recent changes" file from a large manually-curated changelog
Python
2
star
39

armory

Python module for accessing the World of Warcraft armory
Python
2
star
40

wow-doesmyaltknowthat

World of Warcraft addon to tell you about what your alts know
Lua
2
star
41

dice

Roll dice, and get information about the probabilities of the roll
Python
2
star
42

colorclock

A clock whose colors depend on the time
HTML
2
star
43

wow-handynotes-secretfish

World of Warcraft addon: where the secret fish are for the Secret Fish and Where to Find Them achievement
Lua
2
star
44

wow-handynotes-stygia

World of Warcraft addon to tell you where Stygia gathering nodes are in the Maw (requires HandyNotes)
Lua
2
star
45

unobtrusive-sudoku

Simple Javascript sudoku requiring no in-page markup
JavaScript
1
star
46

wow-handynotes-elitebattlepets

WoW addon: Handynotes plugin for the Tanaan Jungle elite battle pets
Lua
1
star
47

wow-handyminimaparrow

World of Warcraft addon that layers an arrow onto the minimap higher up than anything else
Lua
1
star
48

wow-handynotes-higherdimensionallearning

WoW addon: Handynotes plugin for Higher Dimensional Leaning
Lua
1
star
49

wow-handynotes-suramarleylines

WoW addon: Handynotes plugin for suramar leylines
Lua
1
star
50

wow-objectscanner

World of Warcraft addon: Watch tooltip updates to announce when you find specific objects
Lua
1
star
51

akismet

Python module to interact with akismet
Python
1
star
52

vagrant-skeleton

The vagrant skeleton I use
ApacheConf
1
star
53

tiny

I wrote a tinyurl cgi script once
Python
1
star
54

vue-editor-trash

Playing with a Vue-based contentediable editor to teach myself things
1
star
55

dilbert

Javascript viewer for Dilbert
JavaScript
1
star
56

loosephabric

Specialized macOS menubar utility to turn copied text into links
Swift
1
star
57

wow-handynotes-lorewalkers

World of Warcraft addon to help you find the Lorewalkers tablets in Pandaria
Lua
1
star
58

wow-handynotes-witheredarmytraining

WoW addon: Handynotes plugin for withered army training
Lua
1
star
59

wow-handynotes-wrath

World of Warcraft addon to tell you where things are in Northrend (requires HandyNotes)
Lua
1
star
60

wow-handynotes-burningcrusade

World of Warcraft addon to tell you where treasures are in the Burning Crusade (requires HandyNotes)
Lua
1
star
61

handynotes-kosumoth

World of Warcraft addon to tell you where Kosumoth is in Legion (requires HandyNotes)
Lua
1
star
62

wow-handynotes-longforgottenhippogryph

WoW addon: Handynotes plugin for the Long Forgotten Hippogryph
Lua
1
star
63

wow-handynotes-suramartelemancy

WoW addon: Handynotes plugin for suramar portals
Lua
1
star
64

tracker

Quick remote-data-tracker script
Python
1
star
65

vue-visualeditor-example

Test project wrapping VisualEditor into a vue component and using it
HTML
1
star
66

wow-serverrestartsound

World of Warcraft addon to make a noise when the server's about to restart
Lua
1
star
67

hubot-deviantart

A hubot script adding deviantart search
CoffeeScript
1
star
68

longurl

Tiny Python module for expanding shortened URLs
Python
1
star
69

wow-handynotes-treasurehunter

World of Warcraft addon to tell you where treasures are (requires HandyNotes)
Lua
1
star