Class XMQTheme
java.lang.Object
org.libxmq.imp.XMQTheme
XMQTheme
The theme struct is used to prefix/postfix ANSI/HTML/TEX strings for
XMQ tokens to colorize the printed xmq output.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetStringsFor(XMQColor color) Returns the pre/post color strings for the given color token, or null if no string is installed for that token.booleaninstallTheme(String spec) Mirrors C installTheme: installs the default colors, then the theme spec, which is one or two (comma separated) themes.voidsetupHtmlColoring(boolean render_raw, int bg, String use_id, String use_class) Configures this theme forrender-html.voidsetupTerminalColoring(boolean dark_mode, boolean use_color, boolean truecolor) Mirrors C setup_terminal_coloring: ansi colors without post strings, the active color is replayed after a nested color.voidsetupTexColoring(boolean dark_mode, boolean render_raw) Mirrors C setup_tex_coloring.
-
Constructor Details
-
XMQTheme
public XMQTheme()Creates an empty theme.
-
-
Method Details
-
getStringsFor
Returns the pre/post color strings for the given color token, or null if no string is installed for that token. Mirrors the CgetThemeStrings.- Parameters:
color- The token color.- Returns:
- The pre/post strings, or null if not set.
-
setupHtmlColoring
Configures this theme forrender-html. Mirrors the Csetup_html_coloring: the token color strings are set for both the styled and the raw (--nostyle) render, and the document/stylesheet scaffolding is only added when not raw.- Parameters:
render_raw- If true (the--nostyleoption), only wrap the content in a single<pre>element without a full document.bg- 0 = follow the browser preference (class xmq_auto), 1 = forced dark (class xmq_dark), 2 = forced light (class xmq_light).use_id- The id of the pre element (--id=), or null.use_class- An extra class of the pre element (--class=), or null.
-
installTheme
Mirrors C installTheme: installs the default colors, then the theme spec, which is one or two (comma separated) themes.- Parameters:
spec- The theme spec, eg from --theme= or XMQ_THEME.- Returns:
- True if the spec was understood.
-
setupTerminalColoring
public void setupTerminalColoring(boolean dark_mode, boolean use_color, boolean truecolor) Mirrors C setup_terminal_coloring: ansi colors without post strings, the active color is replayed after a nested color.- Parameters:
dark_mode- Use the dark background colors.use_color- If false, no colors are installed.truecolor- Generate 24 bit colors instead of the 256 color palette.
-
setupTexColoring
public void setupTexColoring(boolean dark_mode, boolean render_raw) Mirrors C setup_tex_coloring.- Parameters:
dark_mode- Use the bold/underline settings of the dark background colors.render_raw- If true (--nostyle), only print the content without a document.
-