Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7

...

There are many simple, short tags where it is easiest to simply put them between single quotes to create a Prolog atom for generating the corresponding HTML code. Another class of short tags are the single tags such as '<br>' for breaking a line and '<hr>' for adding a horizontal line. These are also most easily generated by simply quoting them.

Generating more

...

complex HTML elements with attributes

Most HTML tag pairs can be simply generated by using a start and end tag and by adding some text to create the corresponding HTML. For example, <button>Start</Button> can be used to generate a simple button saying Start. However, to unleash the full power of the HTML language, it is more often than not useful to modify the type or style of an HTML element by adding additional attributes in the form of name="value" to the start tag. For example, to create the following HTML code creates a large, colored button using the class attribute and several button classes made available by Bootstrap:

<button class="btn btn-secondary btn-lg">Start</button>

By means of these and generate with the rule. The HTML code is represented in Bootstrap format, which is also clearly illustrated by examples below or on Bootstrap's documentation website (Bootstrap Documentation).

Note

Prolog Advice: To manipulate strings and atoms in Prolog it is useful to look at documentation of the following built-in functions: atomic_list_concat, atom_concat, string_concat, append, and maplist here: https://www.swi-prolog.org/. The predicate applyTemplate is a defined predicate that will be explained below.

...