diff options
-rw-r--r-- | .cargo/config | 2 | ||||
-rw-r--r-- | .travis.yml | 4 | ||||
-rw-r--r-- | Cargo.toml | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | website/src/index.html | 21 | ||||
-rw-r--r-- | website/src/wasm-demo/index.html | 13 | ||||
-rw-r--r-- | website/website-gen/Cargo.toml | 9 | ||||
-rw-r--r-- | website/website-gen/src/main.rs | 64 |
8 files changed, 4 insertions, 113 deletions
diff --git a/.cargo/config b/.cargo/config index 9f9b24a49..92a3acfd0 100644 --- a/.cargo/config +++ b/.cargo/config | |||
@@ -5,8 +5,6 @@ gen-syntax = "run --package ra_tools --bin ra_tools -- gen-syntax" | |||
5 | # Extracts the tests from | 5 | # Extracts the tests from |
6 | gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" | 6 | gen-tests = "run --package ra_tools --bin ra_tools -- gen-tests" |
7 | 7 | ||
8 | build-website = "run --package website-gen" | ||
9 | |||
10 | # Installs the visual studio code extension | 8 | # Installs the visual studio code extension |
11 | install-ra = "run --package ra_tools --bin ra_tools -- install-ra" | 9 | install-ra = "run --package ra_tools --bin ra_tools -- install-ra" |
12 | install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias | 10 | install-code = "run --package ra_tools --bin ra_tools -- install-ra" # just an alias |
diff --git a/.travis.yml b/.travis.yml index 65a08cbcd..7d66f72d8 100644 --- a/.travis.yml +++ b/.travis.yml | |||
@@ -28,7 +28,7 @@ matrix: | |||
28 | language: rust | 28 | language: rust |
29 | rust: stable | 29 | rust: stable |
30 | script: | 30 | script: |
31 | - cargo build-website | 31 | - cargo doc --all --no-deps |
32 | env: | 32 | env: |
33 | - RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0 | 33 | - RUSTFLAGS="-D warnings", CARGO_INCREMENTAL=0 |
34 | 34 | ||
@@ -59,7 +59,7 @@ deploy: | |||
59 | skip-cleanup: true | 59 | skip-cleanup: true |
60 | github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable | 60 | github-token: $DOCS_TOKEN # Set in the settings page of your repository, as a secure variable |
61 | keep-history: false | 61 | keep-history: false |
62 | local-dir: target/website/ | 62 | local-dir: target/doc |
63 | on: | 63 | on: |
64 | branch: master | 64 | branch: master |
65 | condition: $DEPLOY_DOCS = 1 | 65 | condition: $DEPLOY_DOCS = 1 |
diff --git a/Cargo.toml b/Cargo.toml index c7e1f1215..6ec176cf7 100644 --- a/Cargo.toml +++ b/Cargo.toml | |||
@@ -1,5 +1,5 @@ | |||
1 | [workspace] | 1 | [workspace] |
2 | members = [ "crates/*", "website/website-gen" ] | 2 | members = [ "crates/*" ] |
3 | 3 | ||
4 | [profile.dev] | 4 | [profile.dev] |
5 | debug = 1 # only line info | 5 | debug = 1 # only line info |
@@ -59,7 +59,7 @@ https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frls-2.2E0 | |||
59 | ## Quick Links | 59 | ## Quick Links |
60 | 60 | ||
61 | * Work List: https://paper.dropbox.com/doc/RLS-2.0-work-list--AZ3BgHKKCtqszbsi3gi6sjchAQ-42vbnxzuKq2lKwW0mkn8Y | 61 | * Work List: https://paper.dropbox.com/doc/RLS-2.0-work-list--AZ3BgHKKCtqszbsi3gi6sjchAQ-42vbnxzuKq2lKwW0mkn8Y |
62 | * API docs: https://rust-analyzer.github.io/rust-analyzer/api-docs/ra_ide_api/ | 62 | * API docs: https://rust-analyzer.github.io/rust-analyzer/ra_ide_api/ |
63 | * CI: https://travis-ci.org/rust-analyzer/rust-analyzer | 63 | * CI: https://travis-ci.org/rust-analyzer/rust-analyzer |
64 | 64 | ||
65 | ## License | 65 | ## License |
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] | ||
2 | name = "website-gen" | ||
3 | version = "0.0.0" | ||
4 | authors = ["Aleksey Kladov <[email protected]>"] | ||
5 | edition = "2018" | ||
6 | publish = false | ||
7 | |||
8 | [dependencies] | ||
9 | walkdir = "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 @@ | |||
1 | use std::{fs, path::Path, process::Command}; | ||
2 | |||
3 | type 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 | ||
6 | fn main() { | ||
7 | if let Err(err) = try_main() { | ||
8 | eprintln!("{}", err); | ||
9 | std::process::exit(-1); | ||
10 | } | ||
11 | } | ||
12 | |||
13 | fn try_main() -> Result<()> { | ||
14 | check_cwd()?; | ||
15 | build_scaffold()?; | ||
16 | build_docs()?; | ||
17 | println!("Finished\n./target/website/index.html"); | ||
18 | Ok(()) | ||
19 | } | ||
20 | |||
21 | fn cargo() -> Command { | ||
22 | Command::new("cargo") | ||
23 | } | ||
24 | |||
25 | fn 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 | |||
33 | fn 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 | |||
42 | fn build_scaffold() -> Result<()> { | ||
43 | sync_dir("./website/src", "./target/website") | ||
44 | } | ||
45 | |||
46 | fn 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 | } | ||