U C^ @sdZdZddlZddlZddlZddlmZmZddlm Z GdddeZ Gdd d e Z d d d d d d dddd d dd Z ddZ dS)z0 This package contains Docutils Writer modules. ZreStructuredTextN) languages Component) universalc@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|tjtjtjgSN)rget_transformsrZMessagesZFilterMessagesZStripClassesAndElementsselfr ?/tmp/pip-install-6_kvzl1k/docutils/docutils/writers/__init__.pyr"s zWriter.get_transformsNcCs i|_dSr)partsr r r r __init__6szWriter.__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 r?s 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)NotImplementedErrorr r r r rRs zWriter.translatecCs,|j|jd<|jjj|jd<tj|jd<dS)zs, T