this to_dir should also be filtered through doc.normalize_asset_path.

Additionally, I don't think that File.basename(to_file) is the right way to handle the to_file argument because it drops potentially important information provided by the user. Instead, it should be treated as a relative directory, relative to to_dir. That way, the same to_dir can be used to process all AsciiDoc source files, even those organized in nested directories.