6 Struct N_GUI_MD_STYLE
gullradriel edited this page 2026-10-29 20:54:40 +01:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

N_GUI_MD_STYLE

Colours and metrics. More...

#include "n_gui_md.h"

Public Attributes

Name
ALLEGRO_COLOR text
body text
ALLEGRO_COLOR rule
the rule under a heading and under a table's header row
ALLEGRO_COLOR quote
a blockquote's text, and its bar
unsigned parse_flags
n_markdown parse flags.
ALLEGRO_COLOR link
link text
float indent
how far a quote, a list item's text and a code block are indented
ALLEGRO_COLOR heading
heading text
int hard_breaks
Non-zero to break a paragraph where its source breaks, which is what a chat message wants: somebody pressed Return there and meant it.
float col_min
narrowest a table column may be squeezed to, in pixels
ALLEGRO_COLOR code_bg
the panel behind a fenced code block, and behind inline code
ALLEGRO_COLOR code
[code]() and code block text
float cell_pad
padding inside a table cell, left and right
float block_gap
vertical space between two blocks, in pixels

Detailed Description

struct N_GUI_MD_STYLE;

Colours and metrics.

n_gui_md_style_default() fills one from a text and a background colour; a caller with a palette of its own should set the fields it cares about afterwards.

Public Attributes Documentation

variable text

ALLEGRO_COLOR text;

body text

variable rule

ALLEGRO_COLOR rule;

the rule under a heading and under a table's header row

variable quote

ALLEGRO_COLOR quote;

a blockquote's text, and its bar

variable parse_flags

unsigned parse_flags;

n_markdown parse flags.

N_MARKDOWN_ALL is what a document wants; zero is the safe chat subset, with a heading line and a table row left as the text they are.

ALLEGRO_COLOR link;

link text

variable indent

float indent;

how far a quote, a list item's text and a code block are indented

variable heading

ALLEGRO_COLOR heading;

heading text

variable hard_breaks

int hard_breaks;

Non-zero to break a paragraph where its source breaks, which is what a chat message wants: somebody pressed Return there and meant it.

Zero reflows the paragraph to the width it is given and treats a single newline as a space, which is what Markdown says and what a document wants – a manual is hard-wrapped at some column by whoever wrote it, and honouring that column in a pane of a different width breaks every paragraph in the wrong places. A fenced code block keeps its own line breaks either way.

variable col_min

float col_min;

narrowest a table column may be squeezed to, in pixels

variable code_bg

ALLEGRO_COLOR code_bg;

the panel behind a fenced code block, and behind inline code

variable code

ALLEGRO_COLOR code;

[code]() and code block text

variable cell_pad

float cell_pad;

padding inside a table cell, left and right

variable block_gap

float block_gap;

vertical space between two blocks, in pixels