A couple of posts back I agonized about how PPQT should relate to the new, competing markup styles. Today I figured out how to handle this.
The recommended and expected workflow will be that the PPer first brings the text to a state of completion with respect to the DP formatting guidelines. Heal all page breaks, fix all typos, deal with all proofer notes, move and renumber footnotes, process all gutcheck/bookloupe diagnostics. Delete all page separator lines. Also, use a new dialog to set metadata for the book: title string, author string at least.
At this point the PPer will choose File>Generate... and get a dialog with a menu of possible "translators", each able to translate a DP text into some other markup. From the user's point of view, now something magical happens: after a moment of high CPU usage, a new book appears. Its filename is "Untitled-n" (same File>New makes) and its contents are the translated text of the starting book. The user then uses File > Save As to save it under some appropriate name and suffix.
The magic that happens under the covers is this. Code that I will write parses the input text, extracting all possible information out of the DP markup conventions. Using a simple and rather elegant API that I have in mind, it will pass these data to the chosen translator. This API will make it so stupidly simple to generate a translated document that anybody could write one.
I will write a plain-text translator and an HTML translator. These can be used as models. Anybody else who wants to write a translator is welcome to do so and to issue a pull request. A translator for fp; a translator for fpgen; a translator for XML; a translator for Markdown or reStructured text or whatever, I don't care, let a thousand goddam flowers bloom.
Holidays
In a couple of days we are off for a month in Scandinavia: Copenhagen, Bergen, Trondheim, Stockholm. In the unlikely event that any reader of this blog wants to follow our very mild adventures, you can do so in our Scandinavian travel blog.
Posting in this blog will resume in August. See you then.
No comments:
Post a Comment