summaryrefslogtreecommitdiff
path: root/sources/scala/tools/scaladoc/HTMLGeneratorCommand.java
blob: 4b82dd1a78483bd6648eb52eb358ff3e3d9d01d1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*     ____ ____  ____ ____  ______                                     *\
**    / __// __ \/ __// __ \/ ____/    SOcos COmpiles Scala             **
**  __\_ \/ /_/ / /__/ /_/ /\_ \       (c) 2002, LAMP/EPFL              **
** /_____/\____/\___/\____/____/                                        **
\*                                                                      */

// $Id$

package scala.tools.scaladoc;

import java.util.ArrayList;
import java.util.List;

import ch.epfl.lamp.util.HTMLPrinter;
import ch.epfl.lamp.util.HTMLRepresentation;

import scalac.CompilerCommand;
import scalac.util.BooleanOptionParser;
import scalac.util.ClassPath;
import scalac.util.OptionParser;
import scalac.util.Reporter;
import scalac.util.StringOptionParser;
import scalac.util.ScalaProgramArgumentParser;
import scalac.util.Strings;

/**
 * The class <code>HTMLGeneratorCommand</code> describes the options
 * passed as arguments to the HTML generator command.
 */
public class HTMLGeneratorCommand extends CompilerCommand {

    //########################################################################
    // Public Fields

    public final StringOptionParser docencoding;
    public final StringOptionParser docmodule;
    public final StringOptionParser docmodulePath;
    public final StringOptionParser doctitle;
    public final StringOptionParser doctype;
    public final StringOptionParser stylesheet;
    public final StringOptionParser windowtitle;

    public final BooleanOptionParser noindex;
    public final BooleanOptionParser validate;

    public final ScalaProgramArgumentParser packages;

    //########################################################################
    // Public Constructors

    /**
     * Creates an instance variable for an HTML generator command.
     *
     * @param product
     * @param version
     * @param reporter
     * @param phases
     */
    public HTMLGeneratorCommand(String product, String version,
        Reporter reporter, HTMLGeneratorPhases phases)
    {
        this(product, version, "<source files>", reporter, phases);
    }

    /**
     * Creates an instance variable for an HTML generator command.
     *
     * @param product
     * @param version
     * @param syntax
     * @param reporter
     * @param phases
     */
    public HTMLGeneratorCommand(String product, String version, String syntax,
        Reporter reporter, HTMLGeneratorPhases phases)
    {
        super(product, version, syntax, reporter, phases);

        this.docencoding = new StringOptionParser(this,
            "docencoding",
            "Output encoding name (" + HTMLRepresentation.DEFAULT_DOCENCODING + ", etc.)",
            "name",
            HTMLRepresentation.DEFAULT_DOCENCODING);

        this.docmodule = new StringOptionParser(this,
	    "docmodule",
            "Specify module used by scaladoc",
            "class",
            "scala.tools.scaladoc.StandardDocModule");

        this.docmodulePath = new StringOptionParser(this,
            "docmodulepath",
            "Specify where to find doc module class files",
            "path",
            ClassPath.CLASS_PATH);

        this.doctitle = new StringOptionParser(this,
	    "doctitle",
            "Include title for the overview page",
            "html-code",
            HTMLGenerator.DEFAULT_DOCTITLE);

        this.doctype = new StringOptionParser(this,
            "doctype",
            "Output type name (" + HTMLRepresentation.DEFAULT_DOCTYPE + ", etc.)",
            "name",
            HTMLRepresentation.DEFAULT_DOCTYPE);

        this.stylesheet = new StringOptionParser(this,
            "stylesheetfile",
            "File to change style of the generated documentation",
            "path",
            HTMLPrinter.DEFAULT_STYLESHEET);

        this.windowtitle = new StringOptionParser(this,
	    "windowtitle",
            "Browser window title for the documentation",
            "text",
            HTMLGenerator.DEFAULT_WINDOWTITLE);

        this.noindex = new BooleanOptionParser(this,
            "noindex",
            "Do not generate index",
            false);

        this.validate = new BooleanOptionParser(this,
            "validate",
            "Add a link at the bottom of each generated page",
            false);

        this.packages = new ScalaProgramArgumentParser(this);

        remove(nowarn);
        remove(verbose);
        remove(debug);
        remove(explaintypes);
        remove(uniqid);
        remove(types);
        remove(prompt);
        remove(separate);
        remove(classpath);
        remove(sourcepath);
        remove(bootclasspath);
        remove(extdirs);
        // outpath;
        remove(target);
        remove(noimports);
        remove(nopredefs);
        remove(skip);
        remove(check);
        remove(print);
        remove(printer);
        remove(printfile);
        remove(graph);
        remove(stop);
        remove(log);
        remove(Xshortname);

        // similar order as javadoc options
        add(2, windowtitle);
        add(3, doctitle);
        add(4, noindex);
        add(5, docmodule);
        add(6, docmodulePath);
        add(7, stylesheet);
        add(8, doctype);
        add(9, docencoding);
        add(10, validate);
        add(11, packages);
    }

    //########################################################################
}