The following commands are presently available in the TextMate RubyFrontier bundle. To access them, choose Bundles > RubyFrontier or use the little popup menu at the bottom of the TextMate document window.
Preflight Site. Calls
UserLand::Html::preflightSite(). Generates a new autoglossary for the entire site of the selected page object. Works best if you manually delete the existing
#autoglossary.yaml file first. Causes all local links to work properly (if they are going to work properly). For example, if you move a site folder to a different location, this is the first thing you should do. Any output will consist of error messages reporting duplicate names (e.g. two different files named
mypage.txt or titled
"My Cool Page"); duplicate names aren’t fatal but you’ll probably be happier if you fix them anyway.
Check NextPrevs. Ignore this.
New Site. Calls
UserLand::Html::newSite(). This is how you make a new site.
Publish Page. Calls
UserLand::Html::releaseRenderedPage(). This is how you publish a single page (the current page in TextMate). Errors are reported in the output. Not every error is fatal (i.e. some errors permit the page to be published anyway) and not every error needs fixing (e.g. failure to find a snippet could be deliberate, because you really did mean to surround some text with two pairs of square brackets). But an error reported by RefGlossary, for example, does need fixing (because a link is not getting formed properly), and of course an error that prevents the page from being published needs fixing too.
At present, Publish Page works only on a renderable, and when it finishes, it causes the just-rendered page to be opened in your default browser. (I say “at present” because this is an incomplete implementation of what Frontier used to do. In Frontier, opening the file in your browser, called a “preview”, is a switch that can be turned off; plus, Frontier could do more with the rendered page than just write it out to disk. So in future I might expand in some way on the current functionality.)
By default, Publish Page opens a rendered renderable as a file with your browser: that is, it creates a
file:// URL and asks the browser to open it direct from disk. Alternatively, if your onboard Web server (presumably Apache) is running, you can have your browser request the file from the Web server via a localhost
http:// URL. If this is what you want, then you need to add two values to your site’s
:apacheSite is the pathname of the folder where Apache is serving up
http:// requests of the type you’ll be making (and in which, obviously, your publishing
:folder is located);
:apacheURL is the
http:// URL of a request to serve from that folder. So, for example, typical values would be, respectively,
http://localhost/~mattneub/ (or whatever your username is).
Publish Folder and Publish Site. Calls
UserLand::Html::publishSite(), respectively. This is how you publish the whole folder, or the whole site, containing the current page in TextMate. Basically, this is the same as Preflight Site followed by Publish Page for each page object. This is the only way to publish non-renderables. The output reports the publishing of each page object. Unfortunately, if there are any error messages, they are mingled in with the publishing reports, so always glance over the entire output looking for errors. Even if a fatal error occurs, the error message might not be at the start or end of the output page; you really do have to look over the entire thing. Some day I’ll probably improve this feedback.
As mentioned above, Publish Page also opens the just-rendered page in your browser. Publish Site does not open all the rendered pages in your browser (that would be insane); instead, it opens just one, namely the page you were looking at in TextMate when you gave the Publish Page command. The opening of this page in your browser is not a sign that the Publish Site process has completed! Wait for TextMate itself to finish and produce its output before trying to traverse your site in the browser.
Both Publish Folder and Publish Site call Preflight Site before starting. In case you don’t want that, variants are provided called Publish Folder (No Preflight) and Publish Site (No Preflight). These variants can save a little time, but are useful especially (and were devised particularly) for the case where you’re using cross-references.
Traverse Selected Link. Calls
UserLand::Html::traverseLink(). This is a writing tool. When you realize that it’s there and you understand what it does, you’re going to be really, really grateful I put it in. It’s very simple. In a page object, you select the entire contents of an
href attribute; when you choose this menu item, RubyFrontier tries to interpret this
href value just as it would do if it were publishing the page, and, if it succeeds, it opens that page object in TextMate. Believe me, when you’ve got a site of 200 pages and want to know what’s in the page targeted by
[some text](somelink), this is a real time-saver; you just select “somelink” and issue this command.
This documentation prepared
by Matt Neuburg, phd = matt at tidbits dot com
Download RubyFrontier from GitHub.