o !5p`@sdZdZddlZddlZddlmZddlZddlmZm Z ddl m Z Gddde Z Gd d d e Z id d d d dd ddddddddddddddddddddddddd d!d"d!d#d$d%Zd&d'ZdS)(z0 This package contains Docutils Writer modules. reStructuredTextN) import_module) languages Component) universalc@sXeZdZdZdZdZddZdZ dZ dZ 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. writerwriterscCst|tjtjtjgSN)rget_transformsrMessagesFilterMessagesStripClassesAndElementsselfr;/usr/lib/python3/dist-packages/docutils/writers/__init__.pyr "s zWriter.get_transformsNcCs i|_dSr )partsrrrr__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. ) documentr get_languagesettings language_codereporterlanguage destination translatewriteoutput)rrrrrrrr?s z Writer.writecCstd)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 method)NotImplementedErrorrrrrrRs zWriter.translatecCs,|j|jd<|jjj|jd<tj|jd<dS)zsb  T