<erl>

out(A) -> {ssi, "TAB.inc", "%%",[{"simple", "choosen"}]}. </erl>

## Hello world

The absolutely most simple example is a HTML file which doesn't contain any embedded erlang code at all.

The file simple_ex1.yaws contains the following HTML code.

<erl> out(A) -> yaws_api:pre_ssi_files(A#arg.docroot, ["/simple_ex1.yaws"]). </erl>

Since the file has the suffix `.yaws`, the file will be processed by the Yaws dynamic compiler, but since no embeddded erlang code is found, the data from the file will be delivered untouched.

## Hello world again

The file simple_ex2.yaws contains the following HTML code.

<erl> out(A) -> yaws_api:pre_ssi_files(A#arg.docroot, ["/simple_ex2.yaws"]). </erl>

The file has one very simple function which just returns a tuple `{ok, String}`

The String will be substituted into the delivered HTML data instead of the Erlang code.

## And yet again

The file simple_ex2.yaws returns html embedded as a string. A tighter coupling to Erlang is provided by a construct known as "ehtml". As in simple_ex3.yaws as ehtml

<erl> out(A) -> yaws_api:pre_ssi_files(A#arg.docroot, ["/simple_ex3.yaws"]). </erl>

## Print the #arg record

When writing yaws code, all classic erlang libraries are available, however, the module `yaws_api` which is included in the load path for yaws modules contains an number of usefule functions, here is a small example in simple_ex4.yaws

<erl> out(A) -> yaws_api:pre_ssi_files(A#arg.docroot, ["/simple_ex4.yaws"]). </erl>

The above code illustrates two points:

- The function `f/1` which is available in the `yaws_api` module. It's just a shortcut convenience to `io_lib:format/2`. The `yaws_api` module contains many convenience functiond for yaws coders.

- The second point is a printout of the #arg record which is passed to the `out/1` function. If you take the time to work with yaws, the Arg passed to the out/1 functions will become very familiar. It is the main mechanism which is used to pass data from the webserver to the application.

<erl> out(A) -> {ssi, "END2",[],[]}. </erl>