App Editor
- Getting Started
- Creating a New App
- Editing Files
- Previewing & Debugging
- Keyboard Shortcuts
- The Acre Templating Language and API
- FAQ
Getting Started
The App Editor is part of the Acre hosted application environment. With the App Editor, some knowledge of JavaScript and HTML, and the Acre Templating Language and API, you can create applications that use Freebase data without having to know any other programming languages.
A major feature of the application editor is the ability to clone (if you want to modify) or import (if you don't) files from applications created by you or other users. If you're a novice developer this is an easy way to bring working code into your own applications, then modify it to meet your needs.
To get started using App Editor, register with Freebase.
Creating a New App
- Click "Open a different app"
- Enter a display name and host name for your new application
- Click Create
Editing Files
If you want to create a new file of your own, click New next to the file type you want to create:
- Templates are for Acre templates
- Scripts are for JavaScript files
- Queries are for Freebase MQL queries
- Text Files are sent to the browser unmodified (e.g., CSS)
- Images are, well, images
You can change the file type after you've created it by selecting a different file type from the drop-down menu in the bottom status bar. See Acre URLS, services and special files for more on reserved filenames and special files.
Syntax highlighting can be turned on and off from the Tools menu.
Previewing & Debugging
The Open Preview link opens the preview window so you can see the output of your file, including the server log of detailed information about how the processing of the file. Use the input field to pass an extended path or query string to the file before previewing.
Use acre.log in your scripts to write variables and other state to the server log, including in combination with JSON.stringify to dump entire objects.
Keyboard Shortcuts
The following are used with ctrl (Windows) or cmd/apple (Mac):
o : open app
s : save file
p : preview file
g : go to line (focuses the line number control)
The Acre Templating Language and API
The Acre Templates Guide can get you started with how to build simple apps that look like HTML, while the Acre API Guide has information on the core Acre API as well as how to access many of the Freebe API services.
FAQ
It's OK to add your own here and we'll do our best to answer them...
Why is Preview not showing my latest changes?** - Freebase uses a special cookie (mwLastWriteTime) to make sure you get the latest copy whenever you've made changes. Be sure your browser is set to accept cookies from both freebase.com and your app's hostname. If you've done this and still aren't seeing your latest edits, try selecting __Refresh Cache in the Tools menu.
Can I use
emacsor (insert favorite editor here) instead? - The simplest option is to turn off syntax highlighting in the App Editor and use a browser plugin for editing textareas like "It's All Text" for Firefox (although the newly introduced v1.0 seems to cause problems). If you use TextMate on the Mac, here are specific instructions for setting that up.
As all the files are stored in Freebase, there's also the option of building your own plugin for your editor using the Freebase APIs. Rumor has it there is one floating around for Vi...