Copy map support from edoc

https://github.com/erlang/otp/blob/OTP-17.3.2/lib/edoc/src/edoc_layout.erl#L832