Using modules

This tutorial shows how to add modules from the htms registry.

This builds upon the start using htms tutorial so doing it first is recommended.

Once everything is prepared, just modify the htms config to add the module command

<htms>
  module "hello"

  import "Test" from "samples.htms"
  replace "Element" with "Test"
</htms>

The module command will load the module with the name of the module specified.

Doing so will fetch the module code and add it to the website, all modules are in the htms registry.

In the example, the hello modules is added, this is a test module that will print "Hello world" to the console.

And that's all, that easy.

Last updated