How to handle custom output types?
Michael Smith <[email protected]>
| Newsgroups | gmane.text.refdb.devel |
|---|---|
| Message-ID | <20031211012857.GD1696@theThirdPoliceman> |
Bruce D'Arcus <[email protected]> writes: > On Dec 9, 2003, at 3:22 AM, Michael Smith wrote: > > >>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), > > Maybe the solution should also be suitable for changing output styles > too? So then perhaps the new doc thing shouldn't specify and output > style and create a makefile? I guess I'm pretty much in agreement with Markus about the value of keeping everything makefile-driven. Whatever ends up on the menu will just be a front-end to the command-line toolchain. So, if it's something that's doable from the command line -- in this case, doable by passing different target names and variables to 'make' -- then it's something I can probably have the menu code do also. But if it's not something you can currently do from the RefDB command-line toolchain, then I'm reluctant to add it. But note that it is possible to have the menu code do stuff that would take multiple steps from the command. For example, what the "Select Database" does is eliminate the 'listdb' step you'd otherwise need to do to see the list of available databases in order to know which name to feed to the selectdb command. That's probably not the best example (since, realistically, you probably already know the name of the db you want to use), but you get the idea. > Let's see: > > As with the database menu, styles are drawn from refdb. When one needs > to process the document but no style is selected, go to the style, > choose the output option, and the makefile is created, and run with the > appropriate option. > > If later the user needs to change output styles, it involves the same > process: a simple menu click. > > Menu structure might be: > > - Process Document > - Style 1 > - all > - html > - pdf > - xhtml > - Style 2 > - all > - html > - pdf > - xhtml Well, I think I really don't want to put style names into the menu -- even if the list of styles is made customizable/extensible. I think it'd be best just to handle it through Emacs completion. > I'd like output to be customizable. For example, I sent Bob S. some > stylesheet customizations that use (x)html + css to fool MS Word into > thinking it is importing a native doc file. It would be nice, then, > for me to be able to customize RefDB and its menu so I could have a "MS > Word" output option. That sounds great. But I don't have a very clear idea at all how you could generate a custom output type using the current RefDB toolchain. Can you describe the steps you're using to generate this output type now ("fake" Word or whatever you call it)? Are you called refdbxml? Or are you calling xsltproc or whatever directly? If so, how are you generating the bibliography for it? Getting back to the menut, it would be hard to make handle this from the menu unless you had already created a Makefile for it that had an additional target in it for your custom output type. What I could do, I think, is an additional "Other Output Type..." menu item to the "Generate Output" menu, so it'd look like this: Generate Output HTML PDF RTF Other Output Type... If you select "Other Output Type", Emacs then prompts you for the name of the output type, which would need to be a custom target you've added to your Makefile, and would need to be formatted exactly as it appears in the Makekfile -- so "doc" or whatever you call the target. hmm, but looking at the toolchain now, I see that it seems like the transform scripts (refdbxml and refdbjade) would also need to be made aware of the stylesheet for your custom output type... Unless I'm missing something, it's starting to look to me like it'd be difficult to generate a custom output type using the current RefDB toolchain. It'll help me if you can explain how you're doing it now. As far as this specific case goes, it seems to me like your "MS Word" output type is something that ulimately maybe should be added to the "standard" RefDB set of supported output types. I think that'd amount to getting your stylesheet into the standard RefDB distro, and adjusting the makefile template and maybe adjusting refdbxml. --Mike
signature.asc
(application/pgp-signature, 155 B)
-----BEGIN PGP SIGNATURE----- iD8DBQE/18hYsGCNMsnBsxkRAqivAKCFkUk+eXOsmPW+Te2Vnet3NwGfAACfVc7D D5H/n6W5XADfxe8UkvBkzqM= =jZ8M -----END PGP SIGNATURE-----