A set of helpers to generate proper markdown easily
Summary
Functions
The deprecation notice for a field, argument or enum value, or an empty string when it is not deprecated.
Joins a (possibly nested) list of lines into a document.
Makes a value safe to place inside a markdown table cell: pipes are
escaped so they do not start a new column, and line breaks become <br>
so the row is not split.
Builds the description cell for a field or argument, appending the default value sentence when there is one.
Generates a code block for a GraphQL operation from the details built by
GraphqlMarkdown.OperationDetailsHelpers.generate_operation_details/4.
Joins sentence fragments with a period and a space. Empty and nil
fragments are skipped, and a fragment that already ends with a period is
not given a second one.
Functions
The deprecation notice for a field, argument or enum value, or an empty string when it is not deprecated.
Joins a (possibly nested) list of lines into a document.
Every line is terminated by a newline; an empty string produces a blank
line. Nested lists are flattened, so builders can return lists of lines
freely, and nil entries are skipped.
Makes a value safe to place inside a markdown table cell: pipes are
escaped so they do not start a new column, and line breaks become <br>
so the row is not split.
Builds the description cell for a field or argument, appending the default value sentence when there is one.
@spec graphql_operation_code_block( GraphqlMarkdown.OperationDetailsHelpers.graphql_operation_details() ) :: String.t()
Generates a code block for a GraphQL operation from the details built by
GraphqlMarkdown.OperationDetailsHelpers.generate_operation_details/4.
Example:
mutation RefreshIdToken($refreshToken: String!) {
refreshIdToken(refreshToken: $refreshToken) {
idToken
userSsoDetails {
domain
ssoEnabled
}
}
}
@spec header(String.t(), non_neg_integer(), boolean()) :: String.t()
@spec list(String.t(), non_neg_integer(), boolean()) :: String.t()
@spec new_line() :: String.t()
Joins sentence fragments with a period and a space. Empty and nil
fragments are skipped, and a fragment that already ends with a period is
not given a second one.