[Scribus] Docbook XML import

Craig Ringer craig
Tue Apr 5 04:40:53 CEST 2005


On Tue, 2005-04-05 at 00:54 +0000, Riku Leino wrote:

> There's a new file format coming for 1.3.x at some point and for that we will 
> need to write a new file loader for what I've planned to write a universal 
> easy to use api to build custom file importers as well (will also include an 
> exporter api). This is pretty much the next step from the Get Text 
> implementation that is already in use but will extend the behaviour to page 
> creation, object placement and all that is involved in creating a document.

... and hopefully as part of the core code, so I can do some wrappers to
expose it to Python without too much pain. Now that could be rather
handy indeed, especially if it exposed some sort of text and font
metrics.

> Currently the best way would probably be exactly this until the new file 
> loader api is available. To make it fully automatic one will need to create 
> text frames needed  and then use all those gt* classes to do the formatted 
> text importing. This is best implemented with a custom made c++ plugin. I'm 
> not sure how up there the scripter is for that. You'll need to wait for an 
> answer from the scripter guys.

Paragraph style creation in the scripter isn't written yet - it's been
on my TODO list for so long it's embarrassing (I _did_ say I'd do
it...).

You can, however, import paragraph styles from another document that you
use as a template, so if you have a reasonably stable set of styles you
could probably do a pretty good job of scripting your layout from
DocBook XML. The main limitations you're likely to face are the lack of
text metrics ("how wide would this text be at this font", etc) and
inability to create paragraph styles from Python.

The gettext interface will most likely be much easier for styled text
import, while using Python would let you do image placement etc too.
Neither is perfect for your needs I suspect, but both should be
improving over time. I'd *really* like to get text metrics and para
style creation into scripter some time. I'm also hoping it'll be
possible to call the gettext API from Python and/or call out to gettext
plugins in future. That's not something I'll be able to tackle any time
soon I suspect, as I'm swamped with uni and work, and I don't think
anybody else has plans to work on any of those points.

If you decide to go the Python route, I'd be happy to help out in
whatever small ways I can.

-- 
Craig Ringer





More information about the scribus mailing list