igs: igs Insert graphical statement

igsR Documentation

igs Insert graphical statement

Description

generates html statement to insert graphics in a Hugo generated web document

Usage

igs(filename, opts = list(), level = 5)

Arguments

filename

Character string with the name of the image file

opts

List with options to add to img statement. See Details

level

Integer indicating the level where the image file is located. E.g. level=2 indicates that the location of the image file is ../../filename relative to the document

Value

Character string with the generated html statement

Details

Especially useful when an externally created image has to be included . It can be used in a text chunk with e.g. '⁠​r igs(...)⁠' . In opts can be specified all the options for the html img statement (with exception of src) : link, rel, alt, caption, width, height, attr and attrlink

Acknowledgement

Idea is from the article Miscellaneous Wisdom about R Markdown & Hugo Gained from Work on our Website by Maëlle Salmon

Examples

## Not run: 
igs("post/2020-05-04-dir_files/my.png",opts=list(width='75%',alt="my.png"))
# <p><img src="../../../../../post/2020-05-04-dir_files/my.png" width="75%" alt="my.png" /></p>

## End(Not run)

HanOostdijk/HOQCutil documentation built on July 28, 2023, 5:56 p.m.