AdfDocument Class

Represents an Atlassian Document Format document.

public sealed class AdfDocument

Constructors

NameDescription
AdfDocument()

AdfDocument()

AdfDocument.cs
public AdfDocument()

No documentation is available.

Properties

NameDescription
ContentGets the top-level nodes of the document.
VersionGets the version of the document. The only version defined today is 1.

Gets the top-level nodes of the document.

public IReadOnlyList<AdfNode> Content { get; init; }

Gets the version of the document. The only version defined today is 1.

public int Version { get; init; }

Property value

int

Methods

NameDescription
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.cs

Enumerates every node of the document, depth first.

public IEnumerable<AdfNode> Descendants()

Parse overloads

Parse(string)

AdfDocument.cs

Parses an ADF document from its JSON representation.

public static AdfDocument Parse(string json)
Parameters
json string
The JSON representation of the document.
Returns

AdfDocument

Exceptions
AdfException
The value is not a valid ADF document.

Parse(JsonElement)

AdfDocument.cs

Parses an ADF document from an already parsed JSON value.

public static AdfDocument Parse(JsonElement element)
Parameters
element JsonElement
The JSON representation of the document.
Returns

AdfDocument

Exceptions
AdfException
The value is not a valid ADF document.

Parse(JsonNode)

AdfDocument.cs

Parses an ADF document from an already parsed JSON value.

public static AdfDocument Parse(JsonNode node)
Parameters
node JsonNode
The JSON representation of the document.
Returns

AdfDocument

Exceptions
AdfException
The value is not a valid ADF document.

ToJsonString(bool)

AdfDocument.cs

Returns the JSON representation of the document.

public string ToJsonString(bool indented = false)

Parameters

indented bool
Whether the JSON is indented.

Returns

string

ToMarkdown overloads

ToMarkdown()

AdfDocument.cs

Converts the document to Markdown using the default options.

public string ToMarkdown()
Returns

string

ToMarkdown(AdfToMarkdownOptions)

AdfDocument.cs

Converts the document to Markdown.

public string ToMarkdown(AdfToMarkdownOptions options)
Parameters
options AdfToMarkdownOptions
The conversion options.
Returns

string

TryParse overloads

TryParse(string?, AdfDocument?)

AdfDocument.cs

Tries to parse an ADF document from its JSON representation.

public static bool TryParse(string? json, out AdfDocument? result)
Parameters
json string?
The JSON representation of the document.
result AdfDocument?
The parsed document, or null when the value is not a valid ADF document.
Returns

bool true when the value was parsed.

TryParse(JsonElement, AdfDocument?)

AdfDocument.cs

Tries to parse an ADF document from an already parsed JSON value.

public static bool TryParse(JsonElement element, out AdfDocument? result)
Parameters
element JsonElement
The JSON representation of the document.
result AdfDocument?
The parsed document, or null when the value is not a valid ADF document.
Returns

bool true when the value was parsed.

WriteTo(Utf8JsonWriter)

AdfDocument.cs

Writes the JSON representation of the document.

public void WriteTo(Utf8JsonWriter writer)

Parameters

writer Utf8JsonWriter
The writer to write to.