U å€C^ñã @s†dZdZddlZddlZddlZddlmZmZddlm Z Gdd„deƒZ Gdd „d e ƒZ d d d d d d dddd d ddœ Z dd„Z dS)z0 This package contains Docutils Writer modules. ZreStructuredTextéN)Ú languagesÚ Component)Ú universalc@sPeZdZdZdZdZdd„ZdZdZdZ dZ dd„Z d d „Z d d „Z d d„ZdS)Ú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)rÚget_transformsrZMessagesZFilterMessagesZStripClassesAndElements©Úself©r ú?/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_languageÚsettingsZ language_codeZreporterÚlanguageÚ destinationÚ translateÚwriteÚoutput)r rrrr r r r?s þz Writer.writecCs tdƒ‚dS)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ô