Class MarkdownEntryExtensions
- Namespace
- Songhay.Publications.Extensions
- Assembly
- Songhay.Publications.dll
Extensions of MarkdownEntry.
public static class MarkdownEntryExtensions
- Inheritance
-
MarkdownEntryExtensions
- Inherited Members
Methods
DoNullCheck(MarkdownEntry?)
Effectively validates MarkdownEntry.
public static MarkdownEntry DoNullCheck(this MarkdownEntry? entry)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
Returns
DoNullCheckForContent(MarkdownEntry?)
Effectively validates Content.
public static MarkdownEntry DoNullCheckForContent(this MarkdownEntry? entry)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
Returns
ToExtract(MarkdownEntry?, int)
Converts the MarkdownEntry to an extract of the specified length
public static string ToExtract(this MarkdownEntry? entry, int length)
Parameters
entryMarkdownEntryThe MarkdownEntry.
lengthintThe string-length of the extract.
Returns
ToFinalEdit(MarkdownEntry?)
Converts the specified MarkdownEntry into the final edit string
public static string ToFinalEdit(this MarkdownEntry? entry)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
Returns
ToMarkdownEntry(FileInfo)
Converts the specified FileInfo into MarkdownEntry
public static MarkdownEntry ToMarkdownEntry(this FileInfo entry)
Parameters
Returns
ToParagraphs(MarkdownEntry?)
Converts Content to paragraphs
public static string[] ToParagraphs(this MarkdownEntry? entry)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
Returns
- string[]
Touch(MarkdownEntry?, DateTime)
Sets the modification date of the MarkdownEntry.
public static MarkdownEntry Touch(this MarkdownEntry? entry, DateTime date)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
dateDateTimeThe touch DateTime.
Returns
With11TyExtract(MarkdownEntry?, int)
Returns the MarkdownEntry with the conventional eleventy extract of the specified length.
public static MarkdownEntry With11TyExtract(this MarkdownEntry? entry, int length)
Parameters
entryMarkdownEntryThe MarkdownEntry.
lengthintThe string-length of the extract.
Returns
WithContentHeader(MarkdownEntry?)
Returns the MarkdownEntry
based on FrontMatter
with a title property.
public static MarkdownEntry WithContentHeader(this MarkdownEntry? entry)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
Returns
WithContentHeader(MarkdownEntry?, int)
Returns the MarkdownEntry
based on FrontMatter
with a title property.
public static MarkdownEntry WithContentHeader(this MarkdownEntry? entry, int headerLevel)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
headerLevelintThe header level.
Returns
WithEdit(MarkdownEntry?, Action<MarkdownEntry>?)
Edits the MarkdownEntry with the specified edit action.
public static MarkdownEntry WithEdit(this MarkdownEntry? entry, Action<MarkdownEntry>? editAction)
Parameters
entryMarkdownEntryThe MarkdownEntry.
editActionAction<MarkdownEntry>the edit Action<T>.
Returns
WithNew11TyFrontMatter(MarkdownEntry?, string?, DateTime, string?, string?)
Returns the MarkdownEntry with conventional 11ty frontmatter.
public static MarkdownEntry WithNew11TyFrontMatter(this MarkdownEntry? entry, string? title, DateTime inceptDate, string? path, string? tag)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
titlestringThe title of th entry.
inceptDateDateTimeThe incept date of the entry.
pathstringThe path to the entry.
tagstringThe tag of the entry.
Returns
WithNewFrontMatter(MarkdownEntry?, string?, DateTime, int, string?, string?, int, string?)
Returns the MarkdownEntry with conventional frontmatter.
public static MarkdownEntry WithNewFrontMatter(this MarkdownEntry? entry, string? title, DateTime inceptDate, int documentId, string? fileName, string? path, int segmentId, string? tag)
Parameters
entryMarkdownEntryThe MarkdownEntry entry.
titlestringThe title of th entry.
inceptDateDateTimeThe incept date of the entry.
documentIdintthe DBMS ID of the entry.
fileNamestringthe file name (with extension) of the entry.
pathstringThe path to the entry.
segmentIdintthe DBMS ID of the Publications Segment.
tagstringThe tag of the entry.