diff --git a/README.md b/README.md index 1b2b94d..e1344f8 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,19 @@ Chef-mode is an Emacs minor mode to make editing [Opscode Chef](http://www.opscode.com/chef/) -[repositories](http://wiki.opscode.com/display/chef/Chef+Repository) +[repositories](http://docs.opscode.com/essentials_repository.html) easier. It defines a minor mode, chef-mode, and a corresponding -global-chef-mode, with two keybindings: +global-chef-mode, with three keybindings: * C-c C-c (M-x chef-knife-dwim) - when editing part of chef repository (cookbook, data bag item, node/role/environment definition), uploads that part to the Chef Server by calling appropriate knife command * C-c C-k (M-x knife) - runs a user-specified knife command +* C-c C-d (M-x chef-resource-lookup) - When the cursur is on a + resource command it opens a browser with the resource doc from the + wiki. When the cursor is anywhere else it opens the main resource + api page. The library detects bundler and, if Gemfile is present on top-level of the Chef repository, runs 'bundle exec knife' instead of plain diff --git a/chef-mode.el b/chef-mode.el index 2bb3f08..fa17bcd 100644 --- a/chef-mode.el +++ b/chef-mode.el @@ -72,6 +72,7 @@ (define-key chef-mode-map (kbd "\C-c \C-k") 'knife) (define-key chef-mode-map (kbd "\C-c \C-c") 'chef-knife-dwim) +(define-key chef-mode-map (kbd "\C-c \C-d") 'chef-resource-lookup) (define-minor-mode chef-mode "Mode for interacting with Opscode Chef" @@ -180,53 +181,58 @@ Guesses whether you have " (defun chef-resource-lookup () "Open the documentation in a browser for the chef resource at point" (interactive) - (let* ((base "http://wiki.opscode.com/display/chef/Resources") - (anchor "#Resources-") + (let* ((base "http://docs.opscode.com/chef/resources.html") + (anchor "#") (tbl '( - ("cookbook_file" . "CookbookFile") - ("cron" . "Cron") - ("deploy" . "Deploy") - ("directory" . "Directory") - ("env" . "Env") - ("erl_call" . "ErlangCall") - ("execute" . "Execute") - ("file" . "File") - ("git" . "Git") - ("group" . "Group") - ("http_request" . "HTTPRequest") - ("ifconfig" . "Ifconfig") - ("link" . "Link") - ("log" . "Log") - ("mdadm" . "Mdadm") - ("mount" . "Mount") - ("ohai" . "Ohai") - ("package" . "Package") - ("apt_package" . "Package") - ("dpkg_package" . "Package") - ("easy_install_package" . "Package") - ("freebsd_package" . "Package") - ("macports_package" . "Package") - ("portage_package" . "Package") - ("rpm_package" . "Package") - ("gem_package" . "Package") - ("yum_package" . "Package") - ("zypper_package" . "Package") - ("powershell" . "PowerShellScript") - ("remote_directory" . "RemoteDirectory") - ("remote_file" . "RemoteFile") - ("route" . "Route") - ("ruby_block" . "RubyBlock") - ("scm" . "SCM") - ("script" . "Script") - ("bash" . "Script") - ("csh" . "Script") - ("perl" . "Script") - ("python" . "Script") - ("ruby" . "Script") - ("service" . "Service") - ("subversion" . "Subversion") - ("template" . "Template") - ("user" . "User") + ("apt_package" . "apt-package") + ("bash" . "bash") + ("chef_gem" . "chef-gem") + ("cookbook_file" . "cookbook-file") + ("cron" . "cron") + ("csh" . "csh") + ("deploy" . "deploy") + ("directory" . "directory") + ("dpkg_package" . "dpkg-package") + ("easy_install_package" . "easy-install-package") + ("env" . "env") + ("erl_call" . "erl-call") + ("execute" . "execute") + ("file" . "file") + ("freebsd_package" . "freebsd-package") + ("gem_package" . "gem-package") + ("git" . "git") + ("group" . "group") + ("http_request" . "http-request") + ("ifconfig" . "ifconfig") + ("ips_package" . "ips-package") + ("link" . "link") + ("log" . "log") + ("macports_package" . "macports-package") + ("mdadm" . "mdadm") + ("mount" . "mount") + ("ohai" . "ohai") + ("package" . "id150") + ("pacman_package" . "pacman-package") + ("perl" . "perl") + ("portage_package" . "portage-package") + ("powershell_script" . "powershell-script") + ("python" . "python") + ("registry_key" . "registry-key") + ("remote_directory" . "remote-directory") + ("remote_file" . "remote-file") + ("rpm_package" . "rpm-package") + ("route" . "route") + ("ruby" . "ruby") + ("ruby_block" . "ruby-block") + ("scm" . "scm") + ("script" . "script") + ("service" . "service") + ("smartos_package" . "smartos-package") + ("solaris_package" . "solaris-package") + ("subversion" . "subversion") + ("template" . "template") + ("user" . "user") + ("yum_package" . "yum-package") )) (target (assoc-string (symbol-at-point) tbl)))