1 # -*- coding: utf-8 -*-
3 # Author: Engelbert Gruber <grubert@users.sourceforge.net>
4 # Copyright: This module is put into the public domain.
7 mini-writer to test get_writer_class with local writer
11 from docutils
import nodes
, writers
, languages
15 import docutils
.utils
.roman
as roman
17 class Writer(writers
.Writer
):
19 supported
= ('dummy',)
20 """Formats this writer supports."""
23 """Final translated form of `document`."""
26 writers
.Writer
.__init
__(self
)
27 self
.translator_class
= Translator
30 visitor
= self
.translator_class(self
.document
)
31 self
.document
.walkabout(visitor
)
32 self
.output
= visitor
.astext()
34 class Translator(nodes
.NodeVisitor
):
35 def __init__(self
, document
):
36 nodes
.NodeVisitor
.__init
__(self
, document
)