fn: imginclude
[contents]

Contents

Syntax

The syntax for imginclude calls is:

f++:  
imginclude{options}(absolute-path)

n++:  
@imginclude{options}(absolute-path)

Description

The imginclude function takes a single absolute path as input and returns the code below to insert the path as an image in html using the relative path:

<img src="relative-path" options>

The imginclude function also throws a warning if the image file does not exist.

Note: Another good way to include an image file, where an error is thrown if the file does not exist, is:

<img src="@pathtofile(absolute-path)" width="120px">

Options

Anything added as an option to an imginclude call will be added to the code to insert the path as an image as outlined in the Description section. For example if you make the following call:

@imginclude{width="250px", style="border-radius: 5px"}("logo.svg")

The return value will be:

<img src="logo.svg" width="250px" style="border-radius: 5px">

f++ example

Examples of imginclude being used with f++:

imginclude("site/assets/images/logo.svg")
imginclude{width="200px"}("site/assets/images/teji.svg")

n++ example

Examples of imginclude being used with n++:

@imginclude("site/assets/images/logo.svg")
@imginclude{width="200px"}("site/assets/images/teji.svg")