Skip to content

rendering

Steven Hanna edited this page Dec 8, 2018 · 1 revision

write_string_to_file

Parameters

  • filename: &str - a string slice representing the source filename with the source extension

  • elements: Vec - a vector full of markdown elements to be rendered

Description

Writes a string to a file

ParameterRep

Description

Represents a chunk of comments to be rendered.

argot_type

Type

String

Description

Holds the type of each parameter, currently either FUNC, VAR, CLASS

raw_elements

Type

Vec<(String, String)>

Description

Holds the raw source comments in a tuple, with the first element the

elements

Type

Vec

Description

Holds a list of MarkdownElement's. Should be considered to be in order, and can be rendered simply by looping through. This instance variable will be built

new

Parameters

  • raw_elements: Vec<(String, String)> - the raw extraction elements separated by type and content

Returns

  • Result<ParameterRep, SimpleError> - Either returns a parameter

render

Parameters

  • &mut self

Returns

  • String - string represenation of the markdown that can be dumped to a file.

Description

Renders each ParameterRep based on its type, either as a class, var, or

extract_type

Parameters

  • &self

  • type_name: &str - the type contents to extract

Returns

  • Vec<String> - a Vector of contents associated with that type

Description

Extracts and collects the content of raw_elements depending on the

render_to_string

Description

Renders the markdown elements to a single String joined by newlines

MarkdownElement

Authors

Description

Representation of an arbritrary element to be represented in Markdown

markdown_type

Description

String type that holds what kind of element the markdown should be

text

Description

The text to be rendered out to the type

new

Parameters

  • text - String - the text to be transformed to markdown

  • markdown_type - String - the type of element to render as

Description

Creates a new markdown element that can be rendered

render

Returns

  • String - the markdown representation of the object

Description

Renders a MarkdownElement object to Markdown