ex_idobata v0.2.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.
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
Link to this function
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")
Link to this function
html(contents)
(since 0.1.0)html(ExIdobata.Hook.Contents.t()) :: ExIdobata.Hook.Contents.t()
Set format of the source HTML in the contents.
Link to this function
image(contents, filename)
(since 0.1.0)image(ExIdobata.Hook.Contents.t(), binary()) :: ExIdobata.Hook.Contents.t()
Set an image into the contents.
Link to this function
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
.
Link to this function
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
Link to this function
source(contents, source)
(since 0.1.0)source(ExIdobata.Hook.Contents.t(), binary()) :: ExIdobata.Hook.Contents.t()
Set a source text in the contents.