aboutsummaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-10-17 20:37:01 +0100
committerAleksey Kladov <[email protected]>2019-10-17 20:37:01 +0100
commit9a7c8d4b0ff3b9a7d736bbda68e12a9f3867ec1b (patch)
tree030cdccce151f42e6b560142cd52f059e20bebd8 /website
parent6df2bcd7ca97261b59ca04a85b7355432a63c0d9 (diff)
scale website back
We have dedicated https://rust-analyzer.github.io/ now
Diffstat (limited to 'website')
-rw-r--r--website/src/index.html21
-rw-r--r--website/src/wasm-demo/index.html13
-rw-r--r--website/website-gen/Cargo.toml9
-rw-r--r--website/website-gen/src/main.rs64
4 files changed, 0 insertions, 107 deletions
diff --git a/website/src/index.html b/website/src/index.html
deleted file mode 100644
index 6fe22227b..000000000
--- a/website/src/index.html
+++ /dev/null
@@ -1,21 +0,0 @@
1<!DOCTYPE HTML>
2<html>
3
4<head>
5 <meta charset="utf-8">
6 <title>Hello World! Site Title</title>
7</head>
8
9<body>
10 <h1>rust-analyzer</h1>
11 <ul>
12 <li>
13 <a href="./api-docs/ra_ide_api/">API Docs</a>
14 </li>
15 <li>
16 <a href="./wasm-demo/">WASM Demo</a>
17 </li>
18 </ul>
19</body>
20
21</html>
diff --git a/website/src/wasm-demo/index.html b/website/src/wasm-demo/index.html
deleted file mode 100644
index e81ccb0f7..000000000
--- a/website/src/wasm-demo/index.html
+++ /dev/null
@@ -1,13 +0,0 @@
1<!DOCTYPE HTML>
2<html>
3
4<head>
5 <meta charset="utf-8">
6 <title>Hello World! Site Title</title>
7</head>
8
9<body>
10 TBD
11</body>
12
13</html>
diff --git a/website/website-gen/Cargo.toml b/website/website-gen/Cargo.toml
deleted file mode 100644
index b471a81fd..000000000
--- a/website/website-gen/Cargo.toml
+++ /dev/null
@@ -1,9 +0,0 @@
1[package]
2name = "website-gen"
3version = "0.0.0"
4authors = ["Aleksey Kladov <[email protected]>"]
5edition = "2018"
6publish = false
7
8[dependencies]
9walkdir = "2.2.0"
diff --git a/website/website-gen/src/main.rs b/website/website-gen/src/main.rs
deleted file mode 100644
index 7d35a37cf..000000000
--- a/website/website-gen/src/main.rs
+++ /dev/null
@@ -1,64 +0,0 @@
1use std::{fs, path::Path, process::Command};
2
3type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
4
5/// This tool builds the github-pages website to the `./target/website` folder
6fn main() {
7 if let Err(err) = try_main() {
8 eprintln!("{}", err);
9 std::process::exit(-1);
10 }
11}
12
13fn try_main() -> Result<()> {
14 check_cwd()?;
15 build_scaffold()?;
16 build_docs()?;
17 println!("Finished\n./target/website/index.html");
18 Ok(())
19}
20
21fn cargo() -> Command {
22 Command::new("cargo")
23}
24
25fn check_cwd() -> Result<()> {
26 let toml = std::fs::read_to_string("./Cargo.toml")?;
27 if !toml.contains("[workspace]") {
28 Err("website-gen should be run from the root of workspace")?;
29 }
30 Ok(())
31}
32
33fn build_docs() -> Result<()> {
34 let status = cargo().args(&["doc", "--all", "--no-deps"]).status()?;
35 if !status.success() {
36 Err("cargo doc failed")?;
37 }
38 sync_dir("./target/doc", "./target/website/api-docs")?;
39 Ok(())
40}
41
42fn build_scaffold() -> Result<()> {
43 sync_dir("./website/src", "./target/website")
44}
45
46fn sync_dir(src: impl AsRef<Path>, dst: impl AsRef<Path>) -> Result<()> {
47 return sync_dir(src.as_ref(), dst.as_ref());
48
49 fn sync_dir(src: &Path, dst: &Path) -> Result<()> {
50 let _ = fs::remove_dir_all(dst);
51 fs::create_dir_all(dst)?;
52 for entry in walkdir::WalkDir::new(src) {
53 let entry = entry?;
54 let src_path = entry.path();
55 let dst_path = dst.join(src_path.strip_prefix(src)?);
56 if src_path.is_dir() {
57 fs::create_dir_all(dst_path)?;
58 } else {
59 fs::copy(src_path, dst_path)?;
60 }
61 }
62 Ok(())
63 }
64}