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
entry
MarkdownEntryThe MarkdownEntry entry.
Returns
DoNullCheckForContent(MarkdownEntry?)
Effectively validates Content.
public static MarkdownEntry DoNullCheckForContent(this MarkdownEntry? entry)
Parameters
entry
MarkdownEntryThe 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
entry
MarkdownEntryThe MarkdownEntry.
length
intThe 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
entry
MarkdownEntryThe 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
entry
MarkdownEntryThe MarkdownEntry entry.
Returns
- string[]
Touch(MarkdownEntry?, DateTime)
Sets the modification date of the MarkdownEntry.
public static MarkdownEntry Touch(this MarkdownEntry? entry, DateTime date)
Parameters
entry
MarkdownEntryThe MarkdownEntry entry.
date
DateTimeThe 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
entry
MarkdownEntryThe MarkdownEntry.
length
intThe 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
entry
MarkdownEntryThe 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
entry
MarkdownEntryThe MarkdownEntry entry.
headerLevel
intThe 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
entry
MarkdownEntryThe MarkdownEntry.
editAction
Action<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
entry
MarkdownEntryThe MarkdownEntry entry.
title
stringThe title of th entry.
inceptDate
DateTimeThe incept date of the entry.
path
stringThe path to the entry.
tag
stringThe 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
entry
MarkdownEntryThe MarkdownEntry entry.
title
stringThe title of th entry.
inceptDate
DateTimeThe incept date of the entry.
documentId
intthe DBMS ID of the entry.
fileName
stringthe file name (with extension) of the entry.
path
stringThe path to the entry.
segmentId
intthe DBMS ID of the Publications Segment.
tag
stringThe tag of the entry.