[Refdb-devel] new-document and doc-processing menu behavior
Status: Beta
Brought to you by:
mhoenicka
From: Michael S. <sm...@xm...> - 2003-12-09 08:22:29
|
Hi Bruce, You wrote: > On Monday, December 8, 2003, at 10:07 AM, Michael Smith wrote: > > > 1. Add a "Create New Document..." menu item. > > > > Selecting that will fire up refdbnd (or some Emacs-based > > equivalent > > of that) and create the makefile for the document at the same > > time as the document is created. > > > > 2. Add a "Process Document" or "Generate Output" submenu, with "PDF", > > "HTML", "RTF" and "All" menu items. > > > > Selecting that will just call up the corresponding makefile for > > the > > document, and pass it the appropriate target name. > > With 2, could you then create the makefile if it didn't exist? Say you > have an existing document that wasn't created with the "Create New > Document" feature you outline: choose process document, and if there > was no makefile, user is prompted for the style file and it's created > and the transformation is run. Yeah, that's doable. Seems like that's the way it should work. Only alternative is to have Emacs just emit a "No makefile found" error with some kind of instructions about what to do in order to create the makefile (which of course would need to be something different than going to the Create New Document" menu), Come to think of it, I guess the flow for the case where a user hasn't specified a database should be similar: If no database has been set, the first time one is needed, users should be prompted for the name of one, and that will be used for all subsequent commands unless the user explicitly sets another db name. > > It seems like the "Process Document" submenu will either need to work > > from the assumption that there's only one document per directory, and > > it's associated with a file called "Makefile" in the same directory. Or > > it could work by looking for a file with the extension ".mk" and the > > same base name as the document in the current buffer. That'd allow you > > to have multiple documents in the same directory. > > I think I prefer the latter. OK. I guess this is also something that could be configurable. But I wonder a little why you'd need it, because from your description below, it seems that, in that directory, you've still got one logical document (dissent-book.xml) for which you want to generate an bibliography -- it's just broken up into separate physical files for each chapter. > Let me just tell you how my current project (a book) is set up: > > The source is all in one CVS-managed directory, called "dissent-book." > It looks like this: > > drwxr-xr-x 5 darcusb staff 170 Oct 2 17:41 CVS > -rw-r--r-- 1 darcusb staff 1362 Sep 2 20:23 dissent-book.xml > -rw-r--r-- 1 darcusb staff 516 Aug 17 15:44 > dissent-chapter1.xml > -rw-r--r-- 1 darcusb staff 15251 Oct 31 10:03 > dissent-chapter2.xml > -rw-r--r-- 1 darcusb staff 11756 Aug 18 16:33 > dissent-chapter2.xml‾ > -rw-r--r-- 1 darcusb staff 19622 Aug 17 15:44 > dissent-chapter3.xml > -rw-r--r-- 1 darcusb staff 91729 Aug 17 15:44 > dissent-chapter4.xml > -rw-r--r-- 1 darcusb staff 944 Aug 17 15:44 > dissent-chapter5.xml > -rw-r--r-- 1 darcusb staff 13229 Aug 17 15:44 > dissent-chapter6.xml > -rw-r--r-- 1 darcusb staff 1779 Aug 17 15:44 > dissent-chapter7.xml > drwxr-xr-x 5 darcusb staff 170 Sep 13 11:07 output > > The output directory is where I place the fo and pdf files and such. > > Here is the main file: > > <?xml version="1.0" encoding="utf-8"?> > <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" > > "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [ > <!ENTITY bibliography SYSTEM "dbxtest.bib.xml"> > <!ENTITY chapter1 SYSTEM "dissent-chapter1.xml"> > <!ENTITY chapter2 SYSTEM "dissent-chapter2.xml"> > <!ENTITY chapter3 SYSTEM "dissent-chapter3.xml"> > <!ENTITY chapter4 SYSTEM "dissent-chapter4.xml"> > <!ENTITY chapter5 SYSTEM "dissent-chapter5.xml"> > <!ENTITY chapter6 SYSTEM "dissent-chapter6.xml"> > <!ENTITY chapter7 SYSTEM "dissent-chapter7.xml"> > ]> > <book> > <bookinfo> > <author> > <firstname>Bruce</firstname> > <surname>D'Arcus</surname> > </author> > <affiliation> > <orgname>Miami University</orgname> > <orgdiv>Geography Department</orgdiv> > <address> > <street>216 Shideler Hall</street> > <city>Oxford</city> > <state>Ohio</state> > <country>USA</country> > <email>da...@mu...</email> > </address> > </affiliation> > <title>Boundaries of Dissent</title> > <subtitle>Protest and State Power in the Media Age</subtitle> > <copyright> > <year>2003</year> > <holder>Bruce D'Arcus</holder> > </copyright> > </bookinfo> > > &chapter1; > &chapter2; > &chapter3; > &chapter4; > &chapter5; > &chapter6; > &chapter7; > > &bibliography; > </book> > > Aside: how to do this without entities? Use XInclude's and have RefDB call xsltproc to process those? > Since the book is broken up into pieces, I often just run a > transformation on an individual chapter (apart from refdb). I don't > know that it is necessary for RefDB to be involved there, but it might > be helpful (say I send a draft chapter to someone). > > This may be tricky though... Would you also be generating a biblography for an individual chapter? If not, since it seems like a main purpose of going through the RefDB toolchain is to generate the bibliography, maybe processing of the individual chapters is out of scope for RefDB Emacs integration. Or to put it another way, if it's not something you'd use the RefDB toolchain to do from the command line, it seems like it's probably not something that needs to be in the Emacs integration. |