The HTML specification frequently evolves and some library items (such as Movies) might need a custom HTML code to be generated based on the targeted platform and its mime type. For this purpose, HelpNDoc's HTML based templates can be customized to generate custom code based on item extension.

Naming convention

HTML tags source files are placed in the templates' "tags" sub-directory using the following file name pattern:

KIND_EXTENSIONS.html

Where:

  • KIND - is the library item kind (e.g. movie). Required. Available kinds are: movie
  • EXTENSIONS - the list of file extensions which will use this source code. Multiple extensions are separated by a comma. Not required.

Sample file names:

File name

Description

movie_avi,mov.html

Will be used to generate the source code for movies with the .AVI or .MOV extension

movie_mp4.html

Will be used to generate the source code for movies with the .MP4 extension

movie.html

Will be used to generate the source code for all movies not handled by another HTML tag file

Placeholders

Within the source code for a specific tag, the following place-holders are available and will be replaced by HelpNDoc at generation time:

Name

Description

%LOCATION%

Final URL of the HTML element

%WIDTH%

Width of the HTML element

%HEIGHT%

Height of the HTML element

Sample content

Let's that we'd like to handle movies with the MP4 file extension. In the template's directory, we can create the tag file named "tags\movie_mp4.html". Its content could be:

<video width="%WIDTH%" height="%HEIGHT%" controls>
  <source src="%LOCATION%" type="video/mp4">
  Your browser does not support the video tag.
</video>