mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Add docs for cson format to menu manager
This commit is contained in:
@@ -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'}]
|
||||
|
||||
@@ -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}) ->
|
||||
|
||||
Reference in New Issue
Block a user