Skip to content

Commit 88b3d87

Browse files
authored
Migrate to Docusaurus v3, add local search plugin (#2590)
* Migrate to Docusaurus v3, add local search plugin * Update node to 18 * Swap '/' to '\'
1 parent 6335d29 commit 88b3d87

File tree

10 files changed

+4867
-5431
lines changed

10 files changed

+4867
-5431
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ jobs:
724724
jvm: "zulu:17"
725725
- uses: actions/setup-node@v4
726726
with:
727-
node-version: '16.x'
727+
node-version: 18
728728
- name: Build documentation
729729
run: .github/scripts/build-website.sh
730730
- name: Test documentation

.github/workflows/website.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
submodules: true
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: '16.x'
17+
node-version: 18
1818
- run: .github/scripts/update-website.sh
1919
env:
2020
GIT_USER: Virtuslab

website/docs/commands/basics.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Basics
33
sidebar_position: 3
44
---
5-
65
import {ChainedSnippets} from "../../src/components/MarkdownComponents.js";
76

7+
88
Scala CLI is a command line tool that executes a given sub-command on the inputs it’s provided with, using a
99
given [configuration](/docs/guides/configuration.md) to produce a result.
1010

@@ -174,7 +174,7 @@ Make sure that you trust the code that you are about to run.
174174
Scala CLI accepts input via URLs pointing at `.scala` files.
175175
It downloads their content, and runs them:
176176

177-
<ChainedSnippet>
177+
<ChainedSnippets>
178178

179179
```bash
180180
scala-cli https://gist.github.com/alexarchambault/f972d941bc4a502d70267cfbbc4d6343/raw/2691c01984c9249936a625a42e29a822a357b0f6/Test.scala
@@ -184,7 +184,7 @@ scala-cli https://gist.github.com/alexarchambault/f972d941bc4a502d70267cfbbc4d63
184184
Hello from Scala GitHub Gist
185185
```
186186

187-
</ChainedSnippet>
187+
</ChainedSnippets>
188188

189189
### GitHub Gist
190190

website/docs/commands/publishing/publish-setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ scala-cli --power config publish.user.email "[email protected]"
6666
scala-cli --power config publish.user.url "https://alex.me"
6767
```
6868

69-
<!-- clear -->
69+
\<!-- clear -->
7070

7171
The email can be left empty if you'd rather not put your email in POM files:
7272
```bash
@@ -151,7 +151,7 @@ scala-cli config github.token "command:xclip -selection clipboard -o" --password
151151
`publish setup` infers some publishing parameters from the GitHub URL of your project.
152152
It also uploads repository secrets there, when setting up publishing on GitHub actions.
153153

154-
To create a new repository from a project, head to <https://repo.new>, pick a name
154+
To create a new repository from a project, head to `https://repo.new`, pick a name
155155
for your project and create the repository. Note its URL, and do
156156
```bash ignore
157157
scala-cli default-file .gitignore --write # if you don't have a .gitignore already

website/docs/cookbooks/emacs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 14
44
---
55

66
Emacs users can make it easier to use Scala CLI from within their editor by
7-
loading an extension: <https://github.com/ag91/scala-cli-repl>.
7+
loading an extension: [https://github.com/ag91/scala-cli-repl](https://github.com/ag91/scala-cli-repl).
88

99
That lets you send Scala code directly from your buffer to the Scala REPL.
1010

website/docs/guides/shebang.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Shebang
33
sidebar_position: 31
44
---
5+
import {ChainedSnippets} from "../../src/components/MarkdownComponents.js";
56

67

78
This guide explains the differences between the `run` and `shebang` sub-commands, mainly covering how each of them

website/docs/release_notes.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: Release notes
33
sidebar_position: 99
44
---
5+
import {ChainedSnippets} from "../src/components/MarkdownComponents.js";
56
import ReactPlayer from 'react-player'
67

78

@@ -27,7 +28,7 @@ scala-cli -e 'println(System.getProperty("java.version"))'
2728
# might give more details.
2829
```
2930

30-
This is because we no longer support JVM <17 with Scala CLI v1.0.5, but we still have been defaulting to whatever JVM
31+
This is because we no longer support JVM \<17 with Scala CLI v1.0.5, but we still have been defaulting to whatever JVM
3132
was defined in `JAVA_HOME`. As a result, Bloop has been failing to start when running with, say, `JAVA_HOME` pointing
3233
to Java 8.
3334

@@ -2159,7 +2160,7 @@ Added in [#1347](https://github.com/VirtusLab/scala-cli/pull/1347) by [@wleczny]
21592160
#### Fixes
21602161

21612162
* Ensure directories are created recursively when the `package` sub-command is called by [@Gedochao](https://github.com/Gedochao) in [#1371](https://github.com/VirtusLab/scala-cli/pull/1371)
2162-
* Fix calculation of Scala version and turn off the `-release` flag for 2.12.x < 2.12.5 by [@Gedochao](https://github.com/Gedochao) in [#1377](https://github.com/VirtusLab/scala-cli/pull/1377)
2163+
* Fix calculation of Scala version and turn off the `-release` flag for 2.12.x \< 2.12.5 by [@Gedochao](https://github.com/Gedochao) in [#1377](https://github.com/VirtusLab/scala-cli/pull/1377)
21632164
* Fix finding main classes in external jars by [@Gedochao](https://github.com/Gedochao) in [#1380](https://github.com/VirtusLab/scala-cli/pull/1380)
21642165
* Fix Js split style SmallModulesFor in pure JVM by [@lwronski](https://github.com/lwronski) in [#1394](https://github.com/VirtusLab/scala-cli/pull/1394)
21652166

@@ -2187,7 +2188,7 @@ Added in [#1347](https://github.com/VirtusLab/scala-cli/pull/1347) by [@wleczny]
21872188

21882189
## [v0.1.14](https://github.com/VirtusLab/scala-cli/releases/tag/v0.1.14)
21892190

2190-
### Hotfix printing stacktraces from Scala CLI runner for Scala 3.x < 3.2.0
2191+
### Hotfix printing stacktraces from Scala CLI runner for Scala 3.x \< 3.2.0
21912192
We fixed a nasty bug breaking any Scala CLI run using any Scala 3 version earlier than 3.2.0 on printing stacktraces.
21922193
Only Scala CLI 0.1.13 was affected.
21932194
```

website/docusaurus.config.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** @type {import('@docusaurus/types').DocusaurusConfig} */
22

3-
const lightCodeTheme = require('prism-react-renderer/themes/github');
4-
const darkCodeTheme = require('prism-react-renderer/themes/dracula');
3+
const lightCodeTheme = require('prism-react-renderer').themes.github;
4+
const darkCodeTheme = require('prism-react-renderer').themes.dracula;
55

66
module.exports = {
77
title: 'Scala CLI',
@@ -13,14 +13,9 @@ module.exports = {
1313
favicon: 'img/favicon.ico',
1414
organizationName: 'Virtuslab',
1515
projectName: 'scala-cli',
16-
plugins: ['docusaurus-plugin-sass'],
16+
plugins: ['docusaurus-plugin-sass', "@easyops-cn/docusaurus-search-local"],
1717
themeConfig: {
1818
image: "img/logo.png",
19-
algolia: {
20-
apiKey: '254542739498a46e1392862504c0b4a1',
21-
indexName: 'scala-cli',
22-
appId: 'BH4D9OD16A',
23-
},
2419
prism: {
2520
theme: lightCodeTheme,
2621
darkTheme: darkCodeTheme,

website/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@
1414
"write-heading-ids": "docusaurus write-heading-ids"
1515
},
1616
"dependencies": {
17-
"@docusaurus/core": "2.3.1",
18-
"@docusaurus/preset-classic": "2.3.1",
19-
"@mdx-js/react": "^1.6.22",
17+
"@docusaurus/core": "3.0.0",
18+
"@docusaurus/preset-classic": "3.0.0",
19+
"@easyops-cn/docusaurus-search-local": "^0.38.1",
20+
"@mdx-js/react": "^3.0.0",
2021
"clsx": "^1.2.1",
21-
"docusaurus-plugin-sass": "^0.2.3",
22+
"docusaurus-plugin-sass": "^0.2.5",
2223
"react": "^18.2.0",
2324
"react-dom": "^18.2.0",
2425
"react-player": "^2.11.2",

0 commit comments

Comments
 (0)