You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@jenshalm, I was wondering if there was any appetite for accepting a patch for a plain-text renderer:
```class PlainText extends RendererFactory[TextWriter]`?
The use case I have for such a renderer is to be able to use markup in the description and usage messages for options in an option parser (command line parser) library. The plain-text rendered output would go to the terminal, so I am also considering optionally having ANSI terminal codes to be used for some of the elements. Since the various option help and usage messages are in Markup, we can then also render the command line usage messages in HTML for displaying on a documentation site, or in PDF for distribution elsewhere.
I was thinking of starting from the render.HTML class and the associated test class and adapt it until it produces plain-text.
What do folks think of this idea?
The text was updated successfully, but these errors were encountered:
Sorry for the late response, I somehow overlooked this issue. I think rendering terminal text is maybe a bit of an edge case, but if it is a feature-complete implementation with a full test case I would accept it.
In case you are still planning on doing this, here are a few suggestions:
If it includes terminal codes, maybe a name like TerminalText for the renderer would be a better fit than just PlainText?
You might also need to create a custom writer TerminalTextWriter as a subclass of TextWriter. The reason is that Laika is extensible and users can override the rendering per node type. The renderer you provide just contains the defaults. This means that if you hide all convenient helpers in the renderer, they are not available for the user, as it is the Writer API that they use for overriding rendering for a node. See http://planet42.github.io/Laika/customizing-laika/customize-rendering.html for examples.
@jenshalm, I was wondering if there was any appetite for accepting a patch for a plain-text renderer:
```class PlainText extends RendererFactory[TextWriter]`?
The use case I have for such a renderer is to be able to use markup in the description and usage messages for options in an option parser (command line parser) library. The plain-text rendered output would go to the terminal, so I am also considering optionally having ANSI terminal codes to be used for some of the elements. Since the various option help and usage messages are in Markup, we can then also render the command line usage messages in HTML for displaying on a documentation site, or in PDF for distribution elsewhere.
I was thinking of starting from the
render.HTML
class and the associated test class and adapt it until it produces plain-text.What do folks think of this idea?
The text was updated successfully, but these errors were encountered: