Top-level and extension functions

Writing a domain-specific language in Kotlin largely boils down to using well-named functions. These functions can often be composed together to create highly readable and fluent code. To start using any DSL, there needs to be some type of starting point. That starting point is going to be either a top-level function or an extension function.

Let's revisit the previous HTML example to examine these function types.