Renderer is the rendering interface. This is mostly of interest if you are implementing a new rendering format. Only an HTML implementation is provided in this repository, see the README for external implementations.
| 141 | // Only an HTML implementation is provided in this repository, see the README |
| 142 | // for external implementations. |
| 143 | type Renderer interface { |
| 144 | // RenderNode is the main rendering method. It will be called once for |
| 145 | // every leaf node and twice for every non-leaf node (first with |
| 146 | // entering=true, then with entering=false). The method should write its |
| 147 | // rendition of the node to the supplied writer w. |
| 148 | RenderNode(w io.Writer, node *Node, entering bool) WalkStatus |
| 149 | |
| 150 | // RenderHeader is a method that allows the renderer to produce some |
| 151 | // content preceding the main body of the output document. The header is |
| 152 | // understood in the broad sense here. For example, the default HTML |
| 153 | // renderer will write not only the HTML document preamble, but also the |
| 154 | // table of contents if it was requested. |
| 155 | // |
| 156 | // The method will be passed an entire document tree, in case a particular |
| 157 | // implementation needs to inspect it to produce output. |
| 158 | // |
| 159 | // The output should be written to the supplied writer w. If your |
| 160 | // implementation has no header to write, supply an empty implementation. |
| 161 | RenderHeader(w io.Writer, ast *Node) |
| 162 | |
| 163 | // RenderFooter is a symmetric counterpart of RenderHeader. |
| 164 | RenderFooter(w io.Writer, ast *Node) |
| 165 | } |
| 166 | |
| 167 | // Callback functions for inline parsing. One such function is defined |
| 168 | // for each character that triggers a response when parsing inline data. |
no outgoing calls
no test coverage detected
searching dependent graphs…