Happy new year all!
The first paragraph of std/htmlgen states:
Do yourself a favor and import the module as from htmlgen import nil and then fully qualify the macros.
What does it mean? I don't get it. Besides the first example imports the module as usual:
import std/htmlgen
It's not a requirement, but a suggestion to use namespaces for this module, because it's full of macros with cryptic and not-specific names.
If we import nil (nothing) from a module - we could use this pattern for explicit module calls (aka namespaces), which reduce ambiguity and help avoiding identifier collisions:
from std/htmlgen import nil
# `address` macro is defined in `std/htmlgen`, but because of namespaces we can only call it through the module `htmlgen`.
address(foo) # would not compile
htmlgen.address(foo) # this works
You can also do something like this:
from htmlgen as htg import nil
echo htg.p("hello")