raesl.doc.lines#

Module to generate text lines that describe ESL objects.

Module Contents#

Classes#

Hookspecs

Functions#

hs(h)

Get header pound (#) signs.

header(→ str)

Get a header with surrounding whitespace and optional capitalization.

boldhead(→ str)

Get a bold header (without numbering) with surrounding whitespace.

emph(→ str)

Return text as emphasized (Markdown or html).

cap(→ str)

Capitalize first char of text.

bold(→ str)

Return text as bold (markdown or html).

snt(→ str)

Text to a sentence. Capitalizes first character and adds a period.

ordered(→ LineGen)

Generate an ordered Markdown or html list.

unordered(→ LineGen)

Generate an unordered Markdown or html list.

image(→ str)

Get Pandoc Markdown for an image.

node_path(path[, italic, arrows, skip])

Get a friendly representation of a node path.

bundle_path(path, root[, italic, arrows, skip])

Get a friendly representation of a bundle path.

var_path(v[, italic, arrows, skip])

Get a friendly representation of a variable path.

var_clarification(bvars[, html])

Yield variable clarification section.

bundle_clarification(brvdict[, html])

Yield bundle clarification section

component_node(→ LineGen)

Yield component section

lines(→ LineGen)

Yield lines that describes a Node.

get_design_rule_line_vars(rules, g)

Get variables that are used within a design rule line

Attributes#

LineGen

hook

kind_mapping

raesl.doc.lines.LineGen#
class raesl.doc.lines.Hookspecs#
linguistic_enumeration() str#

Get a natural language enumeration of items.

linguistic_options() str#

Get a natural language enumeration of options.

function_spec_node(graph: ragraph.graph.Graph, html: bool) LineGen#

Yield the function spec in natural language.

design_spec_node(graph: ragraph.graph.Graph, html: bool) LineGen#

Yield the design spec in natural language.

behavior_spec_node(graph: ragraph.graph.Graph, html: bool) LineGen#

Yield the behavior spec in natural language.

need_node(graph: ragraph.graph.Graph, html: bool) LineGen#

Yield the need spec in natural language.

raesl.doc.lines.hook#
raesl.doc.lines.hs(h: int)#

Get header pound (#) signs.

raesl.doc.lines.header(h: int, text: str, capitalize: bool = True, html: bool = False) str#

Get a header with surrounding whitespace and optional capitalization.

raesl.doc.lines.boldhead(text: str, capitalize: bool = True, newlines: bool = True, html: bool = False) str#

Get a bold header (without numbering) with surrounding whitespace.

raesl.doc.lines.emph(text: str, html: bool = False) str#

Return text as emphasized (Markdown or html).

raesl.doc.lines.cap(text: str) str#

Capitalize first char of text.

raesl.doc.lines.bold(text: str, html: bool = False) str#

Return text as bold (markdown or html).

raesl.doc.lines.snt(text: str) str#

Text to a sentence. Capitalizes first character and adds a period.

raesl.doc.lines.ordered(items: Iterable[str], indent: int = 0, html: bool = False) LineGen#

Generate an ordered Markdown or html list.

raesl.doc.lines.unordered(items: Iterable[str], indent: int = 0, html: bool = False) LineGen#

Generate an unordered Markdown or html list.

raesl.doc.lines.image(path: str, caption: str | None = None, label: str | None = None, sizing: str | None = None) str#

Get Pandoc Markdown for an image.

raesl.doc.lines.node_path(path: str, italic: bool = False, arrows: bool = True, skip: str = 'world')#

Get a friendly representation of a node path.

raesl.doc.lines.bundle_path(path: str, root: str, italic: bool = False, arrows: bool = True, skip: str = 'world')#

Get a friendly representation of a bundle path.

raesl.doc.lines.var_path(v: ragraph.node.Node, italic: bool = False, arrows: bool = True, skip: str = 'world')#

Get a friendly representation of a variable path.

raesl.doc.lines.var_clarification(bvars: List[ragraph.node.Node], html: bool = False)#

Yield variable clarification section.

raesl.doc.lines.bundle_clarification(brvdict: Dict[str, List[ragraph.node.Node]], html: bool = False)#

Yield bundle clarification section

raesl.doc.lines.component_node(node: ragraph.node.Node, h: int) LineGen#

Yield component section

raesl.doc.lines.kind_mapping#
raesl.doc.lines.lines(node: ragraph.node.Node, **kwargs) LineGen#

Yield lines that describes a Node.

Parameters:

node – Node to generate the lines from.

raesl.doc.lines.get_design_rule_line_vars(rules: List[Dict[str, str]], g: ragraph.graph.Graph)#

Get variables that are used within a design rule line