Created
April 15, 2015 16:00
-
-
Save postcasio/c668860620352f857fe5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
atomdoc = require 'atomdoc' | |
marked = require 'marked' | |
doc = " | |
Public: Add one or more command listeners associated with a selector. | |
## Arguments: Registering One Command | |
* `target` A {String} containing a CSS selector or a DOM element. If you | |
pass a selector, the command will be globally associated with all matching | |
elements. The `,` combinator is not currently supported. If you pass a | |
DOM element, the command will be associated with just that element. | |
* `commandName` A {String} containing the name of a command you want to | |
handle such as `user:insert-date`. | |
* `callback` A {Function} to call when the given command is invoked on an | |
element matching the selector. It will be called with `this` referencing | |
the matching DOM node. | |
* `event` A standard DOM event instance. Call `stopPropagation` or | |
`stopImmediatePropagation` to terminate bubbling early. | |
## Arguments: Registering Multiple Commands | |
* `target` A {String} containing a CSS selector or a DOM element. If you | |
pass a selector, the commands will be globally associated with all | |
matching elements. The `,` combinator is not currently supported. | |
If you pass a DOM element, the command will be associated with just that | |
element. | |
* `commands` An {Object} mapping command names like `user:insert-date` to | |
listener {Function}s. | |
Returns a {Disposable} on which `.dispose()` can be called to remove the | |
added command handler(s). | |
" | |
lexer = new marked.Lexer | |
console.log lexer.lex(doc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: