Add docs for cson format to menu manager

This commit is contained in:
Ben Ogle
2015-01-06 16:51:15 -08:00
parent d4c4ab58b1
commit f7f2f4497b
2 changed files with 44 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ SpecificityCache = {}
# An instance of this class is always available as the `atom.contextMenu`
# global.
#
# ## Format
# ## Context Menu CSON Format
#
# # ```coffee
# 'atom-workspace': [{label: 'Help', command: 'application:open-documentation'}]

View File

@@ -12,6 +12,49 @@ MenuHelpers = require './menu-helpers'
# application menu.
#
# An instance of this class is always available as the `atom.menu` global.
#
# ## Menu CSON Format
#
# Here is an example from the [tree-view](https://github.com/atom/tree-view/blob/master/menus/tree-view.cson):
#
# ```coffee
# [
# {
# 'label': 'View'
# 'submenu': [
# { 'label': 'Toggle Tree View', 'command': 'tree-view:toggle' }
# ]
# }
# {
# 'label': 'Packages'
# 'submenu': [
# 'label': 'Tree View'
# 'submenu': [
# { 'label': 'Focus', 'command': 'tree-view:toggle-focus' }
# { 'label': 'Toggle', 'command': 'tree-view:toggle' }
# { 'label': 'Reveal Active File', 'command': 'tree-view:reveal-active-file' }
# { 'label': 'Toggle Tree Side', 'command': 'tree-view:toggle-side' }
# ]
# ]
# }
# ]
# ```
#
# Use in your package's menu `.cson` file requires that you place your menu
# structure under a `menu` key.
#
# ```coffee
# 'menu': [
# {
# 'label': 'View'
# 'submenu': [
# { 'label': 'Toggle Tree View', 'command': 'tree-view:toggle' }
# ]
# }
# ]
# ```
#
# See {::add} for more info about adding menu's directly.
module.exports =
class MenuManager
constructor: ({@resourcePath}) ->