Class DocumentUtility
- Namespace
- Songhay.Publications
- Assembly
- Songhay.Publications.dll
public static class DocumentUtility
- Inheritance
-
DocumentUtility
- Inherited Members
Methods
GetConventionalFrontMatterProperties(bool)
Returns a collection of property names based on IDocument
public static IReadOnlyCollection<string> GetConventionalFrontMatterProperties(bool includeTagProperty = true)
Parameters
Returns
GetConventionalTagsAndPropertiesElements(JsonObject?, string?, ILogger)
Returns a tuple of two JsonElement instances representing the conventional tags and properties elements.
public static (JsonElement tags, JsonElement propeties) GetConventionalTagsAndPropertiesElements(JsonObject? documentData, string? tag, ILogger logger)
Parameters
documentDataJsonObjectthe JsonObject
tagstringthe value of Tag
loggerILoggerthe ILogger
Returns
Remarks
The JsonObject passed into this method should be or will be shaped like IDocument where Tag can be serialized JSON of the form:
{
\"tags\": [...],
\"properties\": { ... }
}
...where the tags property is an array of strings
and the properties property is an object
of conventional properties, named with a prefix of rx.
This use of Tag is a temporary workaround until a formal concept of Document properties can be defined.
UpdateDocument(IDocument?, JsonObject?, ILogger)
Updates the instance of IDocument with the specified JsonObject.
public static void UpdateDocument(IDocument? document, JsonObject? documentData, ILogger logger)
Parameters
documentIDocumentthe IDocument
documentDataJsonObjectthe JsonObject
loggerILoggerthe ILogger
Remarks
This member operates in the opposite ‘direction’ of UpdateFrontMatter(JsonObject?, Document?).
UpdateFrontMatter(JsonObject?, Document?)
Updates the JsonObject with the specified instance of IDocument.
public static void UpdateFrontMatter(JsonObject? documentData, Document? document)
Parameters
documentDataJsonObjectthe JsonObject
documentDocumentthe IDocument
Remarks
This member operates in the opposite ‘direction’ of UpdateDocument(IDocument?, JsonObject?, ILogger).
UpdateFrontMatterWithDocumentTag(JsonObject?, string?, ILogger)
Updates the JsonObject with the conventional front-matter properties based on Tag for Studio Publications.
public static void UpdateFrontMatterWithDocumentTag(JsonObject? documentData, string? tag, ILogger logger)
Parameters
documentDataJsonObjectthe JsonObject
tagstringthe value of Tag
loggerILoggerthe ILogger
- See Also