Using modules

This is a tutorial to help add modules from the htms registry

This builds upon the start using htms tutorial so you must do it first

Once you have everything prepared you just need to modify your htms config

<htms>
  module "hello"

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

To add modules you use the module command and then the name of the module you want to import.

This will fetch the module code and add it to your website, you can see all modules in the htms registry.

In the example we are importing the hello module, this is a test module that will print "Hello world" to the console.

And that's all, that easy.

Last updated