Favicon Plugin
This is a DITA-OT Plug-in used to add a favicon to DITA HTML output.
A favicon is a file containing a small brand image icon, associated with a particular website or web page. A web designer can create such an icon and upload it to a website, and graphical web browsers can then make use of it by displaying the icon on the associated browser tab.
Install
Run the plug-in installation commands:
dita install https://github.com/jason-fox/fox.jason.favicon/archive/master.zip
The dita command line tool requires no additional configuration.
Usage
To run, use any html transform and add the --args.favicon , --args.faviconpath and args.faviconroot parameters.
The new args.favicon.* parameters follow the existing syntax used by DITA-OT for CSS files.
dita --format [html5|xhtml] \
--input document.ditamap \
--args.faviconpath=DESTINATION_PATH_OF_FAVICON \
--args.faviconroot=SOURCE_PATH_OF_FAVICON
To refer to an existing file hosted on a server, use a URL as the --args.faviconpath parameter
dita --format [html5|xhtml] \
--input document.ditamap \
--args.faviconpath=https://example.com/static/assets
Parameter Reference
-
args.favicon - Specifies the name of the favicon file. The
value of this parameter should be only the file name. The absolute path to the
parent directory should be specified with args.faviconroot.
Defaults to
favicon.svg
- the name of the default image found within the plugin itself. -
args.faviconpath - Specifies the destination directory to
which the favicon file is copied (relative to the output directory).
Corresponds to the XSLT parameter
FAVICONPATH
. DITA-OT will copy the file to this location.Tip: If args.faviconpath is not set, the favicon file will be copied to the root level of the output folder. To move the favicon file to an output subfolder named /static/assets, set args.faviconpath to /static/assets. -
args.faviconroot - specifies the source directory that
contains the favicon file. DITA-OT will copy the file from this location.
Defaults to the image found within the plugin itself.
Important: Enter the absolute path to the parent directory of the favicon file specified with args.favicon.