def complement
      @config['htmlext'] ||= 'html'
      defaults = ReVIEW::Configure.new.merge(
        'language' => 'ja',
        'date' => Time.now.strftime('%Y-%m-%d'),
        'modified' => Time.now.utc.strftime('%Y-%02m-%02dT%02H:%02M:%02SZ'),
        'isbn' => nil,
        'toclevel' => 2,
        'stylesheet' => [],
        'epubversion' => 3,
        'htmlversion' => 5,
        'secnolevel' => 2,
        'pre_secnolevel' => 0,
        'post_secnolevel' => 1,
        'part_secnolevel' => 1,
        'titlepage' => true,
        'titlefile' => nil,
        'originaltitlefile' => nil,
        'profile' => nil,
        'colophon' => nil,
        'colophon_order' => %w[aut csl trl dsr ill edt pbl prt pht],
        'direction' => 'ltr',
        'epubmaker' => {
          'flattoc' => nil,
          'flattocindent' => true,
          'ncx_indent' => [],
          'zip_stage1' => 'zip -0Xq',
          'zip_stage2' => 'zip -Xr9Dq',
          'zip_addpath' => nil,
          'hook_beforeprocess' => nil,
          'hook_afterfrontmatter' => nil,
          'hook_afterbody' => nil,
          'hook_afterbackmatter' => nil,
          'hook_aftercopyimage' => nil,
          'hook_prepack' => nil,
          'rename_for_legacy' => nil,
          'verify_target_images' => nil,
          'force_include_images' => [],
          'cover_linear' => nil,
          'back_footnote' => nil
        },
        'externallink' => true,
        'contentdir' => '.',
        'imagedir' => 'images',
        'fontdir' => 'fonts',
        'image_ext' => %w[png gif jpg jpeg svg ttf woff otf],
        'image_maxpixels' => 4_000_000,
        'font_ext' => %w[ttf woff otf]
      )

      @config = defaults.deep_merge(@config)
      @config['title'] = @config['booktitle'] unless @config['title']

      deprecated_parameters = {
        'ncxindent' => 'epubmaker:ncxindent',
        'flattoc' => 'epubmaker:flattoc',
        'flattocindent' => 'epubmaker:flattocindent',
        'hook_beforeprocess' => 'epubmaker:hook_beforeprocess',
        'hook_afterfrontmatter' => 'epubmaker:hook_afterfrontmatter',
        'hook_afterbody' => 'epubmaker:hook_afterbody',
        'hook_afterbackmatter' => 'epubmaker:hook_afterbackmatter',
        'hook_aftercopyimage' => 'epubmaker:hook_aftercopyimage',
        'hook_prepack' => 'epubmaker:hook_prepack',
        'rename_for_legacy' => 'epubmaker:rename_for_legacy',
        'zip_stage1' => 'epubmaker:zip_stage1',
        'zip_stage2' => 'epubmaker:zip_stage2',
        'zip_addpath' => 'epubmaker:zip_addpath',
        'verify_target_images' => 'epubmaker:verify_target_images',
        'force_include_images' => 'epubmaker:force_include_images',
        'cover_linear' => 'epubmaker:cover_linear'
      }

      deprecated_parameters.each_pair do |k, v|
        next if @config[k].nil?
        sa = v.split(':', 2)
        warn "Parameter #{k} is deprecated. Use:\n#{sa[0]}:\n  #{sa[1]}: ...\n\n"
        @config[sa[0]][sa[1]] = @config[k]
        @config.delete(k)
      end

      if @config['epubversion'] >= 3
        @config['htmlversion'] = 5
      end

      @config.maker = 'epubmaker'
      @config['cover'] = "#{@config['bookname']}.#{@config['htmlext']}" unless @config['cover']

      %w[bookname title].each do |k|
        raise "Key #{k} must have a value. Abort." unless @config[k]
      end
      # array
      %w[subject aut
         a-adp a-ann a-arr a-art a-asn a-aqt a-aft a-aui a-ant a-bkp a-clb a-cmm a-dsr a-edt
         a-ill a-lyr a-mdc a-mus a-nrt a-oth a-pht a-prt a-red a-rev a-spn a-ths a-trc a-trl
         adp ann arr art asn aut aqt aft aui ant bkp clb cmm dsr edt
         ill lyr mdc mus nrt oth pht pbl prt red rev spn ths trc trl
         stylesheet rights].each do |item|
        next unless @config[item]
        if @config[item].is_a?(String)
          @config[item] = [@config[item]]
        end
      end
      # optional
      # type, format, identifier, source, relation, coverpage, aut
    end
def complement
      @config['htmlext'] ||= 'html'
      defaults = ReVIEW::Configure.new.merge(
        'language' => 'ja',
        'date' => Time.now.strftime('%Y-%m-%d'),
        'modified' => Time.now.utc.strftime('%Y-%02m-%02dT%02H:%02M:%02SZ'),
        'isbn' => nil,
        'toclevel' => 2,
        'stylesheet' => [],
        'epubversion' => 3,
        'htmlversion' => 5,
        'secnolevel' => 2,
        'pre_secnolevel' => 0,
        'post_secnolevel' => 1,
        'part_secnolevel' => 1,
        'titlepage' => true,
        'titlefile' => nil,
        'originaltitlefile' => nil,
        'profile' => nil,
        'colophon' => nil,
        'colophon_order' => %w[aut csl trl dsr ill edt pbl prt pht],
        'direction' => 'ltr',
        'epubmaker' => {
          'flattoc' => nil,
          'flattocindent' => true,
          'ncx_indent' => [],
          'zip_stage1' => 'zip -0Xq',
          'zip_stage2' => 'zip -Xr9Dq',
          'zip_addpath' => nil,
          'hook_beforeprocess' => nil,
          'hook_afterfrontmatter' => nil,
          'hook_afterbody' => nil,
          'hook_afterbackmatter' => nil,
          'hook_aftercopyimage' => nil,
          'hook_prepack' => nil,
          'rename_for_legacy' => nil,
          'verify_target_images' => nil,
          'force_include_images' => [],
          'cover_linear' => nil,
          'back_footnote' => nil
        },
        'externallink' => true,
        'contentdir' => '.',
        'imagedir' => 'images',
        'fontdir' => 'fonts',
        'image_ext' => %w[png gif jpg jpeg svg ttf woff otf],
        'image_maxpixels' => 4_000_000,
        'font_ext' => %w[ttf woff otf]
      )

      @config = defaults.deep_merge(@config)
      @config['title'] = @config['booktitle'] unless @config['title']

      deprecated_parameters = {
        'ncxindent' => 'epubmaker:ncxindent',
        'flattoc' => 'epubmaker:flattoc',
        'flattocindent' => 'epubmaker:flattocindent',
        'hook_beforeprocess' => 'epubmaker:hook_beforeprocess',
        'hook_afterfrontmatter' => 'epubmaker:hook_afterfrontmatter',
        'hook_afterbody' => 'epubmaker:hook_afterbody',
        'hook_afterbackmatter' => 'epubmaker:hook_afterbackmatter',
        'hook_aftercopyimage' => 'epubmaker:hook_aftercopyimage',
        'hook_prepack' => 'epubmaker:hook_prepack',
        'rename_for_legacy' => 'epubmaker:rename_for_legacy',
        'zip_stage1' => 'epubmaker:zip_stage1',
        'zip_stage2' => 'epubmaker:zip_stage2',
        'zip_addpath' => 'epubmaker:zip_addpath',
        'verify_target_images' => 'epubmaker:verify_target_images',
        'force_include_images' => 'epubmaker:force_include_images',
        'cover_linear' => 'epubmaker:cover_linear'
      }

      deprecated_parameters.each_pair do |k, v|
        next if @config[k].nil?
        sa = v.split(':', 2)
        warn "Parameter #{k} is deprecated. Use:\n#{sa[0]}:\n  #{sa[1]}: ...\n\n"
        @config[sa[0]][sa[1]] = @config[k]
        @config.delete(k)
      end

      if @config['epubversion'] >= 3
        @config['htmlversion'] = 5
      end

      @config.maker = 'epubmaker'
      @config['cover'] = "#{@config['bookname']}.#{@config['htmlext']}" unless @config['cover']

      %w[bookname title].each do |k|
        raise "Key #{k} must have a value. Abort." unless @config[k]
      end
      # array
      %w[subject aut
         a-adp a-ann a-arr a-art a-asn a-aqt a-aft a-aui a-ant a-bkp a-clb a-cmm a-dsr a-edt
         a-ill a-lyr a-mdc a-mus a-nrt a-oth a-pht a-prt a-red a-rev a-spn a-ths a-trc a-trl
         adp ann arr art asn aut aqt aft aui ant bkp clb cmm dsr edt
         ill lyr mdc mus nrt oth pht pbl prt red rev spn ths trc trl
         stylesheet rights].each do |item|
        next unless @config[item]
        if @config[item].is_a?(String)
          @config[item] = [@config[item]]
        end
      end
      # optional
      # type, format, identifier, source, relation, coverpage, aut
    end
Complement parameters.