Skip to content

Commit 2117442

Browse files
committed
Fix scaladoc
1 parent e7ddf3f commit 2117442

File tree

1 file changed

+39
-31
lines changed

1 file changed

+39
-31
lines changed

scaladoc/src/dotty/tools/scaladoc/ScaladocSettings.scala

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package dotty.tools.scaladoc
22

33
import dotty.tools.dotc.config.Settings._
44
import dotty.tools.dotc.config.AllScalaSettings
5+
import dotty.tools.dotc.config.ScalaSettingCategories.RootSetting
56

67
class ScaladocSettings extends SettingGroup with AllScalaSettings:
78
val unsupportedSettings = Seq(
@@ -11,90 +12,95 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
1112

1213

1314
val projectName: Setting[String] =
14-
StringSetting("-project", "project title", "The name of the project.", "", aliases = List("-doc-title"))
15+
StringSetting(RootSetting, "project", "project title", "The name of the project.", "", aliases = List("-doc-title"))
1516

1617
val projectVersion: Setting[String] =
17-
StringSetting("-project-version", "project version", "The current version of your project.", "", aliases = List("-doc-version"))
18+
StringSetting(RootSetting, "project-version", "project version", "The current version of your project.", "", aliases = List("-doc-version"))
1819

1920
val projectLogo: Setting[String] =
20-
StringSetting("-project-logo", "project logo filename", "Path to the file that contains the project's logo. Provided path can be absolute or relative to the project root directory.", "", aliases = List("-doc-logo"))
21+
StringSetting(RootSetting, "project-logo", "project logo filename", "Path to the file that contains the project's logo. Provided path can be absolute or relative to the project root directory.", "", aliases = List("-doc-logo"))
2122

22-
val projectFooter: Setting[String] = StringSetting("-project-footer", "project footer", "A footer on every Scaladoc page.", "", aliases = List("-doc-footer"))
23+
val projectFooter: Setting[String] = StringSetting(RootSetting, "project-footer", "project footer", "A footer on every Scaladoc page.", "", aliases = List("-doc-footer"))
2324

2425
val sourceLinks: Setting[List[String]] =
25-
MultiStringSetting("-source-links", "sources", SourceLinks.usage)
26+
MultiStringSetting(RootSetting, "source-links", "sources", SourceLinks.usage)
2627

2728
val legacySourceLink: Setting[String] =
28-
StringSetting("-doc-source-url", "sources", "Legacy option from Scala 2. Use -source-links instead.", "")
29+
StringSetting(RootSetting, "doc-source-url", "sources", "Legacy option from Scala 2. Use -source-links instead.", "")
2930

3031
val syntax: Setting[List[String]] =
31-
MultiStringSetting("-comment-syntax", "syntax", tasty.comments.CommentSyntaxArgs.usage)
32+
MultiStringSetting(RootSetting, "comment-syntax", "syntax", tasty.comments.CommentSyntaxArgs.usage)
3233

3334
val revision: Setting[String] =
34-
StringSetting("-revision", "revision", "Revision (branch or ref) used to build project project", "")
35+
StringSetting(RootSetting, "revision", "revision", "Revision (branch or ref) used to build project project", "")
3536

3637
val externalDocumentationMappings: Setting[List[String]] =
37-
MultiStringSetting("-external-mappings", "external-mappings",
38+
MultiStringSetting(RootSetting, "external-mappings", "external-mappings",
3839
"Mapping between regexes matching classpath entries and external documentation. " +
3940
"'regex::[scaladoc|scaladoc|javadoc]::path' syntax is used")
4041

4142
val legacyExternalDocumentationMappings: Setting[List[String]] =
42-
MultiStringSetting("-doc-external-doc", "legacy-external-mappings", "Legacy option from Scala 2. Mapping betweeen path and external documentation. Use -external-mappings instead.")
43+
MultiStringSetting(RootSetting, "doc-external-doc", "legacy-external-mappings", "Legacy option from Scala 2. Mapping betweeen path and external documentation. Use -external-mappings instead.")
4344

4445
val socialLinks: Setting[List[String]] =
45-
MultiStringSetting("-social-links", "social-links",
46+
MultiStringSetting(RootSetting, "social-links", "social-links",
4647
"Links to social sites. '[github|twitter|gitter|discord]::link' or 'custom::link::light_icon_file_name[::dark_icon_file_name]' syntax is used. For custom links, the icons must be present in '_assets/images/'")
4748

4849
val deprecatedSkipPackages: Setting[List[String]] =
49-
MultiStringSetting("-skip-packages", "packages", "Deprecated, please use `-skip-by-id` or `-skip-by-regex`")
50+
MultiStringSetting(RootSetting, "skip-packages", "packages", "Deprecated, please use `-skip-by-id` or `-skip-by-regex`")
5051

5152
val skipById: Setting[List[String]] =
52-
MultiStringSetting("-skip-by-id", "package or class identifier", "Identifiers of packages or top-level classes to skip when generating documentation")
53+
MultiStringSetting(RootSetting, "skip-by-id", "package or class identifier", "Identifiers of packages or top-level classes to skip when generating documentation")
5354

5455
val skipByRegex: Setting[List[String]] =
55-
MultiStringSetting("-skip-by-regex", "regex", "Regexes that match fully qualified names of packages or top-level classes to skip when generating documentation")
56+
MultiStringSetting(RootSetting, "skip-by-regex", "regex", "Regexes that match fully qualified names of packages or top-level classes to skip when generating documentation")
5657

5758
val docRootContent: Setting[String] =
58-
StringSetting("-doc-root-content", "path", "The file from which the root package documentation should be imported.", "")
59+
StringSetting(RootSetting, "doc-root-content", "path", "The file from which the root package documentation should be imported.", "")
5960

6061
val author: Setting[Boolean] =
61-
BooleanSetting("-author", "Include authors.", false)
62+
BooleanSetting(RootSetting, "author", "Include authors.", false)
6263

6364
val groups: Setting[Boolean] =
64-
BooleanSetting("-groups", "Group similar functions together (based on the @group annotation)", false)
65+
BooleanSetting(RootSetting, "groups", "Group similar functions together (based on the @group annotation)", false)
6566

6667
val visibilityPrivate: Setting[Boolean] =
67-
BooleanSetting("-private", "Show all types and members. Unless specified, show only public and protected types and members.", false)
68+
BooleanSetting(RootSetting, "private", "Show all types and members. Unless specified, show only public and protected types and members.", false)
6869

6970
val docCanonicalBaseUrl: Setting[String] =
7071
StringSetting(
71-
"-doc-canonical-base-url",
72+
RootSetting,
73+
"doc-canonical-base-url",
7274
"url",
7375
s"A base URL to use as prefix and add `canonical` URLs to all pages. The canonical URL may be used by search engines to choose the URL that you want people to see in search results. If unset no canonical URLs are generated.",
7476
""
7577
)
7678

7779
val siteRoot: Setting[String] = StringSetting(
78-
"-siteroot",
80+
RootSetting,
81+
"siteroot",
7982
"site root",
8083
"A directory containing static files from which to generate documentation.",
8184
"./docs"
8285
)
8386

8487
val noLinkWarnings: Setting[Boolean] = BooleanSetting(
85-
"-no-link-warnings",
88+
RootSetting,
89+
"no-link-warnings",
8690
"Avoid warnings for ambiguous and incorrect links in members look up. Doesn't affect warnings for incorrect links of assets etc.",
8791
false
8892
)
8993

9094
val noLinkAssetWarnings: Setting[Boolean] = BooleanSetting(
91-
"-no-link-asset-warnings",
95+
RootSetting,
96+
"no-link-asset-warnings",
9297
"Avoid warnings for incorrect links of assets like images, static pages, etc.",
9398
false
9499
)
95100

96101
val versionsDictionaryUrl: Setting[String] = StringSetting(
97-
"-versions-dictionary-url",
102+
RootSetting,
103+
"versions-dictionary-url",
98104
"versions dictionary url",
99105
"A URL pointing to a JSON document containing a dictionary `version label -> documentation location`. " +
100106
"The JSON file has single property \"versions\" that holds dictionary of labels of specific docs and URL pointing to their index.html top-level file. " +
@@ -103,23 +109,24 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
103109
)
104110

105111
val YdocumentSyntheticTypes: Setting[Boolean] =
106-
BooleanSetting("-Ydocument-synthetic-types", "Attach pages with documentation of the intrinsic types e. g. Any, Nothing to the docs. Setting is useful only for stdlib.", false)
112+
BooleanSetting(RootSetting, "Ydocument-synthetic-types", "Attach pages with documentation of the intrinsic types e. g. Any, Nothing to the docs. Setting is useful only for stdlib.", false)
107113

108114
val snippetCompiler: Setting[List[String]] =
109-
MultiStringSetting("-snippet-compiler", "snippet-compiler", snippets.SnippetCompilerArgs.usage)
115+
MultiStringSetting(RootSetting, "snippet-compiler", "snippet-compiler", snippets.SnippetCompilerArgs.usage)
110116

111117
val generateInkuire: Setting[Boolean] =
112-
BooleanSetting("-Ygenerate-inkuire", "Generates InkuireDB and enables Hoogle-like searches", false)
118+
BooleanSetting(RootSetting, "Ygenerate-inkuire", "Generates InkuireDB and enables Hoogle-like searches", false)
113119

114120
val apiSubdirectory: Setting[Boolean] =
115-
BooleanSetting("-Yapi-subdirectory", "Put the API documentation pages inside a directory `api/`", false)
121+
BooleanSetting(RootSetting, "Yapi-subdirectory", "Put the API documentation pages inside a directory `api/`", false)
116122

117123
val scastieConfiguration: Setting[String] =
118-
StringSetting("-scastie-configuration", "Scastie configuration", "Additional configuration passed to Scastie in code snippets", "")
124+
StringSetting(RootSetting, "scastie-configuration", "Scastie configuration", "Additional configuration passed to Scastie in code snippets", "")
119125

120126
val defaultTemplate: Setting[String] =
121127
StringSetting(
122-
"-default-template",
128+
RootSetting,
129+
"default-template",
123130
"default template used by static site",
124131
"The static site is generating empty files for indexes that haven't been provided explicitly in a sidebar/missing index.html in directory. " +
125132
"User can specify what default template should be used for such indexes. It can be useful for providing generic templates that interpolate some common settings, like title, or can have some custom html embedded.",
@@ -128,13 +135,14 @@ class ScaladocSettings extends SettingGroup with AllScalaSettings:
128135

129136
val quickLinks: Setting[List[String]] =
130137
MultiStringSetting(
131-
"-quick-links",
138+
RootSetting,
139+
"quick-links",
132140
"quick-links",
133141
"List of quick links that is displayed in the header of documentation."
134142
)
135143

136144
val dynamicSideMenu: Setting[Boolean] =
137-
BooleanSetting("-dynamic-side-menu", "Generate side menu via JS instead of embedding it in every html file", false)
145+
BooleanSetting(RootSetting, "dynamic-side-menu", "Generate side menu via JS instead of embedding it in every html file", false)
138146

139147
def scaladocSpecificSettings: Set[Setting[?]] =
140148
Set(sourceLinks, legacySourceLink, syntax, revision, externalDocumentationMappings, socialLinks, skipById, skipByRegex, deprecatedSkipPackages, docRootContent, snippetCompiler, generateInkuire, defaultTemplate, scastieConfiguration, quickLinks, dynamicSideMenu)

0 commit comments

Comments
 (0)