insertImage ``EDITOR`` ====================== `insertImage` API is used to insert image into your INK editor content at the position of the cursor. Syntax ++++++ .. code-block:: javascript insertImage({ src: String, caption?: String, alt?: String }) : Promise Example +++++++ .. code-block:: javascript :linenos: import INKAPI from './inkapi.js' INKAPI.ready(async () => { const EDITOR = INKAPI.editor; EDITOR.insertImage({ src: "https://picsum.photos/500/400", caption: "Above is a random image", alt: "random image" }); }); Parameters ++++++++++ +----------+-------------------+-----------------------------------------------------------------------+ | Name | Type | Description | +==========+===================+=======================================================================+ | options | ``Object`` | Required. data for image insertion. | +----------+-------------------+-----------------------------------------------------------------------+ options +++++++ +----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Type | Description | +==========+===================+================================================================================================================================================================================================+ | src | ``String`` | src url for the image. | +----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | caption? | ``String`` | caption text for the image. | +----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | alt? | ``String`` | alt text for the image. | +----------+-------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+