Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Turn a CityDesk site into a book?

I want to turn this site: into a book.  It's a memoir that I think the author's family will want to keep for a long time.  I'm wary of the long term future of any personal website.  It needs to be on paper.  Nothing fancy, just a bound volume of some sort that I could produce at Kinkos.

CityScripts will make it very easy to produce the contents of the book so  I keep thinking it should be easy.

I'm looking for advice or references about how to get the content from CityDesk into a traditional publishing format.  I'm not thinking about PDF but a  format from which I can build a table of contents with page numbers, and perhaps an index.

Once I figure this out, I have yet another memoir site I'd like to print.

Can I do this?

Wednesday, February 26, 2003

One thing you can do right away, is to burn the site to CDs and distribute it to Mac's family. At least then, if your site goes away, they have a copy.

As for publishing in a book, that's a bit tricky. You might be able to create a template that publishes to some sort of PDF or XML file, but I've got a feeling that it won't be possible with the current version of CityDesk.

I'd start by creating a single article on your site that publishes every other article, in an appropriate order, in a single huge HTML page. For each article, bring in the Headline as a <H1> element, and the body beneath it. You should then be able to load this huge page into Word, and create a table of contents based upon the <H1> elements. Then zip through and insert page breaks and tidy it up a bit.

It's very manual, but it sounds like you'd only be doing this once.

Hope this helps. If you find a better way, please let us know!

Darren Collins
Wednesday, February 26, 2003

First, some background.  I own a web site named  One of our writers had written well over a hundred articles profiling communities in southern New Mexico and wanted to create a Print on Demand (POD) book.  She was going to paste all the HTML pages into Word, one by one. 

Here's what I did.  The POD publishers, I think she is going with either or, wanted the book in MS Word format.  I created a "Book" article that assembled the articles in roughly the order she wanted.  I published the HTML, opened it in Word, inserted page breaks after each article, changed the margins and gave her the Word file.  She said it did about half her work for her.

A better way would probably be the way Joel mentioned in a post to the discussion board (perhaps you will have a better time finding it than I did, especially given your nice archive).  The discussion was about printing to PDF from MS Word, but it is applicable since MS Word is what the POD printers want.  I think Joel said he did the formatting in MS Word, complete with the CityDesk scripting directly in the Word file.  He then saved the file from MS Word to its funky HTML format which preserves formatting, imported the HTML file into CityDesk, published and opened the file in MS Word.  Here's where he printed to PDF but you could save to MS Word .doc format and, if you did a good job of formatting would not have to put in the page breaks as I did.  You might be able to figure out how to embed some CityDesk scripting in the MS Word TOC and Index generation tool stuff--maybe, probably harder than just manually doing it one time.

You can build a TOC and the beginnings of an index, but I don't know about the page numbers.  You might be able to do some fancy foreachs over keyword_contains in conjunction with javascript counters on the page breaks to generate the beginning of the Table of Contents and Index with the printed page number.  But it might be easier just to build the start of the TOC and do the remaining work by hand in MS Word.

Images are another problem.  Though 72dpi web images will print sort of okay for person use, You will probably want at least 300dpi grayscale (maybe with halftone screens?) for the book.

Note: The use of the .breakafter{page-break-after: always} CSS stylesheet instruction was a holdover of something else I have been doing.  If you put these in where you want page breaks, Internet Explorer with break the pages there when printing (handy for automatically generating Real Estate Brochures from a Real Estate web site or generating a PDF by printing from IE to Adobe Distiller).  I was hoping that MS Word would change the HTML page breaks into MS Word page breaks, but it did not.

Here's the Details:

Assembling the Articles into a Book (in the Book article)
<DIV class=book_headline>Southeastern New Mexico</DIV>
<DIV class=breakafter>&nbsp;</DIV>
{$ foreach article in (and(author "Phyllis Eileen Banks") (keyword_contains "profile") (keyword_contains "southeast")) SortAscendBy .headline $}
<DIV class=book_headline>{$ article.headline $}</DIV>
<DIV class=book_body>{$ article.body $}</DIV>
<DIV class=breakafter>&nbsp;</DIV>
{$ next $}
<DIV class=book_headline>Southwestern New Mexico</DIV>
<DIV class=breakafter>&nbsp;</DIV>
{$ foreach article in (and (author "Phyllis Eileen Banks") (keyword_contains "profile") (keyword_contains "southwest")) SortAscendBy .headline $}
<DIV class=book_headline>{$ article.headline $}</DIV>
<DIV class=book_body>{$ article.body $}</DIV>
<DIV class=breakafter>&nbsp;</DIV>
{$ next $}

Book template
<link href="PTMFOG0000000014.css" rel="stylesheet" type="text/css">
{$ .body $}

.breakafter{page-break-after: always}
.book_headline { FONT-FAMILY:  Garamond, serif; font-size: 18pt; font-weight: bold; font-style: italic;}
.book_body { FONT-FAMILY:  Book Antiqua, serif; font-size: l2pt; BACKGROUND-COLOR: white}

Setting MS Word Margins for a 5.5 x 8.5 book
Top: .75", Bottom: 1", Left: .63", Right: .63", Gutter: 0", Header: .5", Footer: .35", Mirror margins.  Something like ClickBook might help if you are printing and binding just a few copies. 

David Burch
Wednesday, February 26, 2003

David, thanks. Here is Joel's forum thing about PDF and Word:

Wednesday, February 26, 2003

If you set the mime type to application/msword you end up opening the page in Word (instead of a browser).  You might want to publish the whole site to one large word doc.  Or maybe a bunch or word docs that you then combine.

Then you can use word to build the TOC.  If you use H1-h6 in a meaningful way, they will be properly handled in the TOC.

joel Goldstick
Thursday, February 27, 2003

I don't know about table-of-contents being automatically populated for you w/ page numbers, but you should be able to copy/paste from IE or CityDesk into Word and preserve the formatting.

From Word it's just a matter of having the right software to do the PDF thing.
Thursday, February 27, 2003

I create the web site in citydesk in order to force myself to write regularly and create a book.  I published the book with iUniverse (a great "print on demand" facility) and it's now available on amazon, b&n etc. 

Although other people have highlighted an automated approach, I actually did it manually since I picked only the best articles and was selective about the graphics etc.

If you want to check out the book, there's info at


Friday, February 28, 2003

Great site Zack.  Did you do the typesetting for the book in Word and deliver a Word file, a PDF file or some other format to iUniverse?

David Burch
Friday, February 28, 2003

Basically, you deliver a somewhat unformatted word file to iUniverse along with images and they do all the formatting for you in China.  They apply a pretty standard template, but I made some tweaks to accomodate the images, different font for headers etc.  Comes out pretty good and is of equivalent quality of any other trade paperback book you might find in Borders.

There's a link on my "site info" page


Tuesday, March 4, 2003

*  Recent Topics

*  Fog Creek Home