All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.nosqlbench.nb.api.markdown.exporter.MarkdownExporter Maven / Gradle / Ivy

There is a newer version: 4.15.102
Show newest version
package io.nosqlbench.nb.api.markdown.exporter;

import io.nosqlbench.nb.api.markdown.types.DocScope;
import io.nosqlbench.nb.api.markdown.aggregator.MarkdownDocs;
import io.nosqlbench.nb.api.markdown.types.MarkdownInfo;
import joptsimple.*;

import java.nio.file.Path;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

public class MarkdownExporter implements Runnable {

    public static final String APP_NAME = "exporter";
    private final Path basePath;
    private Set scopeSet;

    public MarkdownExporter(Path basePath, Set scopeSet) {
        this.basePath = basePath;
        this.scopeSet = scopeSet;
    }

    public static void main(String[] args) {
        final OptionParser parser = new OptionParser();

        OptionSpec basedir = parser.accepts("basedir", "base directory to write to")
            .withRequiredArg().ofType(String.class).defaultsTo(".");

        OptionSpec docScopes = parser.accepts("scopes", "scopes of documentation to export")
            .withRequiredArg().ofType(String.class).defaultsTo(DocScope.ANY.toString());

        parser.acceptsAll(List.of("-h","--help","help"),"Display help").forHelp();

        OptionSet options = parser.parse(args);

        Path basePath = Path.of(basedir.value(options));
        Set scopeSet = docScopes.values(options).stream().map(DocScope::valueOf).collect(Collectors.toSet());


        new MarkdownExporter(basePath,scopeSet).run();
    }

    @Override
    public void run() {
        List markdownInfos = MarkdownDocs.find(new ArrayList<>(scopeSet).toArray(new DocScope[0]));

    }


}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy