MarkdownFrontMatter
Namespace: TagBites.Text.Markdown
Assembly: TagBites.Text.Markdown.dll
Product: TagBites.Text.Markdown v. 2.2.0
The metadata of a document, written above the content as a YAML front matter block.
public class MarkdownFrontMatter : System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, System.Collections.IEnumerableInheritance: object → MarkdownFrontMatter
Remarks
Section titled “Remarks”Title and Description map to the entry named after them in lower case. The indexer holds an entry with a single value, and SetValues(string, string[]) holds one with a list, which is the shape a generator expects for tags or keywords. The block writes its entries in the order in which they were first set.
Constructors
Section titled “Constructors”MarkdownFrontMatter()
Section titled “MarkdownFrontMatter()”Creates a block without entries.
public MarkdownFrontMatter()MarkdownFrontMatter(IEnumerable<KeyValuePair<string, string>>)
Section titled “MarkdownFrontMatter(IEnumerable<KeyValuePair<string, string>>)”Creates a block from entries that were read from an existing document.
public MarkdownFrontMatter(IEnumerable<KeyValuePair<string, string>> entries)Parameters
Section titled “Parameters”entriesIEnumerable<KeyValuePair<string, string>>
Remarks
Section titled “Remarks”A name that repeats builds a list, so the entries of another block come back unchanged.
Properties
Section titled “Properties”Description
Section titled “Description”Gets or sets the short description of the document.
public string Description { get; set; }Property Value
Section titled “Property Value”Gets or sets the title of the document.
public string Title { get; set; }Property Value
Section titled “Property Value”Indexers
Section titled “Indexers”Gets or sets the single value of the entry with the given name. Setting null removes the entry.
public string Item[string name] { get; set; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”An entry that holds a list reads as null here. Use GetValues(string) for it.
Methods
Section titled “Methods”GetEnumerator()
Section titled “GetEnumerator()”Returns every value of the block, one pair per value.
public virtual IEnumerator<KeyValuePair<string, string>> GetEnumerator()Returns
Section titled “Returns”IEnumerator<KeyValuePair<string, string>>
Remarks
Section titled “Remarks”An entry that holds a list comes back once per item, under the same name.
GetValues(string)
Section titled “GetValues(string)”Returns the values of the entry with the given name, or null when it holds no list.
public IReadOnlyList<string> GetValues(string name)Parameters
Section titled “Parameters”namestring
Returns
Section titled “Returns”Remarks
Section titled “Remarks”An entry with a single value reads through the indexer.
SetValues(string, string[])
Section titled “SetValues(string, string[])”Replaces the entry with the given name with a list, which is written as [first, second].
public MarkdownFrontMatter SetValues(string name, string[] values)Parameters
Section titled “Parameters”Returns
Section titled “Returns”Remarks
Section titled “Remarks”An empty list writes nothing, and null removes the entry.