Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Using CityDesk with a source control system

I'm developing a set of HTML templates for a web application, and I would like a way to check in individual CityDesk HTML files into a source control system.

I know that this is not exactly the use for which CityDesk is intended, but I find the variables feature very helpful in this case. I'm using CityDesk to manage about 150 html files. At the moment I'm planning on just handing over the published HTML files and letting the developers check those in - but then we won't be able to use CityDesk anymore and it will be a nightmare to keep the pages consistent.

Is it possible to do this, even with a script?

Jim Corban
Thursday, March 7, 2002

How about setting it up as a publish action?

For example:  Make a new publish location that publishes the files to c:\www.  The first time you do it, you need to publish then manually do a cvs add on all the files in \www but let's assume that c:\www now represents the cvs module with all the html files in it.  Now in the publish dialog, hit "Preview With" and choose "Configure Menu" from the drop down.  Add a new action named "Checkin" which is 'cvs commit c:\www' or you can make it a small batch script that does more complicated stuff.

Now getting all the html files into cvs just means doing this:
Hit Publish button.  Select Checkin from dropdown menu.

Don't forget to check in the .cty file every once in awhile or create a backup too.  Although you would be able to replicate your site with the files from CVS, you'd be missing your templates and all your cityscript without the .cty file.

Michael H. Pryor
Thursday, March 7, 2002

That just checks in the published HTML files into source control. We need a way for the developers to edit the 'CityDesk' HTML files with the variable names, like this (we're not using templates or articles):


We could check in the .cty file and let the developers use CityDesk to edit the files, but then you'd always have all 150 files checked out when you just need to edit one.

A bulk import / export feature would help. I could then have 150 text files that look like CityDesk HTML (with variables), and bulk load them into CityDesk when I need to publish them. If this feature were scriptable, we could incorporate it into our build system as well.

Is this too outside the bounds of what CityDesk is intended for?

Jim Corban
Thursday, March 7, 2002

There's a similar discussion floating around here. Perhaps TK linked to it:

<-- see Terry's Tips

You can copy your templates into .txt files, or another extention that doesn't get parsed, keep them in CityDesk and during your dump (publish to folder for CVS), all of your templates will go with it.

Yes Articles don't get copied w/o templates, and yes it's an extra step, but it works... sorta.

Like I mentioned earlier, CS-RCS is a nice little CVS program (which you don't have to install TCL for). It integrates with MS Office (you get an RCS menu with checkin/check out, retreive revisions, etc.). Now if CityDesk had that... text changes in an RCS/CVS tend to be miniscule, our CVS of several thousand HTML pages amounts to around 5 megabytes. Maybe a backup database so if something ever happens to your .cty file, you can retreive a recent version.

Mark W
Thursday, March 7, 2002

This may be it:

Thursday, March 7, 2002

Wait a sec...

If you are not using articles are templates, and all you are using is CityDesk to put a header/footer on each page... then you are probably using the wrong tool.  At the very least, you are not making use of CityDesks's power.

What you might look into is one of the following:

(A) Use DreamWeaver.  It has templates, making it easy to do a header/footer thing on every page.  Maximum control, you'll be happy.  You can use the library element for that too, at your option.

(B) Use Server Side Includes.  In fact, the header/footers I do on my site ( ) are done with SSI even though I have CityDesk variables at my disposal.

David Whatley
Thursday, March 7, 2002

It sounds like a simple Perl script would be able to do those sorts of substitutions for you. Why would you try to use CityDesk just to substitute text strings?

Darren Collins
Thursday, March 7, 2002

I'm not just putting headers & footers on each page, but I am only using CityDesk for string substitution. My team will probably switch over to articles and templates when SP1 (with real filenames) is ready.

If you need to publish files with specific filenames like I do, string substitution is all CityDesk is really good for. Not that that's a bad thing - it's cheap, and you don't have to know Perl.

Jim Corban
Thursday, March 7, 2002

Cheap!  Cheap you say!  Nononono... inexpensive... great value... but not cheap! <wink>

David Whatley
Friday, March 8, 2002

This page has a list of Perl templating systems you could use to get the same effect (maybe with even more functionality). You don't need to actually know Perl, just be able to run a Perl program on your platform of choice. They're all free, too, as far as I know.

Similar systems are available in Python, C++, etc, and I remember seeing a piece of Windows shareware written in VB or something that did the same sort of thing but with a nice GUI.

Then again, it sounds like you're going to use CityDesk for more than just variable substitution from Friday next week :-).

Darren Collins
Friday, March 8, 2002

Oops, forgot to paste the link!

Darren Collins
Friday, March 8, 2002

I'd like it if we could choose whether to save a CityDesk site as one big file or as a tree of files in a directory.

I could then use CVS to track changes in articles, templates, etc. 

In other words, I need more granularity in the files!

Timothy Falconer
Monday, March 18, 2002

*  Recent Topics

*  Fog Creek Home