B \: @sdZdZddlZddlZddlZddlmZmZddlm Z ej dkrRddl m Z Gdd d eZ Gd d d e Zd d d ddddddd d dd ZddZdS)z0 This package contains Docutils Writer modules. ZreStructuredTextN) languages Component) universal)) __import__c@sPeZdZdZdZdZddZdZdZdZ dZ ddZ d d Z d d Z d dZdS)Writera Abstract base class for docutils Writers. Each writer module or package must export a subclass also called 'Writer'. Each writer must support all standard node types listed in `docutils.nodes.node_class_names`. The `write()` method is the main entry point. writerZwriterscCst|tjtjtjgS)N)rget_transformsrZMessagesZFilterMessagesZStripClassesAndElements)selfr =/tmp/pip-build-uw_ogi45/docutils/docutils/writers/__init__.pyr $szWriter.get_transformsNcCs i|_dS)N)parts)r r r r __init__8szWriter.__init__cCs:||_t|jj|j|_||_||j |j }|S)a/ Process a document into its final form. Translate `document` (a Docutils document tree) into the Writer's native format, and write it out to its `destination` (a `docutils.io.Output` subclass object). Normally not overridden or extended in subclasses. ) documentrZ get_languagesettingsZ language_codeZreporterlanguage destination translatewriteoutput)r rrrr r r rAs  z Writer.writecCs tddS)a Do final translation of `self.document` into `self.output`. Called from `write`. Override in subclasses. Usually done with a `docutils.nodes.NodeVisitor` subclass, in combination with a call to `docutils.nodes.Node.walk()` or `docutils.nodes.Node.walkabout()`. The ``NodeVisitor`` subclass must support all standard elements (listed in `docutils.nodes.node_class_names`) and possibly non-standard elements used by the current Reader as well. z"subclass must override this methodN)NotImplementedError)r r r r rTs zWriter.translatecCs,|j|jd<|jjj|jd<tj|jd<dS)zs.   T