mirror of
https://github.com/robertkrimen/otto
synced 2025-09-28 18:45:22 +08:00
Add documentation to underscore
This commit is contained in:
parent
c2851c6b6e
commit
1fd249d119
|
@ -1,9 +1,27 @@
|
|||
/*
|
||||
Package underscore contains the source for the underscore utility-belt library for JavaScript.
|
||||
|
||||
import (
|
||||
_ "github.com/robertkrimen/otto/underscore"
|
||||
)
|
||||
// Every Otto runtime will now include underscore
|
||||
|
||||
http://underscorejs.org
|
||||
|
||||
https://github.com/documentcloud/underscore
|
||||
|
||||
By importing this package, you'll automatically load underscore every time you create a new Otto runtime.
|
||||
|
||||
To prevent this behavior, you can do the following:
|
||||
|
||||
import (
|
||||
"github.com/robertkrimen/otto/underscore"
|
||||
)
|
||||
|
||||
func init() {
|
||||
underscore.Disable()
|
||||
}
|
||||
|
||||
*/
|
||||
package underscore
|
||||
|
||||
|
@ -13,10 +31,12 @@ import (
|
|||
|
||||
var entry *registry.Entry = registry.Register(Source())
|
||||
|
||||
// Enable underscore runtime inclusion.
|
||||
func Enable() {
|
||||
entry.Enable()
|
||||
}
|
||||
|
||||
// Disable underscore runtime inclusion.
|
||||
func Disable() {
|
||||
entry.Disable()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user