Skip to content

Instantly share code, notes, and snippets.

@prasincs
Created July 26, 2009 19:35
Show Gist options
  • Save prasincs/155901 to your computer and use it in GitHub Desktop.
Save prasincs/155901 to your computer and use it in GitHub Desktop.
/* Pydoc.js
* Author: Prasanna Gautam
* Purpose: Search pydoc for terms from the browser
* You could replace it with your pydoc running on localhost if you want to search your packages.
*/
CmdUtils.CreateCommand({
names: ["pydoc"],
description: "Searches for python documentation for the term you're searching for",
arguments: [{role: 'object', nountype: noun_arb_text}],
author: "Prasanna Gautam",
email: "[email protected]",
license: "MIT",
homepage: "http://www.nextdoorhacker.com",
preview: "Uses http://docs.python.org/search.html to lookup python terms.",
execute: function( args ) {
var urlTemplate = "http://docs.python.org/search.html?q={QUERY}"
var urlString = urlTemplate.replace("{QUERY}", args.object.text);
Utils.openUrlInBrowser(urlString);
//displayMessage (urlString);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment