Labs/Bespin/Roadmap/ConfigIntegration
How can you integrate your own configuration with the Bespin editor?
When you login to Bespin you should see a project named "BespinSettings". This is your special project that contains configuration, custom commands, a scratchpad, and anything else you want to put in there. It is like a .bespin home directory.
You can use the "config.js" file to put any JavaScript to tweak your Bespin experience. NOTE: Danger, danger. You can do bad things here!
The moving pieces:
editconfig
If you type 'editconfig' from the command line, it will open up the config.js file for you, ready for editing. Save this puppy.
runconfig
Takes the contents of the saved config.js and eval()'s it. The eval has a scope that is setup that gives you access to the following objects:
- Bespin: The global config object
- commandLine: Access to the command line. Here you can run things like:
- commandLine.showInfo("pop me up")
- commandLine.executeCommand("version")
- editor: The core editor object. Here you can play with the "actions" to tweak the experience
- editSession: Info on the session (project name, etc). Should be rare to use this.
- files: Access to the FileSystem to open/save/remove/... files
- server: Access to the Server API to talk back
- toolbar: Access to the editor toolbar (the buttons etc)
set autoconfig on
If you run 'set autoconfig on' then when the editor is loaded, it will automatically run 'runconfig' for you.
By default this is set to be false, and thus the config.js is NOT loaded until you actively run a 'runconfig' yourself.