Preparing documents for Braille printing - Announcing Transcribo: a plain text renderer for Docutils

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

looking for a cross-platform, open-source software preparing structured
documents for Braille printing, I finally decided to start my own project
named Transcribo. It is hosted on http://transcribo.berlios.de/. It is
written in the Python programming language and builds on Docutils
(http://docutils.sourceforge.net). Docutils parses text written in a
light-weight, easy-to-learn, extensible mark-up language called
reStructuredText (rst). While rst has many features that make it suitable
for writing technical documentation, it is general enough to allow authoring
any kind of structured document. The simplicity and power of
reStructuredText make it suitable for authoring large documents for Braille
printing as well. One objective of Transcribo is to distinguish different
content types in a single document and associate dedicated translators with
these. Hence, Transcribo easily integrates with third-party software for
contracted Braille (see e.g. http://yabt.berlios.de).

 Transcribo consists of two parts:
- first, a general purpose plain text renderer that is based on frames to
handle the layout, and ContentManagers responsible for translations, text
wrapping etc.
 - second, a writer component for Docutils called rst2txt. It provides the
bridge between the Docutils raw output and the renderer.

The output of rst2txt is customizable through styles. All this is very
much pre-alpha, even if the demo scripts show that nested lists and
enumerations can already be rendered.

I believe that Transcribo's planned features could make it a very powerful
authoring solution for Braille printing. Apart from the Docutils - rst2txt -
renderer tool chain, other input formats such as odf, rtf etc. are
conceivable if a good soul wrote suitable frontends for the renderer.
Clearly, all this requires really really a lot of work which I can hardly do
alone due to many other commitments.

See a more detailed description including all the links below. Any
feedback and help is warmly welcomed. Feel free to join the mailing list.
The source code can be obtained by checking out the Mercurial repository.

Regards

Leo




Transcribo - a plain text rendering library written in Python
=================================================================

Project home: http://transcribo.berlios.de/

Mercurial repository: http://hg.berlios.de/repos/transcribo/

Mailing-List: transcribo-dev@xxxxxxxxxx

Version: 0.1 (experimental)

Author: Dr. Leo <dr-leo@xxxxxxxxxxxxxxxx>

License: GPL (http://www.opensource.org/licenses/gpl-license.html)

(c) 2009 Dr. leo




1. Introduction
=================

Transcribo is a pure Python library to render input from various
sources as plain unicode text. It currently
consists of two subpackages:

1.1 rst2txt
--------------

In combination with the renderer, this will be a Writer component for
Docutils (http://docutils.sourceforge.net/).
Once finished, it will allow to render
reStructuredText files as plain text. At the same time it demonstrates
how the renderer (see below) can be
used. rst2txt roughly maps the nodes of the Docutils doctree to Frame
instances that form a fram tree. However, the frame tree
has a somewhat different structure than the docutils doc tree as frames do
not
necessarily reflect the document structure. E.g., sections are not
rendered as parent frames of the section content,
but at the same level.

The rst2txt package is heavily under construction. Currently, the following
node types are supported:

document, title, section, paragraph, text, bullet_list,
enumerated_list, list_item


1.2 The renderer
-------------------------

The renderer is the core of Transcribo. It is premised on an almost
complete abstraction of layout and content.

*   The key concept to achieve simple yet
    powerful layout capabilities is the Frame class. Each Frame
instance represents a
    rectangular area within the final output. Its position and size
are determined dynamically
    relative to other frames during the rendering process. Frames can be
nested.
    The RootFrame instance controls the rendering process and assembles the
line
    snippets rendered by each frame to form complete text lines. This allows
    things like multiple columns, nested enumerations etc. In future
versions,
    the RootFrame will also control pagination features.

*   Content: Leafs of the tree of Frame instances store the actual
content within a
    content.ContentManager instance which, in turn, may store various
content elements such as
    text, mathematical expressions, MusicXML etc. Currently, only
GenericText is supported.
    More precisely, each leaf Frame must have a ContentManager
instance which controls the
    rendering of the content it contains. Each content element is
rendered separately.
    A special feature is the possibility to attach a translator instance to
each
    content object as well as to the ContentManager. This feature is
required,
    in particular, for Braille translation. The ContentManager is also
responsible
    for wrapping and hyphenating the content, if required.

All aforementioned features are highly configurable through
dictionaries passed to the
constructors.


2. the Frame API
======================

(to be completed; meanwhile please see the documented sources and the
test.py script)


3. The ContentManager API
==============================

(to be completed; meanwhile please see the documented sources and the
test.py script)



4. Testing
==============

The test subdirectory contains two test scripts that should work out of the
box:

* test.py: demonstrates the renderer API by rendering a nested enumeration.
* rst2txt.py is a command line tool. A demo text file shows some of
the features of the rst2txt writer.



5. Contributing
==================

Development is in an early stage. Any help is very much appreciated.
Feel free to join the mailing
list, check out the Mercurial repository and start coding,

_______________________________________________
Blinux-develop mailing list
Blinux-develop@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/blinux-develop

[Index of Archives]     [Linux for the Blind]     [Fedora]     [Kernel List]     [Red Hat Install]     [Red Hat Watch List]     [Red Hat Development]     [Gimp]     [Yosemite News]     [Big List of Linux Books]