AdfDocument Class
Represents an Atlassian Document Format document.
public sealed class AdfDocumentConstructors
| Name | Description |
|---|---|
| AdfDocument() |
AdfDocument()
AdfDocument.cspublic AdfDocument()No documentation is available.
Properties
| Name | Description |
|---|---|
| Content | Gets the top-level nodes of the document. |
| Version | Gets the version of the document. The only version defined today is 1. |
Content
AdfDocument.csGets the top-level nodes of the document.
public IReadOnlyList<AdfNode> Content { get; init; }Property value
Version
AdfDocument.csMethods
| Name | Description |
|---|---|
| Descendants() | Enumerates every node of the document, depth first. |
| Parse(string) | Parses an ADF document from its JSON representation. |
| Parse(JsonElement) | Parses an ADF document from an already parsed JSON value. |
| Parse(JsonNode) | Parses an ADF document from an already parsed JSON value. |
| ToJsonString(bool) | Returns the JSON representation of the document. |
| ToMarkdown() | Converts the document to Markdown using the default options. |
| ToMarkdown(AdfToMarkdownOptions) | Converts the document to Markdown. |
| TryParse(string?, AdfDocument?) | Tries to parse an ADF document from its JSON representation. |
| TryParse(JsonElement, AdfDocument?) | Tries to parse an ADF document from an already parsed JSON value. |
| WriteTo(Utf8JsonWriter) | Writes the JSON representation of the document. |
Descendants()
AdfDocument.csParse overloads
Parse(string)
AdfDocument.csParses an ADF document from its JSON representation.
public static AdfDocument Parse(string json)Parameters
jsonstring- The JSON representation of the document.
Returns
Exceptions
AdfException- The value is not a valid ADF document.
Parse(JsonElement)
AdfDocument.csParses an ADF document from an already parsed JSON value.
public static AdfDocument Parse(JsonElement element)Parameters
elementJsonElement- The JSON representation of the document.
Returns
Exceptions
AdfException- The value is not a valid ADF document.
Parse(JsonNode)
AdfDocument.csParses an ADF document from an already parsed JSON value.
public static AdfDocument Parse(JsonNode node)Parameters
nodeJsonNode- The JSON representation of the document.
Returns
Exceptions
AdfException- The value is not a valid ADF document.
ToJsonString(bool)
AdfDocument.csToMarkdown overloads
ToMarkdown()
AdfDocument.csToMarkdown(AdfToMarkdownOptions)
AdfDocument.csConverts the document to Markdown.
public string ToMarkdown(AdfToMarkdownOptions options)TryParse overloads
TryParse(string?, AdfDocument?)
AdfDocument.csTries to parse an ADF document from its JSON representation.
public static bool TryParse(string? json, out AdfDocument? result)Parameters
jsonstring?- The JSON representation of the document.
resultAdfDocument?- The parsed document, or
nullwhen the value is not a valid ADF document.
Returns
bool true when the value was parsed.
TryParse(JsonElement, AdfDocument?)
AdfDocument.csTries to parse an ADF document from an already parsed JSON value.
public static bool TryParse(JsonElement element, out AdfDocument? result)Parameters
elementJsonElement- The JSON representation of the document.
resultAdfDocument?- The parsed document, or
nullwhen the value is not a valid ADF document.
Returns
bool true when the value was parsed.
WriteTo(Utf8JsonWriter)
AdfDocument.csWrites the JSON representation of the document.
public void WriteTo(Utf8JsonWriter writer)Parameters
writerUtf8JsonWriter- The writer to write to.