B 0` @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|tjtjtjgS)N)rget_transformsrZMessagesZFilterMessagesZStripClassesAndElements)selfr t/private/var/folders/sf/wxz_36012wxg_prv29r6623x5vlqx8/T/pip-target-tft40_m7/lib/python/docutils/writers/__init__.pyr"szWriter.get_transformsNcCs i|_dS)N)parts)rr 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)rr rrr 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)NotImplementedError)rr r r rRs zWriter.translatecCs,|j|jd<|jjj|jd<tj|jd<dS)zs* T