gws.spec.generator.configref¶
Generate the configuration reference in Markdown.
Source code: gws.spec.generator.configref
Module Contents¶
- gws.spec.generator.configref.as_category(s)¶
Format a category name.
- Parameters:
s – Category name.
- Returns:
Markdown text.
- gws.spec.generator.configref.as_code(s)¶
Format text as inline code.
- Parameters:
s – Text.
- Returns:
Markdown text.
- gws.spec.generator.configref.as_literal(s)¶
Format a value as a literal.
- Parameters:
s – Value, formatted as JSON.
- Returns:
Markdown text.
- gws.spec.generator.configref.as_propname(s)¶
Format the name of an optional property.
- Parameters:
s – Property name.
- Returns:
Markdown text.
- gws.spec.generator.configref.as_required(s)¶
Format the name of a required property.
- Parameters:
s – Property name.
- Returns:
Markdown text.
- gws.spec.generator.configref.as_typename(s)¶
Format a type name.
- Parameters:
s – Type name.
- Returns:
Markdown text.
- gws.spec.generator.configref.create(gen: gws.spec.generator.base.Generator, lang: str)¶
Create the configuration reference.
The reference starts with the application
Configand contains a section for each reachable class, type alias, enum and variant.- Parameters:
gen – Generator state, with strings already collected.
lang – Language code,
enorde.
- Returns:
The reference as Markdown text.
- gws.spec.generator.configref.DEFAULT_FORMAT = ' _{}:_ {}.'¶
- gws.spec.generator.configref.escape(s, quote=True)¶
Escape HTML special characters.
- Parameters:
s – Text.
quote – If True, escape double quotes as well.
- Returns:
The escaped text.
- gws.spec.generator.configref.first_line(s)¶
Get the first line of a text.
- Parameters:
s – Text or
None.- Returns:
The first line, stripped.
- gws.spec.generator.configref.header(cat, tid)¶
Format a section header.
- Parameters:
cat – Category, used in the CSS class of the header.
tid – Type uid, used as the header text and the anchor.
- Returns:
Markdown text.
- gws.spec.generator.configref.LABELS = 'added|deprecated|changed'¶
- gws.spec.generator.configref.link(target, text)¶
Format a link to the section of a type.
- Parameters:
target – Type uid.
text – Link text.
- Returns:
Markdown text.
- gws.spec.generator.configref.LIST_FORMAT = '<nobr>{}**[ ]**</nobr>'¶
- gws.spec.generator.configref.nl¶
- gws.spec.generator.configref.STRINGS¶
- gws.spec.generator.configref.subhead(category, text)¶
Format the text below a section header.
- Parameters:
category – Category name (not used).
text – Text.
- Returns:
Markdown text.
- gws.spec.generator.configref.table(heads, rows)¶
Format a Markdown table with padded columns.
- Parameters:
heads – Column headers.
rows – Table rows, lists of cell values.
- Returns:
Markdown text.