NLdoc.Conversion.Writer.Tiptap (NLdoc.Conversion.Writer.Tiptap v2.0.1)

View Source

This writer converts NLdoc Spec objects to Tiptap Elements.

Summary

Functions

Converts NLdoc Spec Document to Tiptap document

Types

error()

@type error() :: {:error, {:unsupported_resource, module()}}

input(resource)

@type input(resource) ::
  {resource, state :: NLdoc.Conversion.Writer.Tiptap.State.t(),
   ctx :: NLdoc.Conversion.Writer.Tiptap.Context.t()}

opt()

@type opt() :: {:strict, boolean()}

output(value)

@type output(value) ::
  {:ok, {value, state :: NLdoc.Conversion.Writer.Tiptap.State.t()}} | error()

tiptap_attribute_map()

@type tiptap_attribute_map() :: %{required(atom()) => term()}

tiptap_element()

@type tiptap_element() :: %{required(atom()) => term()}

tiptap_mark()

@type tiptap_mark() :: map()

Functions

convert(doc, opts \\ [])

@spec convert(doc :: NLdoc.Spec.Document.t(), opts :: [opt()]) ::
  {:ok, tiptap_element()} | error()

Converts NLdoc Spec Document to Tiptap document