in reply to Re^2: noveling and software design
in thread noveling and software design

How far have I gotten? Well, it's about half-way done. :-)

Actually I have the basic framework laid out in ztkdb. Go there and look at the screenshot. You can see the leftframe, the tabbed notebook, and the db access already to go. You could use that right now, by setting up a graphic thumbnail for each chapter, and assigning more tabs in the configuration file. You would have a chapter-scene layout.

But I havn't yet worked out the best way to store things in a db for a novel yet, so they can be retreived either by character, chapter or scene. But it will come to me. That ztkdb program is a graphical frontend to dbm, and if you play with it's configuration file, you can set it up for just about anything you want. But of course, it could be "optimized" to handle novel text entries. Feel free to take it and run with it. Here is a sample of what the configuration file might look like ( you can probably remove the sql search fields, but experiment first):

..snip..... ###################################################################### $user = 'zentara'; #database user name for Pg or M +ySql $password = 'foobar'; #db user password $db = 'SQLite'; #or 'Pg' or 'mysql' #select db #$db = 'Pg'; ################################################################### ####these are the catagories for your text tabs#### 8 allowed $texttab1='Intro'; $texttab2='First Act'; $texttab3='Second Act'; $texttab4='Third Act'; $texttab5='Fourth Act'; $texttab6='Fifth Act'; $texttab7='Sixth Act'; $texttab8='Finish'; ## run the color script for names of colors ### colors for the text tabs, do not choose ### dark colors or it will mask text ### these defaults are nice $tabcolor1='bisque'; $tabcolor2='lightyellow'; $tabcolor3='azure'; $tabcolor4='PeachPuff'; $tabcolor5='pink'; $tabcolor6='OldLace'; $tabcolor7='wheat1'; $tabcolor8='khaki'; ################################################################# ...snip....

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^4: noveling and software design
by revdiablo (Prior) on Nov 03, 2004 at 22:37 UTC

    Slightly off-topic reply, but those $texttab and $tabcolor variables are screaming to be turned into an array. I can hear them from here, "please, please, turn us into an array!"

    My rule of thumb: nearly any time you have a bunch of variables with the same prefix, they should be put into either a hash or an array. In your case, the only difference between each variable name is a number, which strongly indicates an array.

    Update: looking more closely, it even seems those two sets of variables are related to eachother, which makes their screams even louder. Here's what I would do for something like that:

    @tabs = ( { text => 'Intro', color => 'bisque' }, { text => 'First Act', color => 'lightyellow' }, { text => 'Second Act', color => 'azure' }, { text => 'Third Act', color => 'PeachPuff' }, { text => 'Fourth Act', color => 'pink' }, { text => 'Fifth Act', color => 'OldLace' }, { text => 'Sixth Act', color => 'wheat1' }, { text => 'Finish', color => 'khaki' }, );