Skip to content

Commit e41a69c

Browse files
committed
Fix docs changing
1 parent bd3df7f commit e41a69c

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

modules/generate-reference-doc/src/main/scala/scala/cli/doc/GenerateReferenceDoc.scala

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ object GenerateReferenceDoc extends CaseApp[Options] {
9494
b.append(
9595
"""---
9696
|title: Command-line options
97+
|sidebar_position: 1
9798
|---
9899
|
99100
|""".stripMargin
@@ -107,7 +108,7 @@ object GenerateReferenceDoc extends CaseApp[Options] {
107108
// https://scala-cli.virtuslab.org/docs/reference/commands#install-completions
108109
val names = c.names.map(_.mkString(" "))
109110
val text = names.map("`" + _ + "`").mkString(" / ")
110-
s"[$text](./commands#${names.head.replace(" ", "-")})"
111+
s"[$text](./commands.md#${names.head.replace(" ", "-")})"
111112
}
112113
val availableIn = "Available in commands:\n" + formattedCommands.map("- " + _ + "\n").mkString
113114
b.append(
@@ -154,6 +155,7 @@ object GenerateReferenceDoc extends CaseApp[Options] {
154155
b.append(
155156
"""---
156157
|title: Commands
158+
|sidebar_position: 3
157159
|---
158160
|
159161
|""".stripMargin
@@ -195,7 +197,7 @@ object GenerateReferenceDoc extends CaseApp[Options] {
195197
.split("\\s+")
196198
.map(_.toLowerCase(Locale.ROOT).filter(_ != '.'))
197199
.mkString("-")
198-
s"[$cleanedUp](/docs/reference/cli-options#$linkPart-options)"
200+
s"[$cleanedUp](./cli-options.md#$linkPart-options)"
199201
}
200202
b.append(
201203
"""Accepts options:
@@ -229,6 +231,7 @@ object GenerateReferenceDoc extends CaseApp[Options] {
229231
b.append(
230232
"""---
231233
|title: Directives
234+
|sidebar_position: 2
232235
|---
233236
|
234237
|## using directives
@@ -291,8 +294,8 @@ object GenerateReferenceDoc extends CaseApp[Options] {
291294

292295
if (options.check) {
293296
val content = Seq(
294-
(os.rel / "01-cli-options.md") -> cliOptionsContent0,
295-
(os.rel / "03-commands.md") -> commandsContent0
297+
(os.rel / "cli-options.md") -> cliOptionsContent0,
298+
(os.rel / "commands.md") -> commandsContent0
296299
)
297300
var anyDiff = false
298301
for ((dest, content0) <- content) {
@@ -313,9 +316,9 @@ object GenerateReferenceDoc extends CaseApp[Options] {
313316
sys.exit(1)
314317
}
315318
else {
316-
maybeWrite(options.outputPath / "01-cli-options.md", cliOptionsContent0)
317-
maybeWrite(options.outputPath / "03-commands.md", commandsContent0)
318-
maybeWrite(options.outputPath / "02-directives.md", usingContent0)
319+
maybeWrite(options.outputPath / "cli-options.md", cliOptionsContent0)
320+
maybeWrite(options.outputPath / "commands.md", commandsContent0)
321+
maybeWrite(options.outputPath / "directives.md", usingContent0)
319322
}
320323
}
321324
}

modules/generate-reference-doc/src/main/scala/scala/cli/doc/Options.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package scala.cli.doc
22

33
final case class Options(
4-
outputDir: String = "docs/17-reference",
4+
outputDir: String = "website/docs/reference",
55
check: Boolean = false
66
) {
77
lazy val outputPath: os.Path =

0 commit comments

Comments
 (0)