Archive for the 'Tools' Category

Moving (renaming) Files in CVS

Once of the main complaints about the CVS version control system is that it’s difficult to move or rename files as your project structure changes.

While you can easily remove files and re-add them under a new name or location, this method loses the precious nuggets of wisdom contained in the file’s history — you do enter meaningful commit messages, don’t you? ;-)

Although recent CVS versions (CVSNT 2.0.55 and later) include support for a new rename command, the feature is classified as “experimental” and it’s not well-supported by common clients nor well-documented in the manual.

However, it can be done — the key is to understand that rename operations are properties of directories, not of the files inside. So when you move or rename a file, it is essential to commit the folder containing the file — and (if you moved the file) the new folder as well.

Before using the rename command, you may want to back up your local working copy (sandbox) just to be on the safe side if anything goes wrong — and if it does, please don’t blame me!

The steps below outline the basic process.

To move (rename) an existing file in CVS:

  1. If you’ll be moving a file to a new location that is not already under version control, create NewFolderName and add it to CVS with cvs add.

  2. At the command line, navigate to current location of the file you want to move (let’s call this OldFolderName) and enter:

    cvs rename OldFileName ../NewFolderName/NewFileName

    (the file is moved to NewFolderName and renamed to NewFileName)

  3. This is the important part! — Still in OldFolderName, enter:

    cvs commit

  4. If you moved the file to a different folder, cd to NewFolderName and repeat the commit command:

    cvs commit

    At this point, the repository knows about the changes to OldFolderName and NewFolderName.

    Now, for good measure, we will update our local sandbox to be sure we have a pristine copy of the project. In fact, to really make sure the repository “gets it”, we’ll remove NewFolderName and verify that it returns on update.

  5. So take a deep breath, and delete NewFolderName.

  6. Then, finally, navigate to your project’s root folder and enter:

    cvs update -P -d

    (In this command, the -P option tells CVS to “prune” (remove) any empty folders in your working copy, and -d creates any missing folders like NewFolderName.)

That’s it. You’re done!NewFolderName should reappear, and inside it, NewFileName will be waiting for you with its history intact!

What? It isn’t? — well, you do have that backup, don’t you?

RenderX XEP Setup in oXygen

Recently, a client asked for assistance in setting up the RenderX XEP processor for use with the oXygen XML editor on Mac OS X. XEP is an XSL FO processor that can be integrated with oXygen to transform DITA maps to PDF via the PDF2 transformation scenario.

The steps below describe the basic setup, and while the output location is project-specific, the rest should be essentially the same in any environment.

  1. Install XEP (for example, to /Applications/RenderX-XEP)

  2. Point oXygen to XEP executable in oXygen prefs: XML > XSLT-FO-XQuery > FO Processors (Use the Browse button)

  3. Create/verify configuration of PDF2 transformation scenario in oXygen:

  • Open a DITA map file & select Configure Transformation Scenario from the DITA Maps menu.

  • Create new scenario, select PDF2 - Idiom FO Plugin as transformation type

  • In the Edit DITA Scenario dialog:

    • On the FO Processor tab, select XEP from the Processor list.
    • On the Parameters tab, set:
      • args.input to ${cf}
      • dita.dir to ${frameworksDir}/dita/DITA-OT
      • (other parameters optional)
    • Leave the default settings on the Filters tab.
    • On the Advanced tab, set:
      • Custom build file to ${frameworksDir}/dita/DITA-OT/build.xml
      • Java Home to Default, such as /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
    • On the Output tab, set:
      • Base directory to ${cfd}
      • Temp directory to a subfolder of output location, such as …/documentation/output/temp
      • Output folder to a subfolder of SVN documentation checkout location such as …documentation/output/pdf2
    • Click OK to save settings.
  • Click Transform now to create a PDF of the current DITA map.


Upgrading WordPress via Subversion

David over at Geeks are Sexy has a nice tutorial on keeping WordPress installations current by using Subversion to check out the latest code directly from the Automattic repository.

David’s instructions are much more detailed than the brief steps provided on the WordPress site, and also describe how to check out stable WordPress versions as opposed to the latest bleeding-edge code from trunk, and how to switch an established blog to Subversion to facilitate future updates.

(Essentially, you check out a working copy to your webserver via SSH and reconfigure the fresh install to use your existing database content—worked here quite nicely.)

Cornerstone: New Mac Subversion Client

cornerstone-app.pngZürich-based indy developer Zennaware has released Cornerstone, the latest attempt to make the Subversion experience more Mac-like. As Zennaware says,

We wanted to make an application which would make version control usable and, most-of-all, approachable to Mac users.

As John Gruber pointed out, they were brave enough to commercially release v1.0 without the requisite hype or beta Versions. And unlike many of the other Mac Subversion options, Cornerstone includes not only client functionality, but also the administrative tools, so you can perform various operations on the repository itself, not just your local working copy.

Oddly enough, many clients seem to only support a subset of even the client commands, so with many of the GUI frontends, you need to fall back to the command line to switch or relocate your working copy to a different repository, move files, etc.. Curious to see how complete Cornerstone is in this respect…

Now the question is, who will be first out of the blocks to support the new features in Subversion 1.5sparse checkouts, anyone?

Versions Emerge(s) From the Vapors

Nearly a year after the initial hype, Mac Subversion client Versions has finally seen the light of day with the release of a beta that at first glance offers little that other clients don’t.

The opening line of the beta announcement sheepishly concedes the app’s impending vaporware contender status:

Versions one year anniversary – celebrating with an actual app!

While the interface is certainly slick, it remains to be seen whether a Mac-like look and feel and a bit of Beanstalk integration are enough to win over those who’ve made do with the various alternatives thus far.

Despite the variety of cross-platform and Mac-specific Subversion clients available, with the exception of the somewhat orphaned SCPlugin, each oddly seems to assume developers need yet another app running alongside their work just to interact with a version control system, instead of just blending into the woodwork like the venerable TortoiseSVN.

Sometimes beauty in UI design is less about lickability than invisibility…

Clever Title Case Perl Script

John Gruber has released a clever Perl script that transforms selected text into title case (without simply capitalizing the first letter of each word as many so-called title case functions do).

The script uses a list of “small words” which are not capitalized based on guidelines from the New York Times Manual of Style.

It’s a Perl script, so save it as a text file and you can use it anywhere where Perl works. I use it as a system-wide service (with the shortcut Command-Shift-T) via Jesper’s excellent (and free) ThisService utility.

Thanks for a very useful addition to the writer’s toolbox!

oXygen 9.2 Improves DITA Support

Syncro Soft has released version 9.2 of its <oXygen/> XML Editor, a cross-platform XML authoring tool. The new version includes a new XML Author mode, which provides a streamlined interface tailored to the needs of writers who need to focus on document content and don’t need immediate access to the Schema Editor, XSLT or DTD development tools.

(XML Author is also available as a separate product at 60% of the cost of the full XML Editor suite, though the Author version doesn’t include the Subversion client, which is quite useful in its own right.)

Version 9.2 also includes a number of DITA-specific workflow and usability improvements such as a new DITA Maps Manager to assist with common map authoring tasks, a new Insert Content Reference dialog to aid in the selection of conref IDs, and a bundled version of the recently released DITA Open Toolkit version 1.4.2.1.

SnagIt for Free!

Over at Digital Inspiration, Amit Agarwal points out a great deal on the popular Windows screenshot tool SnagIt. TechSmith is currently offering version 7.2 for free download as a promotional deal intended to attract users to the latest version (which is 8.2 as of this post).

So if you don’t need all the bells & whistles the later versions include and are just looking for a screenshot workhorse to take you beyond ALT+PRINT (and don’t already own a copy of HyperSnap or a similar tool), follow Amit’s instructions for a free SnagIt license.

If you’re interested in screencasting tools for full motion recording, there’s a similar deal on Camtasia Studio.

For Mac OS X, check out Snapz Pro X, which does both still images and full motion capture.

CSS Redundancy Checker

Tom Armitage of Infovore has built a CSS Redundancy Checker that will scan a CSS file for selectors that are not used by any HTML files in a specified directory or URI.

The tool can come in handy when you’re maintaining legacy sites with countless selectors whose purpose is long forgotten.

The Ruby source files are hosted at Google Code and Mike Malone has put together an online version based on Tom’s code so you can run the tool without installing it locally.

HumaneText.service

Fans of John Gruber’s Markdown will appreciate HumaneText.service, a system-wide Mac OS X service that translates between markdown and XHTML with quick key-commands: Shift+Apple+{ and Shift+Apple+}. Simply beautiful!

If you haven’t heard of markdown, it’s a simple and elegant means of writing plain text that is highly readable “as is”, yet easily converted to HTML. As the author says:

The overriding design goal for Markdown’s formatting syntax is to make it as readable as possible. The idea is that a Markdown-formatted document should be publishable as-is, as plain text, without looking like it’s been marked up with tags or formatting instructions. While Markdown’s syntax has been influenced by several existing text-to-HTML filters, the single biggest source of inspiration for Markdown’s syntax is the format of plain text email.