Labs/Bespin/UserGuide
Disclaimer
Please consider that this documentation is still under hard development, and may change. This documentation is for Bespin version 0.1.1 "Naughty Nimbus" but it will be updated as new releases come out.
What is Bespin?
Bespin is an experiment in trying to create a web-based web-focused extensible code editor from Mozilla Labs. It's made by Dion Almaer and Ben Galbraith. This editor is based on new technologies regarding HTML 5.
How can I use Bespin
Requisites
To use Bespin, it's recommended that you use Firefox or Webkit Nightly Builds browsers.
Despite of this, Bespin should work in every modern browser that supports HTML 5 property "Canvas" (this excludes Internet Explorer), has a text rendering API, and support JavaScript.
Browsers that support Bespin:
- Firefox 3.x
- Webkit Nightly Builds (development version of Safari)
- Google Chromium (development version of Chrome)
Browsers NOT supported:
- Internet Explorer
- Google Chrome 1.x
- Opera 9.6x
- SeaMonkey
- Camino 1.6.6
- KHTML (Konqueror)
Making an account
To use Bespin you must create an account into Bespin Website and then log in. You'll be facing your Dashboard, welcome aboard the cloud!
Installing Bespin Locally
ATTENTION: This section will be moved to the Developer Guide when it's ready.
If you don't want to use Bespin 'in the cloud' you can install an instance of it in your computer. Or maybe you want to install it for a local network.
This section is still in development.
Python API
Firstly, you will need to grab the source. If you have mercurial installed then just do a
hg clone http://hg.mozilla.org/labs/bespin/
Otherwise just download the tarball and extract it somewhere in you home directory.
Once your have everything on your hard disk open a terminal and go into the Bespin directory. Then change into the backend folder
cd backend/python
and install all the requirements with
python bootstrap.py
This will take a few moments. After it is finished configure your installation and start the local server with the following three commands:
source bin/activate paver create_db paver start
If you see something like Server starting on localhost:8080 in the terminal it means everything went well and you are good to go. Just point your browser to http://localhost:8080 and off you go.
Java API
This section is still in development.
Dashboard
The Dashboard is the main view of your projects, files, opened sessions, and statistics (in a future version).
Projects
This section is still in development.
Importing
You can import projects to your Bespin account from the web. To import a project you can do:
import <project name> <url with file>
Projects must be hosted on-line and compressed in ZIP or TAR.GZ formats.
Exporting
To export a project to your computer you can do:
export <project name> <archivetype>
<archivetype> can be ZIP or TGZ. If archivetype is not passed it defaults to ZIP
Version Control
Not supported in this version. It will be available in version 0.2 (See Roadmap)
File View
The file view opens up when you click on any project. You can open a file by double clicking on it.
Open Sessions
This is where opened files appear. Every file shown here is still active, and you can access it by double clicking on it.
It's stablished on the Roadmap that every file will contain information about date, last modification, etc.
Editor
This is the main editor. You can edit your files here. It has syntax highlighting and the most commons tools for an editor:
- Cut/Copy/Paste
- Preview on Web (does not work on Webkit)
- Undo/Redo
- Save/Close
- Change font size
- Line numbering
Collaboration
Not included in this version. It will be available in version 0.3 (See Roadmap)
Syntax Highlighting
Right now only CSS, JavaScript and HTML hightlighting is supported. This will be improved in a near future.
Command Line
It shows at the bottom of the page. Here you can type some commands to do things that are not available trough the UI.
Commands
Global Commands
alias [alias] [command] This creates an alias between a word you want with a command p.e.:
alias close closefile
This creates an alias that closes without saving the file you are currently working.
set [parameter]: This sets values to the configuration. If parameter is not passed a list with the available variables will be displayed. To change a parameter value you can do:
set <variable> <value>
For example:
set theme white
projects: Show a list with your projects.
help: Displays a list with the available commands.
Dashboard Specific Commands
history: Shows the command history.
version: Shows Bespin version.
files [project]: Shows the files inside a given project.
Editor Specific Commands
Some commands still missing
clear: Clear the content of the file.
closefile [file]: If file parameter is passed, closes the specified file, if not, closes the current open file.
clipboard: Saves the file contents into the clipboard.
dashboard: Go back to the Dashboard
editconfig: Open the configuration file for the editor.
goto [line number]: Moves cursor to the desired line number
load [filename]: Loads the file specified in [filename]
logout: Logout the editor.
newfile [filename]: Creates a new file with the name specified in [filename]
preview [filename]: Preview the file in the web browser (does not work on Webkit)
project [name]: Creates a project with the desired name
Keyboard Shortcuts
Note: The keyboard shortcuts are the same for Windows, GNU/Linux and Mac OS, there is no Cmd equivalent.
Control-J: Takes you to the command line.
Emacs Style Shortcuts
There are some shortcuts implemented that are similar to Emacs. They are:
- Control-B: Move cursor left
- Control-F: Move cursor right
- Control-P: Move cursor up
- Control-N: Move cursor down
- Control-A: Move cursor to line start
- Control-E: Move cursor to line end
User Configuration
Configuration File
You can access to it typing in the command line:
editconfig
This will open a new file called "config.js"
Settings
Parameters that you can change via set:
collaborate [on|off]: Set collaboration mode. Default value: off
syntax [auto|css|html|javascript]: Set the highlighting language. Default value: auto.
autocomplete [on|off]: Set command autocompletion. Default value: off
theme [name]: Change theme. Currently there are only three suported themes. See Themes section for more info.
fontsize [number]: Change default font size. Default value: 10
keybindings [emacs]: Set emacs style keybindings
Example:
set autocomplete on
Themes
Only three themes are currently supported:
- Coffee (default)
- White
- Black
You can change between themes typing in the command line:
set theme <theme-name>
Frecuently Asked Questions
You can see them here
Tips and Tricks
You can see them here
Known Issues
You can see them here
Bug Reporting
Have you find a bug? Tell us! Make a bug report