ex_idobata v0.3.0 ExIdobata.Hook

Post contents with a hook endpoint with idobata.io.

Example

alias ExIdobata.Hook

Hook.contents()
|> Hook.source("# Hello!")
|> Hook.markdown()
|> Hook.image("./hello.gif")
|> Hook.post(room_uuid)

# or

Hook.contents(source: "# Hello!, format: :markdown, image: "./hello.gif")
|> Hook.post(room_uuid)

Link to this section Summary

Functions

Initialize contents to post

Initialize contents to post with patrs

Set format of the source HTML in the contents.

Set an image into the contents from a file.

Set an image into the contents from a binary string.

Set format of the source Markdown in the contents.

Post contents to idobata.io with default hook API.

Post contents to idobata.io with hook API.

Set a source text in the contents.

Link to this section Functions

Link to this function

contents()

(since 0.1.0)
contents() :: ExIdobata.Hook.Contents.t()

Initialize contents to post

Link to this function

contents(params)

(since 0.1.0)

Initialize contents to post with patrs

  • :source - source text
  • :format - format of the source text (:markdown or :html)
  • :image - filename of image file

Example

ExIdobata.Hook.contents(source: "**Hi!**", format: :markdown, image: "./hello.gif")

This is same as:

ExIdobata.Hook.contents()
|> ExIdobata.Hook.source("**Hi!**")
|> ExIdobata.Hook.markdown()
|> ExIdobata.Hook.image("./hello.gif")

Set format of the source HTML in the contents.

Link to this function

image(contents, filename)

(since 0.1.0)

Set an image into the contents from a file.

Link to this function

image(contents, filename, body)

(since 0.3.0)

Set an image into the contents from a binary string.

Link to this function

markdown(contents)

(since 0.1.0)

Set format of the source Markdown in the contents.

Link to this function

post(contents)

(since 0.1.0)

Post contents to idobata.io with default hook API.

This uses default UUID. see post/2.

Link to this function

post(contents, room_uuid)

(since 0.1.0)

Post contents to idobata.io with hook API.

Link to this function

source(contents, source)

(since 0.1.0)

Set a source text in the contents.