    # File lib/yard/templates/helpers/markup_helper.rb, line 76
          def load_markup_provider(type = options[:markup])
            return true if MarkupHelper.markup_cache[type]
            MarkupHelper.markup_cache[type] ||= {}

            providers = MARKUP_PROVIDERS[type.to_sym]
            return true if providers && providers.empty?
            if providers && options[:markup_provider]
              providers = providers.select {|p| p[:lib] == options[:markup_provider] }
            end

            if providers == nil || providers.empty?
              log.error "Invalid markup type '#{type}' or markup provider " +
                "(#{options[:markup_provider]}) is not registered."
              return false
            end

            # Search for provider, return the library class name as const if found
            providers.each do |provider|
              begin require provider[:lib].to_s; rescue LoadError; next end if provider[:lib]
              begin klass = eval("::" + provider[:const]); rescue NameError; next end
              MarkupHelper.markup_cache[type][:provider] = provider[:lib] # Cache the provider
              MarkupHelper.markup_cache[type][:class] = klass
              return true
            end

            # Show error message telling user to install first potential provider
            name, lib = *[providers.first[:const], providers.first[:lib] || type]
            log.error "Missing '#{lib}' gem for #{type.to_s.capitalize} formatting. Install it with `gem install #{lib}`"
            false
          end