package com.atlassian.stash.internal.plugin.readme;

import com.atlassian.plugin.PluginParseException;
import com.atlassian.plugin.web.ContextProvider;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;

import java.util.Map;

public class ReadmeContextProvider implements ContextProvider {

    @Override
    public void init(Map<String, String> params) throws PluginParseException {
        // Nothing to do
    }

    @Override
    public Map<String, Object> getContextMap(Map<String, Object> context) {
        // TODO When we start adding more types - need to change markup-plugin
        return ImmutableMap.<String, Object>of(
                "extensions", ImmutableList.of("md", "markdown", "mdown", "mkdn", "mkd", "txt", "text", ""),
                // Extensions that we want to see on the file page, but NOT source view
                "extensionsRaw", ImmutableList.of("txt", "text", ""),
                "name", "README");
    }
}
