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
Initialize contents to post
contents(params)
(since 0.1.0)contents(Keyword.t()) :: ExIdobata.Hook.Contents.t()
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")
html(contents)
(since 0.1.0)html(ExIdobata.Hook.Contents.t()) :: ExIdobata.Hook.Contents.t()
Set format of the source HTML in the contents.
image(contents, filename)
(since 0.1.0)image(ExIdobata.Hook.Contents.t(), binary()) :: ExIdobata.Hook.Contents.t()
Set an image into the contents from a file.
image(contents, filename, body)
(since 0.3.0)image(ExIdobata.Hook.Contents.t(), binary(), binary()) :: ExIdobata.Hook.Contents.t()
Set an image into the contents from a binary string.
markdown(contents)
(since 0.1.0)markdown(ExIdobata.Hook.Contents.t()) :: ExIdobata.Hook.Contents.t()
Set format of the source Markdown in the contents.
Post contents to idobata.io with default hook API.
This uses default UUID. see post/2
.
post(contents, room_uuid)
(since 0.1.0)post(ExIdobata.Hook.Contents.t(), ExIdobata.Hook.Endpoint.room_uuid()) :: any()
Post contents to idobata.io with hook API.
contents
- Contents to post to idobata.ioroom_uuid
- UUID of a room of idobata.io to be post. seeExIdobata.Hook.Endpoint.url/1
source(contents, source)
(since 0.1.0)source(ExIdobata.Hook.Contents.t(), binary()) :: ExIdobata.Hook.Contents.t()
Set a source text in the contents.