pub struct MultiPartTable { /* private fields */ }Expand description
A datastructure to hold various row types for a markdown table.
This datastructure has the following types of rows:
- header - just the left most column which is centered and bolded text
- name/value - first column is the name and the second column is data.
For name/value rows, the name is right justified. Name/value rows may also have unordered (bulleted) lists. In markdown, there is no such thing as a multiline row, so this creates multiple rows where the name is left blank.
Implementations§
Source§impl MultiPartTable
impl MultiPartTable
pub fn new() -> Self
pub fn new_with_value_highlights(value_highlights: Vec<String>) -> Self
pub fn new_with_value_highlights_from_remarks(remarks: &[Remark]) -> Self
Sourcepub fn header_ref(self, name: &impl ToString) -> Self
pub fn header_ref(self, name: &impl ToString) -> Self
Add a header row.
Sourcepub fn add_separator(self) -> Self
pub fn add_separator(self) -> Self
Adds a separator line.
Sourcepub fn nv_raw(self, name: &impl ToString, value: impl ToString) -> Self
pub fn nv_raw(self, name: &impl ToString, value: impl ToString) -> Self
Add a name/value row without processing whitespace or markdown characters.
Sourcepub fn nv_ul_ref(self, name: &impl ToString, value: Vec<&impl ToString>) -> Self
pub fn nv_ul_ref(self, name: &impl ToString, value: Vec<&impl ToString>) -> Self
Add a name/value row with unordered list.
Sourcepub fn nv_ul(self, name: &impl ToString, value: Vec<impl ToString>) -> Self
pub fn nv_ul(self, name: &impl ToString, value: Vec<impl ToString>) -> Self
Add a name/value row with unordered list.
Sourcepub fn and_nv_ref<T: ToString>(
self,
name: &impl ToString,
value: &Option<T>,
) -> Self
pub fn and_nv_ref<T: ToString>( self, name: &impl ToString, value: &Option<T>, ) -> Self
Add a name/value row using a default if value is None.
Sourcepub fn and_nv_ref_maybe<T: ToString>(
self,
name: &impl ToString,
value: &Option<T>,
) -> Self
pub fn and_nv_ref_maybe<T: ToString>( self, name: &impl ToString, value: &Option<T>, ) -> Self
Add a name/value row if the value is Some(T).
Sourcepub fn and_nv_ul_ref(
self,
name: &impl ToString,
value: Option<Vec<&impl ToString>>,
) -> Self
pub fn and_nv_ul_ref( self, name: &impl ToString, value: Option<Vec<&impl ToString>>, ) -> Self
Add a name/value row with unordered list if the value is Some.
Sourcepub fn and_nv_ul(
self,
name: &impl ToString,
value: Option<Vec<impl ToString>>,
) -> Self
pub fn and_nv_ul( self, name: &impl ToString, value: Option<Vec<impl ToString>>, ) -> Self
Add a name/value row with unordered list if the value is Some.
Sourcepub fn summary(self, header_text: MdHeaderText) -> Self
pub fn summary(self, header_text: MdHeaderText) -> Self
A summary row is a special type of name/value row that has an unordered (bulleted) list that is output in a tree structure (max 3 levels).
Sourcepub fn multi_raw(self, values: Vec<String>) -> Self
pub fn multi_raw(self, values: Vec<String>) -> Self
Adds a multivalue row without processing whitespace or markdown characters.
Sourcepub fn multi_raw_ref(self, values: &[&str]) -> Self
pub fn multi_raw_ref(self, values: &[&str]) -> Self
Adds a multivalue row without processing whitespace or markdown characters.